Enlightenment CVS committal
Author : cedric
Project : e17
Module : libs/eet
Dir : e17/libs/eet/src/tests
Modified Files:
eet_suite.c
Log Message:
Fix the bug with EET_T_UNKNOW/EET_G_UNKNOWN that did break the CVS.
Add a test to detect this bug and caught another one, not yet solved
with dump/undump of EET_T_UNKNOW/EET_G_UNKNOWN.
===================================================================
RCS file: /cvs/e/e17/libs/eet/src/tests/eet_suite.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- eet_suite.c 26 Jun 2008 15:47:25 -0000 1.3
+++ eet_suite.c 27 Jun 2008 15:26:53 -0000 1.4
@@ -35,6 +35,8 @@
unsigned short us;
unsigned int ui;
unsigned long long ul;
+ Eet_Test_Basic_Type *empty;
+ Eet_Test_Basic_Type *with;
};
#define EET_TEST_CHAR 0x42
@@ -108,6 +110,33 @@
res->us = EET_TEST_SHORT;
res->ui = EET_TEST_INT;
res->ul = EET_TEST_LONG_LONG;
+ res->empty = NULL;
+ res->with = NULL;
+
+ if (i == 0)
+ {
+ Eet_Test_Basic_Type *tmp;
+
+ tmp = malloc(sizeof (Eet_Test_Basic_Type));
+ fail_if(!tmp);
+
+ res->with = tmp;
+ tmp->c = EET_TEST_CHAR;
+ tmp->s = EET_TEST_SHORT;
+ tmp->i = EET_TEST_INT + i + 1;
+ tmp->l = EET_TEST_LONG_LONG;
+ tmp->str = EET_TEST_STRING;
+ tmp->istr = EET_TEST_STRING;
+ tmp->f1 = - EET_TEST_FLOAT;
+ tmp->d = - EET_TEST_DOUBLE;
+ tmp->f2 = EET_TEST_FLOAT4;
+ tmp->uc = EET_TEST_CHAR;
+ tmp->us = EET_TEST_SHORT;
+ tmp->ui = EET_TEST_INT;
+ tmp->ul = EET_TEST_LONG_LONG;
+ tmp->empty = NULL;
+ tmp->with = NULL;
+ }
}
static void
@@ -137,6 +166,28 @@
tmp = (result->d + EET_TEST_DOUBLE);
if (tmp < 0) tmp = -tmp;
fail_if(tmp > 0.00005);
+
+ fail_if(result->empty != NULL);
+ if (i == 0)
+ {
+ Eet_Test_Basic_Type *tmp;
+
+ tmp = result->with;
+ fail_if(tmp == NULL);
+
+ fail_if(tmp->c != EET_TEST_CHAR);
+ fail_if(tmp->s != EET_TEST_SHORT);
+ fail_if(tmp->i != EET_TEST_INT + i + 1);
+ fail_if(tmp->l != EET_TEST_LONG_LONG);
+ fail_if(strcmp(tmp->str, EET_TEST_STRING) != 0);
+ fail_if(strcmp(tmp->istr, EET_TEST_STRING) != 0);
+ fail_if(tmp->uc != EET_TEST_CHAR);
+ fail_if(tmp->us != EET_TEST_SHORT);
+ fail_if(tmp->ui != EET_TEST_INT);
+ fail_if(tmp->ul != EET_TEST_LONG_LONG);
+ }
+ else
+ fail_if(result->with != NULL);
}
static void
@@ -155,6 +206,9 @@
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Eet_Test_Basic_Type, "us", us,
EET_T_USHORT);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Eet_Test_Basic_Type, "ui", ui,
EET_T_UINT);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Eet_Test_Basic_Type, "ul", ul,
EET_T_ULONG_LONG);
+
+ EET_DATA_DESCRIPTOR_ADD_SUB(edd, Eet_Test_Basic_Type, "empty", empty, edd);
+ EET_DATA_DESCRIPTOR_ADD_SUB(edd, Eet_Test_Basic_Type, "with", with, edd);
}
START_TEST(eet_test_basic_data_type_encoding_decoding)
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs