summaryrefslogtreecommitdiff
path: root/src/tests/eet/eet_suite.c
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-07-15 12:41:18 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-07-15 17:04:34 +0900
commit4a183ac1a8a6c80f3cbfb5ffb4b1507da5dda642 (patch)
treec4b4d78a71c759be69c41fc0f0f2fb7d72478db7 /src/tests/eet/eet_suite.c
parent9d2249c1a812748900febb7784c6c59b5075a548 (diff)
eet: fix test suite to always use the proper data descriptor type.
Diffstat (limited to '')
-rw-r--r--src/tests/eet/eet_suite.c54
1 files changed, 32 insertions, 22 deletions
diff --git a/src/tests/eet/eet_suite.c b/src/tests/eet/eet_suite.c
index 5067208ec5..db16719837 100644
--- a/src/tests/eet/eet_suite.c
+++ b/src/tests/eet/eet_suite.c
@@ -382,16 +382,28 @@ static int i42 = 42;
382static int i7 = 7; 382static int i7 = 7;
383 383
384static void 384static void
385_eet_build_ex_descriptor(Eet_Data_Descriptor *edd) 385_eet_build_ex_descriptor(Eet_Data_Descriptor *edd, Eina_Bool stream)
386{ 386{
387 Eet_Data_Descriptor_Class eddc; 387 Eet_Data_Descriptor_Class eddc;
388 Eet_Test_Ex_Type etbt; 388 Eet_Test_Ex_Type etbt;
389 Eet_Data_Descriptor *eddb; 389 Eet_Data_Descriptor *eddb;
390 390
391 eet_test_setup_eddc(&eddc); 391 if (stream)
392 eddc.name = "Eet_Test_Basic_Type"; 392 {
393 eddc.size = sizeof(Eet_Test_Basic_Type); 393 eet_eina_stream_data_descriptor_class_set(&eddc,
394 eddb = eet_data_descriptor_file_new(&eddc); 394 sizeof (Eet_Data_Descriptor_Class),
395 "Eet_Test_Basic_Type",
396 sizeof(Eet_Test_Basic_Type));
397 eddb = eet_data_descriptor_stream_new(&eddc);
398 }
399 else
400 {
401 eet_eina_file_data_descriptor_class_set(&eddc,
402 sizeof (Eet_Data_Descriptor_Class),
403 "Eet_Test_Basic_Type",
404 sizeof(Eet_Test_Basic_Type));
405 eddb = eet_data_descriptor_file_new(&eddc);
406 }
395 fail_if(!eddb); 407 fail_if(!eddb);
396 408
397 _eet_build_basic_descriptor(eddb); 409 _eet_build_basic_descriptor(eddb);
@@ -745,7 +757,7 @@ START_TEST(eet_test_data_type_encoding_decoding)
745 edd = eet_data_descriptor_file_new(&eddc); 757 edd = eet_data_descriptor_file_new(&eddc);
746 fail_if(!edd); 758 fail_if(!edd);
747 759
748 _eet_build_ex_descriptor(edd); 760 _eet_build_ex_descriptor(edd, EINA_FALSE);
749 761
750 transfert = eet_data_descriptor_encode(edd, &etbt, &size); 762 transfert = eet_data_descriptor_encode(edd, &etbt, &size);
751 fail_if(!transfert || size <= 0); 763 fail_if(!transfert || size <= 0);
@@ -836,7 +848,7 @@ START_TEST(eet_test_data_type_dump_undump)
836 edd = eet_data_descriptor_file_new(&eddc); 848 edd = eet_data_descriptor_file_new(&eddc);
837 fail_if(!edd); 849 fail_if(!edd);
838 850
839 _eet_build_ex_descriptor(edd); 851 _eet_build_ex_descriptor(edd, EINA_FALSE);
840 852
841 transfert1 = eet_data_descriptor_encode(edd, &etbt, &size1); 853 transfert1 = eet_data_descriptor_encode(edd, &etbt, &size1);
842 fail_if(!transfert1 || size1 <= 0); 854 fail_if(!transfert1 || size1 <= 0);
@@ -989,7 +1001,7 @@ START_TEST(eet_file_data_test)
989 edd = eet_data_descriptor_file_new(&eddc); 1001 edd = eet_data_descriptor_file_new(&eddc);
990 fail_if(!edd); 1002 fail_if(!edd);
991 1003
992 _eet_build_ex_descriptor(edd); 1004 _eet_build_ex_descriptor(edd, EINA_FALSE);
993 1005
994 fail_if(!(file = tmpnam(file))); 1006 fail_if(!(file = tmpnam(file)));
995 1007
@@ -1141,7 +1153,7 @@ START_TEST(eet_file_data_dump_test)
1141 edd = eet_data_descriptor_file_new(&eddc); 1153 edd = eet_data_descriptor_file_new(&eddc);
1142 fail_if(!edd); 1154 fail_if(!edd);
1143 1155
1144 _eet_build_ex_descriptor(edd); 1156 _eet_build_ex_descriptor(edd, EINA_FALSE);
1145 1157
1146 fail_if(!(file = tmpnam(file))); 1158 fail_if(!(file = tmpnam(file)));
1147 1159
@@ -2005,7 +2017,6 @@ _eet_connection_write(const void *data,
2005 2017
2006START_TEST(eet_connection_check) 2018START_TEST(eet_connection_check)
2007{ 2019{
2008 Eet_Connection *conn;
2009 Eet_Data_Descriptor *edd; 2020 Eet_Data_Descriptor *edd;
2010 Eet_Data_Descriptor_Class eddc; 2021 Eet_Data_Descriptor_Class eddc;
2011 Eet_Connection_Data ecd; 2022 Eet_Connection_Data ecd;
@@ -2031,30 +2042,29 @@ START_TEST(eet_connection_check)
2031 memset(&etbt.charray, 0, sizeof(etbt.charray)); 2042 memset(&etbt.charray, 0, sizeof(etbt.charray));
2032 etbt.charray[0] = "test"; 2043 etbt.charray[0] = "test";
2033 2044
2034 eet_eina_file_data_descriptor_class_set(&eddc, sizeof (eddc), 2045 eet_eina_stream_data_descriptor_class_set(&eddc, sizeof (eddc),
2035 "Eet_Test_Ex_Type", 2046 "Eet_Test_Ex_Type",
2036 sizeof(Eet_Test_Ex_Type)); 2047 sizeof(Eet_Test_Ex_Type));
2037 2048
2038 edd = eet_data_descriptor_file_new(&eddc); 2049 edd = eet_data_descriptor_stream_new(&eddc);
2039 fail_if(!edd); 2050 fail_if(!edd);
2040 2051
2041 _eet_build_ex_descriptor(edd); 2052 _eet_build_ex_descriptor(edd, EINA_TRUE);
2042
2043 /* Create a connection. */
2044 conn = eet_connection_new(_eet_connection_read, _eet_connection_write, &ecd);
2045 fail_if(!conn);
2046 2053
2047 /* Init context. */ 2054 /* Init context. */
2048 ecd.test = EINA_FALSE; 2055 ecd.test = EINA_FALSE;
2049 ecd.conn = conn;
2050 ecd.edd = edd; 2056 ecd.edd = edd;
2051 2057
2058 /* Create a connection. */
2059 ecd.conn = eet_connection_new(_eet_connection_read, _eet_connection_write, &ecd);
2060 fail_if(!ecd.conn);
2061
2052 /* Test the connection. */ 2062 /* Test the connection. */
2053 fail_if(!eet_connection_send(conn, edd, &etbt, NULL)); 2063 fail_if(!eet_connection_send(ecd.conn, edd, &etbt, NULL));
2054 2064
2055 fail_if(!ecd.test); 2065 fail_if(!ecd.test);
2056 2066
2057 fail_if(!eet_connection_close(conn, &on_going)); 2067 fail_if(!eet_connection_close(ecd.conn, &on_going));
2058 2068
2059 fail_if(on_going); 2069 fail_if(on_going);
2060 2070