summaryrefslogtreecommitdiff
path: root/src/tests/eet/eet_suite.c
diff options
context:
space:
mode:
authorSavio Sena <savio@expertisesolutions.com.br>2014-05-24 02:27:11 +0200
committerCedric Bail <cedric.bail@free.fr>2014-05-24 02:27:15 +0200
commit72ee78b929d6af5436d09eee1a5ef41719b5f918 (patch)
tree187c336777624af8194778959beb7ff3a65e0cbb /src/tests/eet/eet_suite.c
parente68225ae691bfa5d8df694fc1f4bd96f1fee9003 (diff)
efl: remove some warnings.
Summary: Mainly from the examples but also from libunibreak and tests/eet. I'm not sure if it's really worth to remove warnings from the examples -- because it adds pedantic-ness to something supposed to be didatic, but I leave for you guys to judge. Reviewers: tasn, cedric CC: felipealmeida, raster, smohanty, cedric Differential Revision: https://phab.enlightenment.org/D896 Signed-off-by: Cedric Bail <cedric.bail@free.fr>
Diffstat (limited to 'src/tests/eet/eet_suite.c')
-rw-r--r--src/tests/eet/eet_suite.c40
1 files changed, 28 insertions, 12 deletions
diff --git a/src/tests/eet/eet_suite.c b/src/tests/eet/eet_suite.c
index 43b9fdec7f..7baabe653a 100644
--- a/src/tests/eet/eet_suite.c
+++ b/src/tests/eet/eet_suite.c
@@ -415,7 +415,7 @@ _eet_build_ex_descriptor(Eet_Data_Descriptor *edd, Eina_Bool stream)
415 eet_eina_stream_data_descriptor_class_set(&eddc, 415 eet_eina_stream_data_descriptor_class_set(&eddc,
416 sizeof (Eet_Data_Descriptor_Class), 416 sizeof (Eet_Data_Descriptor_Class),
417 "Eet_Test_Basic_Type", 417 "Eet_Test_Basic_Type",
418 sizeof(Eet_Test_Basic_Type)); 418 sizeof(Eet_Test_Basic_Type));
419 eddb = eet_data_descriptor_stream_new(&eddc); 419 eddb = eet_data_descriptor_stream_new(&eddc);
420 } 420 }
421 else 421 else
@@ -423,7 +423,7 @@ _eet_build_ex_descriptor(Eet_Data_Descriptor *edd, Eina_Bool stream)
423 eet_eina_file_data_descriptor_class_set(&eddc, 423 eet_eina_file_data_descriptor_class_set(&eddc,
424 sizeof (Eet_Data_Descriptor_Class), 424 sizeof (Eet_Data_Descriptor_Class),
425 "Eet_Test_Basic_Type", 425 "Eet_Test_Basic_Type",
426 sizeof(Eet_Test_Basic_Type)); 426 sizeof(Eet_Test_Basic_Type));
427 eddb = eet_data_descriptor_file_new(&eddc); 427 eddb = eet_data_descriptor_file_new(&eddc);
428 } 428 }
429 fail_if(!eddb); 429 fail_if(!eddb);
@@ -968,10 +968,12 @@ START_TEST(eet_file_simple_write)
968 char *test; 968 char *test;
969 char *file = strdup("/tmp/eet_suite_testXXXXXX"); 969 char *file = strdup("/tmp/eet_suite_testXXXXXX");
970 int size; 970 int size;
971 int tmpfd;
971 972
972 eet_init(); 973 eet_init();
973 974
974 fail_if(!(file = tmpnam(file))); 975 fail_if(-1 == (tmpfd = mkstemp(file)));
976 fail_if(!!close(tmpfd));
975 977
976 fail_if(eet_mode_get(NULL) != EET_FILE_MODE_INVALID); 978 fail_if(eet_mode_get(NULL) != EET_FILE_MODE_INVALID);
977 979
@@ -1040,6 +1042,7 @@ START_TEST(eet_file_data_test)
1040 Eet_Test_Ex_Type etbt; 1042 Eet_Test_Ex_Type etbt;
1041 int size; 1043 int size;
1042 int test; 1044 int test;
1045 int tmpfd;
1043 1046
1044 eet_init(); 1047 eet_init();
1045 1048
@@ -1071,7 +1074,8 @@ START_TEST(eet_file_data_test)
1071 1074
1072 _eet_build_ex_descriptor(edd, EINA_FALSE); 1075 _eet_build_ex_descriptor(edd, EINA_FALSE);
1073 1076
1074 fail_if(!(file = tmpnam(file))); 1077 fail_if(-1 == (tmpfd = mkstemp(file)));
1078 fail_if(!!close(tmpfd));
1075 1079
1076 /* Insert an error in etbt. */ 1080 /* Insert an error in etbt. */
1077 etbt.i = 0; 1081 etbt.i = 0;
@@ -1194,6 +1198,7 @@ START_TEST(eet_file_data_dump_test)
1194 char *string1; 1198 char *string1;
1195 char *file = strdup("/tmp/eet_suite_testXXXXXX"); 1199 char *file = strdup("/tmp/eet_suite_testXXXXXX");
1196 int test; 1200 int test;
1201 int tmpfd;
1197 1202
1198 eet_init(); 1203 eet_init();
1199 1204
@@ -1223,7 +1228,8 @@ START_TEST(eet_file_data_dump_test)
1223 1228
1224 _eet_build_ex_descriptor(edd, EINA_FALSE); 1229 _eet_build_ex_descriptor(edd, EINA_FALSE);
1225 1230
1226 fail_if(!(file = tmpnam(file))); 1231 fail_if(-1 == (tmpfd = mkstemp(file)));
1232 fail_if(!!close(tmpfd));
1227 1233
1228 /* Save the encoded data in a file. */ 1234 /* Save the encoded data in a file. */
1229 ef = eet_open(file, EET_FILE_MODE_WRITE); 1235 ef = eet_open(file, EET_FILE_MODE_WRITE);
@@ -1294,10 +1300,12 @@ START_TEST(eet_image)
1294 int alpha; 1300 int alpha;
1295 unsigned int w; 1301 unsigned int w;
1296 unsigned int h; 1302 unsigned int h;
1303 int tmpfd;
1297 1304
1298 eet_init(); 1305 eet_init();
1299 1306
1300 fail_if(!(file = tmpnam(file))); 1307 fail_if(-1 == (tmpfd = mkstemp(file)));
1308 fail_if(!!close(tmpfd));
1301 1309
1302 /* Save the encoded data in a file. */ 1310 /* Save the encoded data in a file. */
1303 ef = eet_open(file, EET_FILE_MODE_READ_WRITE); 1311 ef = eet_open(file, EET_FILE_MODE_READ_WRITE);
@@ -1660,6 +1668,7 @@ START_TEST(eet_small_image)
1660 int quality; 1668 int quality;
1661 Eet_Image_Encoding lossy; 1669 Eet_Image_Encoding lossy;
1662 int result; 1670 int result;
1671 int tmpfd;
1663 1672
1664 image[0] = IM0; 1673 image[0] = IM0;
1665 image[1] = IM1; 1674 image[1] = IM1;
@@ -1668,7 +1677,8 @@ START_TEST(eet_small_image)
1668 1677
1669 eet_init(); 1678 eet_init();
1670 1679
1671 fail_if(!(file = tmpnam(file))); 1680 fail_if(-1 == (tmpfd = mkstemp(file)));
1681 fail_if(!!close(tmpfd));
1672 1682
1673 ef = eet_open(file, EET_FILE_MODE_WRITE); 1683 ef = eet_open(file, EET_FILE_MODE_WRITE);
1674 fail_if(!ef); 1684 fail_if(!ef);
@@ -1720,7 +1730,8 @@ START_TEST(eet_identity_simple)
1720 1730
1721 eet_init(); 1731 eet_init();
1722 1732
1723 fail_if(!(file = tmpnam(file))); 1733 fail_if(-1 == (fd = mkstemp(file)));
1734 fail_if(!!close(fd));
1724 fail_if(!(noread = fopen("/dev/null", "w"))); 1735 fail_if(!(noread = fopen("/dev/null", "w")));
1725 1736
1726 /* Sign an eet file. */ 1737 /* Sign an eet file. */
@@ -1880,10 +1891,12 @@ START_TEST(eet_cipher_decipher_simple)
1880 char *test; 1891 char *test;
1881 char *file = strdup("/tmp/eet_suite_testXXXXXX"); 1892 char *file = strdup("/tmp/eet_suite_testXXXXXX");
1882 int size; 1893 int size;
1894 int tmpfd;
1883 1895
1884 eet_init(); 1896 eet_init();
1885 1897
1886 fail_if(!(file = tmpnam(file))); 1898 fail_if(-1 == (tmpfd = mkstemp(file)));
1899 fail_if(!!close(tmpfd));
1887 1900
1888 /* Crypt an eet file. */ 1901 /* Crypt an eet file. */
1889 ef = eet_open(file, EET_FILE_MODE_WRITE); 1902 ef = eet_open(file, EET_FILE_MODE_WRITE);
@@ -1966,6 +1979,7 @@ START_TEST(eet_cache_concurrency)
1966 unsigned int n; 1979 unsigned int n;
1967 Eina_Thread thread; 1980 Eina_Thread thread;
1968 Eina_Bool r; 1981 Eina_Bool r;
1982 int tmpfd;
1969 1983
1970 eet_init(); 1984 eet_init();
1971 eina_threads_init(); 1985 eina_threads_init();
@@ -1974,7 +1988,8 @@ START_TEST(eet_cache_concurrency)
1974 eina_condition_new(&open_worker_cond, &open_worker_mutex); 1988 eina_condition_new(&open_worker_cond, &open_worker_mutex);
1975 1989
1976 /* create a file to test with */ 1990 /* create a file to test with */
1977 fail_if(!(file = tmpnam(file))); 1991 fail_if(-1 == (tmpfd = mkstemp(file)));
1992 fail_if(!!close(tmpfd));
1978 ef = eet_open(file, EET_FILE_MODE_WRITE); 1993 ef = eet_open(file, EET_FILE_MODE_WRITE);
1979 fail_if(!ef); 1994 fail_if(!ef);
1980 fail_if(!eet_write(ef, "keys/tests", buffer, strlen(buffer) + 1, 0)); 1995 fail_if(!eet_write(ef, "keys/tests", buffer, strlen(buffer) + 1, 0));
@@ -2235,6 +2250,7 @@ START_TEST(eet_file_fp)
2235 Eet_5FP origin; 2250 Eet_5FP origin;
2236 Eet_5DBL *convert; 2251 Eet_5DBL *convert;
2237 Eet_5FP *build; 2252 Eet_5FP *build;
2253 int tmpfd;
2238 2254
2239 eet_init(); 2255 eet_init();
2240 2256
@@ -2262,7 +2278,8 @@ START_TEST(eet_file_fp)
2262 origin.f1 = eina_f32p32_int_from(1); 2278 origin.f1 = eina_f32p32_int_from(1);
2263 origin.f0 = 0; 2279 origin.f0 = 0;
2264 2280
2265 fail_if(!(file = tmpnam(file))); 2281 fail_if(-1 == (tmpfd = mkstemp(file)));
2282 fail_if(!!close(tmpfd));
2266 2283
2267 ef = eet_open(file, EET_FILE_MODE_READ_WRITE); 2284 ef = eet_open(file, EET_FILE_MODE_READ_WRITE);
2268 fail_if(!ef); 2285 fail_if(!ef);
@@ -2871,4 +2888,3 @@ main(int argc EINA_UNUSED, char *argv[])
2871 2888
2872 return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 2889 return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
2873} /* main */ 2890} /* main */
2874