Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/bin/tests


Modified Files:
        ewl_text.c 


Log Message:
- unit tests don't use Ecore_List anymore just Ewl_Unit_Test *. makes it
  easier to do the initialization
- and an example of how unit tests will be done to tests/ewl_text.c

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/bin/tests/ewl_text.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewl_text.c  2 Mar 2006 23:52:49 -0000       1.1
+++ ewl_text.c  9 Mar 2006 14:53:53 -0000       1.2
@@ -8,6 +8,13 @@
 static void trigger_cb_mouse_in(Ewl_Widget *w, void *ev, void *data);
 static void trigger_cb(Ewl_Widget *w, void *ev, void *data);
 
+static int text_test_set_get(char *buf, int len);
+
+static Ewl_Unit_Test text_unit_tests[] = {
+               {"set/get", text_test_set_get}, 
+               {NULL, NULL}
+       };
+
 void 
 test_info(Ewl_Test *test)
 {
@@ -17,6 +24,7 @@
        test->filename = "ewl_text.c";
        test->func = create_test;
        test->type = EWL_TEST_TYPE_SIMPLE;
+       test->unit_tests = text_unit_tests;
 }
 
 static int
@@ -142,3 +150,23 @@
        ewl_text_color_apply(EWL_TEXT(t->text_parent), 0, 0, 0, 255, t->len);
 }
 
+static int
+text_test_set_get(char *buf, int len)
+{
+       Ewl_Widget *o;
+       char *t;
+       int ret = 0;
+
+       o = ewl_text_new();
+       ewl_text_text_set(EWL_TEXT(o), "This is the test text.");
+       t = ewl_text_text_get(EWL_TEXT(o));
+
+       if (strcmp(t, "This is the test text."))
+               snprintf(buf, len, "text_get did not match text_set.");
+       else
+               ret = 1;
+
+       return ret;
+}
+
+




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to