Enlightenment CVS committal

Author  : jethomas
Project : e17
Module  : libs/ewl

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


Modified Files:
        ewl_text_test.c 


Log Message:
Add a unit test for bug 443.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/text/ewl_text_test.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_text_test.c     26 Feb 2008 04:24:12 -0000      1.3
+++ ewl_text_test.c     14 Apr 2008 00:06:21 -0000      1.4
@@ -13,6 +13,7 @@
 static void trigger_cb(Ewl_Widget *w, void *ev, void *data);
 
 static int text_test_set_get(char *buf, int len);
+static int text_test_set_get_null(char *buf, int len);
 static int text_valid_utf8_set_get(char *buf, int len);
 static int text_invalid_utf8_set_get(char *buf, int len);
 
@@ -20,6 +21,7 @@
                {"text set/get", text_test_set_get, NULL, -1, 0},
                {"valid UTF-8 text set/get", text_valid_utf8_set_get, NULL, -1, 
0},
                {"invalid UTF-8 text set/get", text_invalid_utf8_set_get, NULL, 
-1, 0},
+               {"null text set/get", text_test_set_get_null, NULL, -1, 0},
                {NULL, NULL, NULL, -1, 0}
        };
 
@@ -222,6 +224,25 @@
 
        if (strcmp(t, "This is the test text."))
                LOG_FAILURE(buf, len, "text_get did not match text_set.");
+       else
+               ret = 1;
+
+       return ret;
+}
+
+static int
+text_test_set_get_null(char *buf, int len)
+{
+       Ewl_Widget *o;
+       char *t;
+       int ret = 0;
+
+       o = ewl_text_new();
+       ewl_text_text_set(EWL_TEXT(o), "");
+       t = ewl_text_text_get(EWL_TEXT(o));
+
+       if (t)
+               LOG_FAILURE(buf, len, "text_get did not return null.");
        else
                ret = 1;
 



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to