summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_ecore_file.c
diff options
context:
space:
mode:
authorVincent Torri <vincent dot torri at gmail dot com>2015-12-03 11:42:08 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-12-05 21:06:04 +0100
commit0497b9685c782c24fba84a1d5391edaa8d5ce10a (patch)
tree7a9547ea7ab407cfa555598646302bbc0b21b8c4 /src/tests/ecore/ecore_test_ecore_file.c
parent4f242fb48a5cf18b6e5ea6598681486abf791771 (diff)
efl: add binary mode to open() calls
This allows better compatibility with Windows Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to '')
-rw-r--r--src/tests/ecore/ecore_test_ecore_file.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/tests/ecore/ecore_test_ecore_file.c b/src/tests/ecore/ecore_test_ecore_file.c
index 1e2d801039..28ffb83e5a 100644
--- a/src/tests/ecore/ecore_test_ecore_file.c
+++ b/src/tests/ecore/ecore_test_ecore_file.c
@@ -15,6 +15,10 @@
15 15
16#include "ecore_suite.h" 16#include "ecore_suite.h"
17 17
18#ifndef O_BINARY
19# define O_BINARY 0
20#endif
21
18#define MAXSIZE 256 22#define MAXSIZE 256
19 23
20void 24void
@@ -242,7 +246,7 @@ START_TEST(ecore_test_ecore_file_operations)
242 src_file = get_tmp_file(); 246 src_file = get_tmp_file();
243 fail_if(!src_file); 247 fail_if(!src_file);
244 fail_if(ecore_file_remove(src_file) != EINA_TRUE); 248 fail_if(ecore_file_remove(src_file) != EINA_TRUE);
245 fd = open(src_file, O_RDWR|O_CREAT, 0700); 249 fd = open(src_file, O_RDWR | O_BINARY | O_CREAT, 0700);
246 fail_if(fd < 0); 250 fail_if(fd < 0);
247 fail_if(close(fd) != 0); 251 fail_if(close(fd) != 0);
248 fail_if(ecore_file_can_exec(src_file) != EINA_TRUE); 252 fail_if(ecore_file_can_exec(src_file) != EINA_TRUE);
@@ -295,7 +299,7 @@ START_TEST(ecore_test_ecore_file_operations)
295 src_file = get_tmp_file(); 299 src_file = get_tmp_file();
296 fail_if(!src_file); 300 fail_if(!src_file);
297 fail_if(ecore_file_remove(src_file) != EINA_TRUE); 301 fail_if(ecore_file_remove(src_file) != EINA_TRUE);
298 fd = open(src_file, O_RDWR|O_CREAT, 0400); 302 fd = open(src_file, O_RDWR | O_BINARY | O_CREAT, 0400);
299 fail_if(fd < 0); 303 fail_if(fd < 0);
300 fail_if(close(fd) != 0); 304 fail_if(close(fd) != 0);
301 fail_if(ecore_file_can_read(src_file) != EINA_TRUE); 305 fail_if(ecore_file_can_read(src_file) != EINA_TRUE);
@@ -306,7 +310,7 @@ START_TEST(ecore_test_ecore_file_operations)
306 src_file = get_tmp_file(); 310 src_file = get_tmp_file();
307 fail_if(!src_file); 311 fail_if(!src_file);
308 fail_if(ecore_file_remove(src_file) != EINA_TRUE); 312 fail_if(ecore_file_remove(src_file) != EINA_TRUE);
309 fd = open(src_file, O_RDWR|O_CREAT, 0200); 313 fd = open(src_file, O_RDWR | O_BINARY | O_CREAT, 0200);
310 fail_if(fd < 0); 314 fail_if(fd < 0);
311 fail_if(close(fd) != 0); 315 fail_if(close(fd) != 0);
312 fail_if(ecore_file_can_read(src_file) != EINA_FALSE); 316 fail_if(ecore_file_can_read(src_file) != EINA_FALSE);
@@ -316,7 +320,7 @@ START_TEST(ecore_test_ecore_file_operations)
316 src_file = get_tmp_file(); 320 src_file = get_tmp_file();
317 fail_if(!src_file); 321 fail_if(!src_file);
318 fail_if(ecore_file_remove(src_file) != EINA_TRUE); 322 fail_if(ecore_file_remove(src_file) != EINA_TRUE);
319 fd = open(src_file, O_RDWR|O_CREAT, 0100); 323 fd = open(src_file, O_RDWR | O_BINARY | O_CREAT, 0100);
320 fail_if(fd < 0); 324 fail_if(fd < 0);
321 fail_if(close(fd) != 0); 325 fail_if(close(fd) != 0);
322 fail_if(ecore_file_can_read(src_file) != EINA_FALSE); 326 fail_if(ecore_file_can_read(src_file) != EINA_FALSE);
@@ -355,7 +359,7 @@ START_TEST(ecore_test_ecore_file_path)
355 src_file = get_tmp_file(); 359 src_file = get_tmp_file();
356 fail_if(!src_file); 360 fail_if(!src_file);
357 fail_if(ecore_file_remove(src_file) != EINA_TRUE); 361 fail_if(ecore_file_remove(src_file) != EINA_TRUE);
358 fd = open(src_file, O_RDWR|O_CREAT, 0700); 362 fd = open(src_file, O_RDWR | O_BINARY | O_CREAT, 0700);
359 fail_if(fd < 0); 363 fail_if(fd < 0);
360 fail_if(close(fd) != 0); 364 fail_if(close(fd) != 0);
361 fail_if(ecore_file_can_exec(src_file) != EINA_TRUE); 365 fail_if(ecore_file_can_exec(src_file) != EINA_TRUE);