Enlightenment CVS committal

Author  : pfritz
Project : e17
Module  : libs/ewl

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


Modified Files:
        ewl_container_test.c 


Log Message:
add more constructure unit tests

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/container/ewl_container_test.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_container_test.c        7 May 2008 13:38:15 -0000       1.3
+++ ewl_container_test.c        28 Jul 2008 00:47:49 -0000      1.4
@@ -2,13 +2,17 @@
 #include "Ewl_Test.h"
 #include "ewl_test_private.h"
 #include "ewl_button.h"
+#include "ewl_macros.h"
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 
+/* unit tests */
+static int constructor_test(char *buf, int len);
 static int switch_parents(char *buf, int len);
 
 static Ewl_Unit_Test container_unit_tests[] = {
+                {"constructor", constructor_test, NULL, -1, 0},
                 {"switch parents", switch_parents, NULL, -1, 0},
                 {NULL, NULL, NULL, -1, 0}
         };
@@ -21,6 +25,34 @@
         test->filename = __FILE__;
         test->type = EWL_TEST_TYPE_UNIT;
         test->unit_tests = container_unit_tests;
+}
+
+static int
+constructor_test(char *buf, int len)
+{
+        Ewl_Widget *c;
+        int ret = 0;
+
+        c = NEW(Ewl_Container, 1);
+        ewl_container_init(EWL_CONTAINER(c));
+
+        if (!EWL_CONTAINER_IS(c))
+        {
+                LOG_FAILURE(buf, len, "returned widget is not of the type"
+                                " " EWL_CONTAINER_TYPE);
+                goto DONE;
+        }
+        if (!ewl_widget_recursive_get(c))
+        {
+                LOG_FAILURE(buf, len, "container is not recrusive");
+                goto DONE;
+        }
+
+        ret = 1;
+DONE:
+        ewl_widget_destroy(c);
+
+        return ret;
 }
 
 static int



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to