Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

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


Modified Files:
        ewl_widget_test.c 


Log Message:
- tabs are a tricky beast. looks like I missed some.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/widget/ewl_widget_test.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ewl_widget_test.c   6 May 2008 20:18:57 -0000       1.8
+++ ewl_widget_test.c   7 May 2008 13:38:21 -0000       1.9
@@ -52,41 +52,41 @@
 static int focus_test_send_get(char *buf, int len);
 
 static Ewl_Unit_Test widget_unit_tests[] = {
-               {"EWL_WIDGET_IS", widget_is_test, NULL, -1, 0},
-               {"Widget name set/get", name_test_set_get, NULL, -1, 0},
-               {"Widget NULL name set/get", name_test_nul_set_get, NULL, -1, 
0},
-               {"Widget name find", name_find_test, NULL, -1, 0},
-               {"Widget missing name find", name_find_missing_test, NULL, -1, 
0},
-               {"Widget find NULL", name_find_null_test, NULL, -1, 1},
-               {"Widget type is test", widget_type_is_test, NULL, -1, 0},
-               {"Widget type is without type test", 
widget_type_is_non_type_test, NULL, -1, 0},
-               {"Widget enable", widget_enable_test, NULL, -1, 0},
-               {"Widget disable", widget_disable_test, NULL, -1, 0},
-               {"Widget colour set/get", widget_colour_test_set_get, NULL, -1, 
0},
-               {"Widget colour get NULL", widget_colour_test_get_null, NULL, 
-1, 0},
-               {"widget appearance set/get", appearance_test_set_get, NULL, 
-1, 0},
-               {"widget appearance path set/get", 
appearance_path_test_set_get, NULL, -1, 0},
-               {"widget inheritance set/get", inheritance_test_set_get, NULL, 
-1, 0},
-               {"widget internal set/get", internal_test_set_get, NULL, -1, 0},
-               {"widget clipped set/get", clipped_test_set_get, NULL, -1, 0},
-               {"widget data set/get", data_test_set_get, NULL, -1, 0},
-               {"widget data set/remove", data_test_set_remove, NULL, -1, 0},
-               {"widget_new", widget_new, NULL, -1, 0},
-               {"widget_init state", init, NULL, -1, 0},
-               {"widget_show state", show, NULL, -1, 0},
-               {"widget_realize state", realize, NULL, -1, 0},
-               {"widget realize unrealize state", realize_unrealize, NULL, -1, 
0},
-               {"widget_parent_set state", parent_set, NULL, -1, 0},
-               {"widget parent set while shown state", parent_set_show, NULL, 
-1, 0},
-               {"widget Reparent unrealized state", reparent_unrealized, NULL, 
-1, 0},
-               {"widget reparent realized state", reparent_realized, NULL, -1, 
0},
-               {"widget realize then reveal state", realize_reveal, NULL, -1, 
0},
-               {"widget realize reveal obscure state", realize_reveal_obscure, 
NULL, -1, 0},
-               {"widget realize reveal unrealize state", 
realize_reveal_unrealize, NULL, -1, 0},
-               {"widget show realize unrealize state", show_realize_unrealize, 
NULL, -1, 0},
-               {"widget focusable set/get", focusable_test_set_get, NULL, -1, 
0},
-               {"widget focus send/get", focus_test_send_get, NULL, -1, 0},
-               {NULL, NULL, NULL, -1, 0}
+                {"EWL_WIDGET_IS", widget_is_test, NULL, -1, 0},
+                {"Widget name set/get", name_test_set_get, NULL, -1, 0},
+                {"Widget NULL name set/get", name_test_nul_set_get, NULL, -1, 
0},
+                {"Widget name find", name_find_test, NULL, -1, 0},
+                {"Widget missing name find", name_find_missing_test, NULL, -1, 
0},
+                {"Widget find NULL", name_find_null_test, NULL, -1, 1},
+                {"Widget type is test", widget_type_is_test, NULL, -1, 0},
+                {"Widget type is without type test", 
widget_type_is_non_type_test, NULL, -1, 0},
+                {"Widget enable", widget_enable_test, NULL, -1, 0},
+                {"Widget disable", widget_disable_test, NULL, -1, 0},
+                {"Widget colour set/get", widget_colour_test_set_get, NULL, 
-1, 0},
+                {"Widget colour get NULL", widget_colour_test_get_null, NULL, 
-1, 0},
+                {"widget appearance set/get", appearance_test_set_get, NULL, 
-1, 0},
+                {"widget appearance path set/get", 
appearance_path_test_set_get, NULL, -1, 0},
+                {"widget inheritance set/get", inheritance_test_set_get, NULL, 
-1, 0},
+                {"widget internal set/get", internal_test_set_get, NULL, -1, 
0},
+                {"widget clipped set/get", clipped_test_set_get, NULL, -1, 0},
+                {"widget data set/get", data_test_set_get, NULL, -1, 0},
+                {"widget data set/remove", data_test_set_remove, NULL, -1, 0},
+                {"widget_new", widget_new, NULL, -1, 0},
+                {"widget_init state", init, NULL, -1, 0},
+                {"widget_show state", show, NULL, -1, 0},
+                {"widget_realize state", realize, NULL, -1, 0},
+                {"widget realize unrealize state", realize_unrealize, NULL, 
-1, 0},
+                {"widget_parent_set state", parent_set, NULL, -1, 0},
+                {"widget parent set while shown state", parent_set_show, NULL, 
-1, 0},
+                {"widget Reparent unrealized state", reparent_unrealized, 
NULL, -1, 0},
+                {"widget reparent realized state", reparent_realized, NULL, 
-1, 0},
+                {"widget realize then reveal state", realize_reveal, NULL, -1, 
0},
+                {"widget realize reveal obscure state", 
realize_reveal_obscure, NULL, -1, 0},
+                {"widget realize reveal unrealize state", 
realize_reveal_unrealize, NULL, -1, 0},
+                {"widget show realize unrealize state", 
show_realize_unrealize, NULL, -1, 0},
+                {"widget focusable set/get", focusable_test_set_get, NULL, -1, 
0},
+                {"widget focus send/get", focus_test_send_get, NULL, -1, 0},
+                {NULL, NULL, NULL, -1, 0}
         };
 
 void
@@ -145,7 +145,7 @@
         o = ewl_button_new();
         ewl_button_label_set(EWL_BUTTON(o), "Change fullscreen setting");
         ewl_callback_append(o, EWL_CALLBACK_CLICKED,
-                               ewl_widget_cb_toggle_fullscreen, NULL);
+                                ewl_widget_cb_toggle_fullscreen, NULL);
         ewl_container_child_append(EWL_CONTAINER(b2), o);
         ewl_widget_show(o);
 
@@ -154,7 +154,7 @@
 
 static void
 ewl_widget_cb_toggle(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
-                                               void *data __UNUSED__)
+                                                void *data __UNUSED__)
 {
         Ewl_Widget *o, *o2;
 
@@ -163,39 +163,39 @@
 
         if (DISABLED(o))
         {
-               ewl_widget_enable(o);
-               ewl_widget_disable(o2);
+                ewl_widget_enable(o);
+                ewl_widget_disable(o2);
         }
         else
         {
-               ewl_widget_disable(o);
-               ewl_widget_enable(o2);
+                ewl_widget_disable(o);
+                ewl_widget_enable(o2);
         }
 }
 
 static void
 ewl_widget_cb_first_click(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
-                                                       void *data __UNUSED__)
+                                                        void *data __UNUSED__)
 {
         printf("First clicked\n");
 }
 
 static void
 ewl_widget_cb_second_click(Ewl_Widget *w __UNUSED__, void *ev __UNUSED__,
-                                                       void *data __UNUSED__)
+                                                        void *data __UNUSED__)
 {
         printf("Second clicked\n");
 }
 
 static void
 ewl_widget_cb_toggle_fullscreen(Ewl_Widget *w, void *ev __UNUSED__,
-                                               void *data __UNUSED__)
+                                                void *data __UNUSED__)
 {
         Ewl_Embed *win;
 
         win = ewl_embed_widget_find(w);
         ewl_window_fullscreen_set(EWL_WINDOW(win),
-               !ewl_window_fullscreen_get(EWL_WINDOW(win)));
+                !ewl_window_fullscreen_get(EWL_WINDOW(win)));
 }
 
 /*
@@ -212,9 +212,9 @@
 
         ewl_widget_appearance_set(w, "my_appearance");
         if (strcmp("my_appearance", ewl_widget_appearance_get(w)))
-               LOG_FAILURE(buf, len, "appearance_get doesn't match 
appearance_set");
+                LOG_FAILURE(buf, len, "appearance_get doesn't match 
appearance_set");
         else
-               ret = 1;
+                ret = 1;
 
         return ret;
 }
@@ -238,9 +238,9 @@
 
         ewl_widget_appearance_set(w, "my_appearance");
         if (strcmp("/vbox/my_appearance", ewl_widget_appearance_path_get(w)))
-               LOG_FAILURE(buf, len, "appearance_path_get doesn't match");
+                LOG_FAILURE(buf, len, "appearance_path_get doesn't match");
         else
-               ret = 1;
+                ret = 1;
 
         return ret;
 }
@@ -262,13 +262,13 @@
 
         ewl_widget_inherit(w, my_class);
         if (!ewl_widget_type_is(w, my_class))
-               LOG_FAILURE(buf, len, "inheritance doesn't contain correct 
type");
+                LOG_FAILURE(buf, len, "inheritance doesn't contain correct 
type");
         else {
-               if (ewl_widget_type_is(w, unknown_class))
-                       LOG_FAILURE(buf, len,
-                                       "inheritance contains incorrect type");
-               else
-                       ret = 1;
+                if (ewl_widget_type_is(w, unknown_class))
+                        LOG_FAILURE(buf, len,
+                                        "inheritance contains incorrect type");
+                else
+                        ret = 1;
         }
 
         return ret;
@@ -288,19 +288,19 @@
         ewl_widget_init(w);
 
         if (!ewl_widget_internal_is(w)) {
-               ewl_widget_internal_set(w, TRUE);
-               if (ewl_widget_internal_is(w)) {
-                       ewl_widget_internal_set(w, FALSE);
-                       if (ewl_widget_internal_is(w))
-                               LOG_FAILURE(buf, len, "internal flag not 
FALSE");
-                       else
-                               ret = 1;
-               }
-               else
-                       LOG_FAILURE(buf, len, "internal flag not TRUE");
+                ewl_widget_internal_set(w, TRUE);
+                if (ewl_widget_internal_is(w)) {
+                        ewl_widget_internal_set(w, FALSE);
+                        if (ewl_widget_internal_is(w))
+                                LOG_FAILURE(buf, len, "internal flag not 
FALSE");
+                        else
+                                ret = 1;
+                }
+                else
+                        LOG_FAILURE(buf, len, "internal flag not TRUE");
         }
         else
-               LOG_FAILURE(buf, len, "internal set after widget_init");
+                LOG_FAILURE(buf, len, "internal set after widget_init");
 
         return ret;
 }
@@ -319,19 +319,19 @@
         ewl_widget_init(w);
 
         if (ewl_widget_clipped_is(w)) {
-               ewl_widget_clipped_set(w, FALSE);
-               if (!ewl_widget_clipped_is(w)) {
-                       ewl_widget_clipped_set(w, TRUE);
-                       if (!ewl_widget_clipped_is(w))
-                               LOG_FAILURE(buf, len, "clipped flag not TRUE");
-                       else
-                               ret = 1;
-               }
-               else
-                       LOG_FAILURE(buf, len, "clipped flag not FALSE");
+                ewl_widget_clipped_set(w, FALSE);
+                if (!ewl_widget_clipped_is(w)) {
+                        ewl_widget_clipped_set(w, TRUE);
+                        if (!ewl_widget_clipped_is(w))
+                                LOG_FAILURE(buf, len, "clipped flag not TRUE");
+                        else
+                                ret = 1;
+                }
+                else
+                        LOG_FAILURE(buf, len, "clipped flag not FALSE");
         }
         else
-               LOG_FAILURE(buf, len, "clipped not set after widget_init");
+                LOG_FAILURE(buf, len, "clipped not set after widget_init");
 
         return ret;
 }
@@ -357,11 +357,11 @@
         found = ewl_widget_data_get(w, key);
 
         if (!found)
-               LOG_FAILURE(buf, len, "could not find set data");
+                LOG_FAILURE(buf, len, "could not find set data");
         else if (found != value)
-               LOG_FAILURE(buf, len, "found value does not match set data");
+                LOG_FAILURE(buf, len, "found value does not match set data");
         else
-               ret = 1;
+                ret = 1;
 
         return ret;
 }
@@ -386,13 +386,13 @@
         found = ewl_widget_data_del(w, key);
 
         if (!found)
-               LOG_FAILURE(buf, len, "could not find set data");
+                LOG_FAILURE(buf, len, "could not find set data");
         else if (found != value)
-               LOG_FAILURE(buf, len, "removed value does not match set data");
+                LOG_FAILURE(buf, len, "removed value does not match set data");
         else if (ewl_widget_data_get(w, key))
-               LOG_FAILURE(buf, len, "data value present after remove");
+                LOG_FAILURE(buf, len, "data value present after remove");
         else
-               ret = 1;
+                ret = 1;
 
         return ret;
 }
@@ -408,11 +408,11 @@
 
         w = ewl_widget_new();
         if (!w)
-               LOG_FAILURE(buf, len, "Failed to create widget");
+                LOG_FAILURE(buf, len, "Failed to create widget");
         else
         {
-               ewl_widget_destroy(w);
-               ret = 1;
+                ewl_widget_destroy(w);
+                ret = 1;
         }
 
         return ret;
@@ -430,13 +430,13 @@
 
         w = ewl_widget_new();
         if (VISIBLE(w))
-               LOG_FAILURE(buf, len, "Widget VISIBLE after _init");
+                LOG_FAILURE(buf, len, "Widget VISIBLE after _init");
         else if (REALIZED(w))
-               LOG_FAILURE(buf, len, "Widget REALIZED after _init");
+                LOG_FAILURE(buf, len, "Widget REALIZED after _init");
         else if (REVEALED(w))
-               LOG_FAILURE(buf, len, "Widget REVEALED after _init");
+                LOG_FAILURE(buf, len, "Widget REVEALED after _init");
         else
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(w);
 
@@ -456,13 +456,13 @@
         ewl_widget_show(w);
 
         if (!VISIBLE(w))
-               LOG_FAILURE(buf, len, "Widget !VISIBLE after show");
+                LOG_FAILURE(buf, len, "Widget !VISIBLE after show");
         else if (REALIZED(w))
-               LOG_FAILURE(buf, len, "Widget REALIZED after show");
+                LOG_FAILURE(buf, len, "Widget REALIZED after show");
         else if (REVEALED(w))
-               LOG_FAILURE(buf, len, "Widget REVEALED after show");
+                LOG_FAILURE(buf, len, "Widget REVEALED after show");
         else
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(w);
         return ret;
@@ -480,39 +480,39 @@
         w = ewl_widget_new();
         ewl_widget_realize(w);
         if (VISIBLE(w))
-               LOG_FAILURE(buf, len, "Widget VISIBLE after realize");
+                LOG_FAILURE(buf, len, "Widget VISIBLE after realize");
         else if (REALIZED(w))
-               LOG_FAILURE(buf, len, "Widget REALIZED without window");
+                LOG_FAILURE(buf, len, "Widget REALIZED without window");
         else if (REVEALED(w))
-               LOG_FAILURE(buf, len, "Widget REVEALED after realize");
+                LOG_FAILURE(buf, len, "Widget REVEALED after realize");
         else
         {
-               Ewl_Widget *win;
+                Ewl_Widget *win;
 
-               /*
-                * Create a window and add the child to allow the realize to
-                * succeed. This will be using the buffer engine.
-                */
-               win = ewl_window_new();
-               ewl_embed_engine_name_set(EWL_EMBED(win), "evas_buffer");
-
-               ewl_container_child_append(EWL_CONTAINER(win), w);
-               ewl_widget_realize(w);
-
-               if (VISIBLE(win))
-                       LOG_FAILURE(buf, len, "Window VISIBLE after realize");
-               else if (!REALIZED(win))
-                       LOG_FAILURE(buf, len, "Window !REALIZED after realize");
-               else if (!REALIZED(w))
-                       LOG_FAILURE(buf, len, "Widget !REALIZED after realize");
-               else if (REVEALED(w))
-                       LOG_FAILURE(buf, len, "Widget REVEALED after realize");
-               else if (REVEALED(win))
-                       LOG_FAILURE(buf, len, "Window REVEALED after realize");
-               else
-                       ret = 1;
+                /*
+                 * Create a window and add the child to allow the realize to
+                 * succeed. This will be using the buffer engine.
+                 */
+                win = ewl_window_new();
+                ewl_embed_engine_name_set(EWL_EMBED(win), "evas_buffer");
+
+                ewl_container_child_append(EWL_CONTAINER(win), w);
+                ewl_widget_realize(w);
+
+                if (VISIBLE(win))
+                        LOG_FAILURE(buf, len, "Window VISIBLE after realize");
+                else if (!REALIZED(win))
+                        LOG_FAILURE(buf, len, "Window !REALIZED after 
realize");
+                else if (!REALIZED(w))
+                        LOG_FAILURE(buf, len, "Widget !REALIZED after 
realize");
+                else if (REVEALED(w))
+                        LOG_FAILURE(buf, len, "Widget REVEALED after realize");
+                else if (REVEALED(win))
+                        LOG_FAILURE(buf, len, "Window REVEALED after realize");
+                else
+                        ret = 1;
 
-               ewl_widget_destroy(win);
+                ewl_widget_destroy(win);
         }
         ewl_widget_destroy(w);
         return ret;
@@ -532,15 +532,15 @@
         ewl_widget_unrealize(w);
 
         if (VISIBLE(w))
-               /* This is the currently expected behavior, but we're discussing
-                * if this is really the behavior we want */
-               LOG_FAILURE(buf, len, "Widget VISIBLE after realize/unrealize");
+                /* This is the currently expected behavior, but we're 
discussing
+                 * if this is really the behavior we want */
+                LOG_FAILURE(buf, len, "Widget VISIBLE after 
realize/unrealize");
         else if (REALIZED(w))
-               LOG_FAILURE(buf, len, "Widget REALIZED after 
realize/unrealize");
+                LOG_FAILURE(buf, len, "Widget REALIZED after 
realize/unrealize");
         else if (REVEALED(w))
-               LOG_FAILURE(buf, len, "Widget REVEALED after 
realize/unrealize");
+                LOG_FAILURE(buf, len, "Widget REVEALED after 
realize/unrealize");
         else 
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(w);
         return ret;
@@ -561,17 +561,17 @@
         w = ewl_widget_new();
         ewl_widget_parent_set(w, b);
         if (!w->parent)
-               LOG_FAILURE(buf, len, "Widget parent NULL after parent set");
+                LOG_FAILURE(buf, len, "Widget parent NULL after parent set");
         else if (ewl_widget_parent_get(w) != b)
-               LOG_FAILURE(buf, len, "Widget parent wrong after parent set");
+                LOG_FAILURE(buf, len, "Widget parent wrong after parent set");
         else if (VISIBLE(w))
-               LOG_FAILURE(buf, len, "Widget VISIBLE after parent set");
+                LOG_FAILURE(buf, len, "Widget VISIBLE after parent set");
         else if (REALIZED(w))
-               LOG_FAILURE(buf, len, "Widget REALIZED after parent set");
+                LOG_FAILURE(buf, len, "Widget REALIZED after parent set");
         else if (REVEALED(w))
-               LOG_FAILURE(buf, len, "Widget REVEALED after parent set");
+                LOG_FAILURE(buf, len, "Widget REVEALED after parent set");
         else
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(w);
         ewl_widget_destroy(b);
@@ -595,18 +595,18 @@
         ewl_widget_parent_set(w, b);
 
         if (!w->parent)
-               LOG_FAILURE(buf, len, "Parent NULL after parent_set");
+                LOG_FAILURE(buf, len, "Parent NULL after parent_set");
         else if (!VISIBLE(w))
-               LOG_FAILURE(buf, len, "Widget !VISIBLE after parent_set");
+                LOG_FAILURE(buf, len, "Widget !VISIBLE after parent_set");
         else if (REALIZED(w))
-               /* The widget has not been realized yet as that happens in the
-                * idle loop, so this should test that it is still not realized
-                * after changing parents. */
-               LOG_FAILURE(buf, len, "Widget REALIZED after parent_set");
+                /* The widget has not been realized yet as that happens in the
+                 * idle loop, so this should test that it is still not realized
+                 * after changing parents. */
+                LOG_FAILURE(buf, len, "Widget REALIZED after parent_set");
         else if (REVEALED(w))
-               LOG_FAILURE(buf, len, "Widget REVEALED after parent_set");
+                LOG_FAILURE(buf, len, "Widget REVEALED after parent_set");
         else
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(w);
         ewl_widget_destroy(b);
@@ -634,17 +634,17 @@
         ewl_widget_parent_set(w, b2);
 
         if (!w->parent)
-               LOG_FAILURE(buf, len, "Widget parent NULL after reparent");
+                LOG_FAILURE(buf, len, "Widget parent NULL after reparent");
         else if (w->parent != b2)
-               LOG_FAILURE(buf, len, "Widget parent != b2 after reparent");
+                LOG_FAILURE(buf, len, "Widget parent != b2 after reparent");
         else if (VISIBLE(w))
-               LOG_FAILURE(buf, len, "Widget VISIBLE after reparent");
+                LOG_FAILURE(buf, len, "Widget VISIBLE after reparent");
         else if (REALIZED(w))
-               LOG_FAILURE(buf, len, "Widget REALIZED after reparent");
+                LOG_FAILURE(buf, len, "Widget REALIZED after reparent");
         else if (REVEALED(w))
-               LOG_FAILURE(buf, len, "Widget REVEALED after reparent");
+                LOG_FAILURE(buf, len, "Widget REVEALED after reparent");
         else 
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(w);
         ewl_widget_destroy(b1);
@@ -670,17 +670,17 @@
         ewl_widget_parent_set(w, b2);
 
         if (!w->parent)
-               LOG_FAILURE(buf, len, "Widget parent NULL after reparent");
+                LOG_FAILURE(buf, len, "Widget parent NULL after reparent");
         else if (w->parent != b2)
-               LOG_FAILURE(buf, len, "Widget parent != b2 after reparent");
+                LOG_FAILURE(buf, len, "Widget parent != b2 after reparent");
         else if (!VISIBLE(w))
-               LOG_FAILURE(buf, len, "Widget !VISIBLE after reparent");
+                LOG_FAILURE(buf, len, "Widget !VISIBLE after reparent");
         else if (REALIZED(w))
-               LOG_FAILURE(buf, len, "Widget REALIZED after reparent");
+                LOG_FAILURE(buf, len, "Widget REALIZED after reparent");
         else if (REVEALED(w))
-               LOG_FAILURE(buf, len, "Widget REVEALED after reparent");
+                LOG_FAILURE(buf, len, "Widget REVEALED after reparent");
         else 
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(w);
         ewl_widget_destroy(b1);
@@ -700,45 +700,45 @@
         ewl_widget_reveal(w);
 
         if (VISIBLE(w))
-               LOG_FAILURE(buf, len, "Widget VISIBLE after realize/reveal");
+                LOG_FAILURE(buf, len, "Widget VISIBLE after realize/reveal");
         else if (REALIZED(w))
-               LOG_FAILURE(buf, len, "Widget REALIZED after realize/reveal");
+                LOG_FAILURE(buf, len, "Widget REALIZED after realize/reveal");
         else if (REVEALED(w))
-               LOG_FAILURE(buf, len, "Widget REVEALED after realize/reveal");
+                LOG_FAILURE(buf, len, "Widget REVEALED after realize/reveal");
         else 
         {
-               Ewl_Widget *win;
+                Ewl_Widget *win;
 
-               /*
-                * Create a window and add the child to allow the realize to
-                * succeed. This will be using the buffer engine.
-                */
-               win = ewl_window_new();
-               ewl_embed_engine_name_set(EWL_EMBED(win), "evas_buffer");
-
-               ewl_container_child_append(EWL_CONTAINER(win), w);
-               ewl_widget_realize(w);
-               ewl_widget_reveal(w);
-
-               if (VISIBLE(win))
-                       LOG_FAILURE(buf, len,
-                                       "Window VISIBLE after realize/reveal");
-               else if (!REALIZED(win))
-                       LOG_FAILURE(buf, len,
-                                       "Window !REALIZED after 
realize/reveal");
-               else if (!REALIZED(w))
-                       LOG_FAILURE(buf, len,
-                                       "Widget !REALIZED after 
realize/reveal");
-               else if (!REVEALED(w))
-                       LOG_FAILURE(buf, len,
-                                       "Widget !REVEALED after 
realize/reveal");
-               else if (REVEALED(win))
-                       LOG_FAILURE(buf, len,
-                                       "Window REVEALED after realize/reveal");
-               else
-                       ret = 1;
+                /*
+                 * Create a window and add the child to allow the realize to
+                 * succeed. This will be using the buffer engine.
+                 */
+                win = ewl_window_new();
+                ewl_embed_engine_name_set(EWL_EMBED(win), "evas_buffer");
+
+                ewl_container_child_append(EWL_CONTAINER(win), w);
+                ewl_widget_realize(w);
+                ewl_widget_reveal(w);
+
+                if (VISIBLE(win))
+                        LOG_FAILURE(buf, len,
+                                        "Window VISIBLE after realize/reveal");
+                else if (!REALIZED(win))
+                        LOG_FAILURE(buf, len,
+                                        "Window !REALIZED after 
realize/reveal");
+                else if (!REALIZED(w))
+                        LOG_FAILURE(buf, len,
+                                        "Widget !REALIZED after 
realize/reveal");
+                else if (!REVEALED(w))
+                        LOG_FAILURE(buf, len,
+                                        "Widget !REVEALED after 
realize/reveal");
+                else if (REVEALED(win))
+                        LOG_FAILURE(buf, len,
+                                        "Window REVEALED after 
realize/reveal");
+                else
+                        ret = 1;
 
-               ewl_widget_destroy(win);
+                ewl_widget_destroy(win);
         }
 
         ewl_widget_destroy(w);
@@ -767,25 +767,25 @@
         ewl_widget_obscure(w);
 
         if (VISIBLE(win))
-               LOG_FAILURE(buf, len,
-                               "Window VISIBLE after realize/reveal/obscure");
+                LOG_FAILURE(buf, len,
+                                "Window VISIBLE after realize/reveal/obscure");
         else if (!REALIZED(win))
-               LOG_FAILURE(buf, len,
-                               "Window !REALIZED after 
realize/reveal/obscure");
+                LOG_FAILURE(buf, len,
+                                "Window !REALIZED after 
realize/reveal/obscure");
         else if (!REALIZED(w))
-               LOG_FAILURE(buf, len,
-                               "Widget !REALIZED after 
realize/reveal/obscure");
+                LOG_FAILURE(buf, len,
+                                "Widget !REALIZED after 
realize/reveal/obscure");
         else if (REVEALED(w))
-               LOG_FAILURE(buf, len,
-                               "Widget REVEALED after realize/reveal/obscure");
+                LOG_FAILURE(buf, len,
+                                "Widget REVEALED after 
realize/reveal/obscure");
         else if (REVEALED(win))
-               LOG_FAILURE(buf, len,
-                               "Window REVEALED after realize/reveal/obscure");
+                LOG_FAILURE(buf, len,
+                                "Window REVEALED after 
realize/reveal/obscure");
         else if (REVEALED(win))
-               LOG_FAILURE(buf, len,
-                               "Window REVEALED after realize/reveal/obscure");
+                LOG_FAILURE(buf, len,
+                                "Window REVEALED after 
realize/reveal/obscure");
         else
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(win);
         ewl_widget_destroy(w);
@@ -814,17 +814,17 @@
         ewl_widget_unrealize(w);
 
         if (VISIBLE(w))
-               LOG_FAILURE(buf, len, "Widget VISIBLE after 
realize/reveal/unrealize");
+                LOG_FAILURE(buf, len, "Widget VISIBLE after 
realize/reveal/unrealize");
         else if (REALIZED(w))
-               LOG_FAILURE(buf, len, "Widget REALIZED after 
realize/reveal/unrealize");
+                LOG_FAILURE(buf, len, "Widget REALIZED after 
realize/reveal/unrealize");
         else if (!REALIZED(win))
-               LOG_FAILURE(buf, len, "Window !REALIZED after 
realize/reveal/unrealize");
+                LOG_FAILURE(buf, len, "Window !REALIZED after 
realize/reveal/unrealize");
         else if (REVEALED(w))
-               LOG_FAILURE(buf, len, "Widget REVEALED after 
realize/reveal/unrealize");
+                LOG_FAILURE(buf, len, "Widget REVEALED after 
realize/reveal/unrealize");
         else if (REVEALED(win))
-               LOG_FAILURE(buf, len, "Window REVEALED after 
realize/reveal/unrealize");
+                LOG_FAILURE(buf, len, "Window REVEALED after 
realize/reveal/unrealize");
         else 
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(win);
         ewl_widget_destroy(w);
@@ -853,17 +853,17 @@
         ewl_widget_unrealize(w);
 
         if (!VISIBLE(w))
-               LOG_FAILURE(buf, len, "Widget not VISIBLE after 
show/realize/unrealize");
+                LOG_FAILURE(buf, len, "Widget not VISIBLE after 
show/realize/unrealize");
         else if (REALIZED(w))
-               LOG_FAILURE(buf, len, "Widget REALIZED after 
show/realize/unrealize");
+                LOG_FAILURE(buf, len, "Widget REALIZED after 
show/realize/unrealize");
         else if (!REALIZED(win))
-               LOG_FAILURE(buf, len, "Window !REALIZED after 
show/realize/unrealize");
+                LOG_FAILURE(buf, len, "Window !REALIZED after 
show/realize/unrealize");
         else if (REVEALED(w))
-               LOG_FAILURE(buf, len, "Widget REVEALED after 
show/realize/unrealize");
+                LOG_FAILURE(buf, len, "Widget REVEALED after 
show/realize/unrealize");
         else if (REVEALED(win))
-               LOG_FAILURE(buf, len, "Window REVEALED after 
show/realize/unrealize");
+                LOG_FAILURE(buf, len, "Window REVEALED after 
show/realize/unrealize");
         else 
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(win);
         ewl_widget_destroy(w);
@@ -881,9 +881,9 @@
 
         w = ewl_widget_new();
         if (!EWL_WIDGET_IS(w))
-               LOG_FAILURE(buf, len, "Widget is not Widget type");
+                LOG_FAILURE(buf, len, "Widget is not Widget type");
         else
-               ret = 1;
+                ret = 1;
         
         ewl_widget_destroy(w);
         return ret;
@@ -903,9 +903,9 @@
         ewl_widget_name_set(w, "test widget");
         name = ewl_widget_name_get(w);
         if (strcmp("test widget", name))
-               LOG_FAILURE(buf, len, "Returned name '%s' not 'test widget'", 
name);
+                LOG_FAILURE(buf, len, "Returned name '%s' not 'test widget'", 
name);
         else
-               ret = 1;
+                ret = 1;
         
         ewl_widget_destroy(w);
         return ret;
@@ -924,9 +924,9 @@
         ewl_widget_name_set(w, "test name");
         ewl_widget_name_set(w, NULL);
         if (NULL != ewl_widget_name_get(w))
-               LOG_FAILURE(buf, len, "Widget name not NULL");
+                LOG_FAILURE(buf, len, "Widget name not NULL");
         else
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(w);
         return ret;
@@ -945,9 +945,9 @@
         ewl_widget_name_set(w1, "test widget");
         w2 = ewl_widget_name_find("test widget");
         if (w1 != w2)
-               LOG_FAILURE(buf, len, "widget found not equal to widget set");
+                LOG_FAILURE(buf, len, "widget found not equal to widget set");
         else
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(w1);
         return ret;
@@ -964,9 +964,9 @@
 
         w = ewl_widget_name_find("Missing widget name");
         if (w != NULL)
-               LOG_FAILURE(buf, len, "Found widget when we shouldn't have");
+                LOG_FAILURE(buf, len, "Found widget when we shouldn't have");
         else
-               ret = 1;
+                ret = 1;
 
         return ret;
 }
@@ -982,9 +982,9 @@
 
         w = ewl_widget_name_find(NULL);
         if (w != NULL)
-               LOG_FAILURE(buf, len, "Found widget when searching for NULL");
+                LOG_FAILURE(buf, len, "Found widget when searching for NULL");
         else
-               ret = 1;
+                ret = 1;
         return ret;
 }
 
@@ -1000,9 +1000,9 @@
         w = ewl_widget_new();
         ewl_widget_inherit(w, "my type");
         if (!ewl_widget_type_is(w, "my type"))
-               LOG_FAILURE(buf, len, "Failed to match 'my type' on widget");
+                LOG_FAILURE(buf, len, "Failed to match 'my type' on widget");
         else
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(w);
         return ret;
@@ -1019,9 +1019,9 @@
 
         w = ewl_widget_new();
         if (ewl_widget_type_is(w, "my missing type"))
-               LOG_FAILURE(buf, len, "Matchined 'my missing type' on widget 
without type set");
+                LOG_FAILURE(buf, len, "Matchined 'my missing type' on widget 
without type set");
         else
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(w);
         return ret;
@@ -1041,9 +1041,9 @@
         ewl_widget_enable(w);
 
         if (DISABLED(w))
-               LOG_FAILURE(buf, len, "Widget DISABLED after calling enable");
+                LOG_FAILURE(buf, len, "Widget DISABLED after calling enable");
         else
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(w);
         return ret;
@@ -1061,9 +1061,9 @@
         w = ewl_widget_new();
         ewl_widget_disable(w);
         if (!DISABLED(w))
-               LOG_FAILURE(buf, len, "Widget not disabled aftering calling 
disable");
+                LOG_FAILURE(buf, len, "Widget not disabled aftering calling 
disable");
         else
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(w);
         return ret;
@@ -1083,15 +1083,15 @@
         ewl_widget_color_set(w, 248, 148, 48, 255);
         ewl_widget_color_get(w, &r, &g, &b, &a);
         if (r != 248)
-               LOG_FAILURE(buf, len, "Red colour not retrieved correctly");
+                LOG_FAILURE(buf, len, "Red colour not retrieved correctly");
         else if (g != 148)
-               LOG_FAILURE(buf, len, "Green colour not retrived correctly");
+                LOG_FAILURE(buf, len, "Green colour not retrived correctly");
         else if (b != 48)
-               LOG_FAILURE(buf, len, "Blue colour not retrived correctly");
+                LOG_FAILURE(buf, len, "Blue colour not retrived correctly");
         else if (a != 255)
-               LOG_FAILURE(buf, len, "Alpha colour not retrieved correctly");
+                LOG_FAILURE(buf, len, "Alpha colour not retrieved correctly");
         else
-               ret = 1;
+                ret = 1;
 
         ewl_widget_destroy(w);
         return ret;
@@ -1125,21 +1125,21 @@
         w = ewl_widget_new();
         focusable = ewl_widget_focusable_get(w);
         if (focusable) {
-               ewl_widget_focusable_set(w, FALSE);
-               focusable = ewl_widget_focusable_get(w);
-               if (!focusable) {
-                       ewl_widget_focusable_set(w, TRUE);
-                       focusable = ewl_widget_focusable_get(w);
-                       if (focusable)
-                               ret = 1;
-                       else
-                               LOG_FAILURE(buf, len, "focusable set to FALSE");
-               }
-               else
-                       LOG_FAILURE(buf, len, "focusable set to TRUE");
+                ewl_widget_focusable_set(w, FALSE);
+                focusable = ewl_widget_focusable_get(w);
+                if (!focusable) {
+                        ewl_widget_focusable_set(w, TRUE);
+                        focusable = ewl_widget_focusable_get(w);
+                        if (focusable)
+                                ret = 1;
+                        else
+                                LOG_FAILURE(buf, len, "focusable set to 
FALSE");
+                }
+                else
+                        LOG_FAILURE(buf, len, "focusable set to TRUE");
         }
         else
-               LOG_FAILURE(buf, len, "default focusable set to FALSE");
+                LOG_FAILURE(buf, len, "default focusable set to FALSE");
 
         return ret;
 }
@@ -1157,18 +1157,18 @@
         ewl_widget_focus_send(w);
 
         if (ewl_widget_focused_get() == w)
-               LOG_FAILURE(buf, len, "focused with no embed");
+                LOG_FAILURE(buf, len, "focused with no embed");
         else {
-               Ewl_Widget *embed;
+                Ewl_Widget *embed;
 
-               embed = ewl_embed_new();
-               ewl_container_child_append(EWL_CONTAINER(embed), w);
-               ewl_widget_focus_send(w);
-
-               if (ewl_widget_focused_get() == w)
-                       ret = 1;
-               else
-                       LOG_FAILURE(buf, len, "widget not focused");
+                embed = ewl_embed_new();
+                ewl_container_child_append(EWL_CONTAINER(embed), w);
+                ewl_widget_focus_send(w);
+
+                if (ewl_widget_focused_get() == w)
+                        ret = 1;
+                else
+                        LOG_FAILURE(buf, len, "widget not focused");
         }
 
         return ret;



-------------------------------------------------------------------------
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