Enlightenment CVS committal

Author  : ningerso
Project : e17
Module  : libs/ewl

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


Modified Files:
        ewl_window_test.c 


Log Message:
Use NULL instead of duplicating "" for window properties.
Update window unit tests to reflect this change.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/window/ewl_window_test.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewl_window_test.c   19 Dec 2007 16:17:16 -0000      1.1
+++ ewl_window_test.c   19 Dec 2007 21:53:57 -0000      1.2
@@ -46,16 +46,22 @@
        win = ewl_window_new();
        title = ewl_window_title_get(EWL_WINDOW(win));
 
-       if (title && *title)
-               snprintf(buf, len, "default title set to %s", title);
+       if (title)
+               snprintf(buf, len, "default title set to '%s'", title);
        else {
                ewl_window_title_set(EWL_WINDOW(win), "A title");
                title = ewl_window_title_get(EWL_WINDOW(win));
 
                if (strcmp(title, "A title"))
                        snprintf(buf, len, "incorrect title set");
-               else
-                       ret = 1;
+               else {
+                       ewl_window_title_set(EWL_WINDOW(win), "");
+                       title = ewl_window_title_get(EWL_WINDOW(win));
+                       if (title)
+                               snprintf(buf, len, "non-empty title set");
+                       else
+                               ret = 1;
+               }
        }
 
        ewl_widget_destroy(win);
@@ -76,16 +82,22 @@
        win = ewl_window_new();
        name = ewl_window_name_get(EWL_WINDOW(win));
 
-       if (name && *name)
-               snprintf(buf, len, "default name set to %s", name);
+       if (name)
+               snprintf(buf, len, "default name set to '%s'", name);
        else {
                ewl_window_name_set(EWL_WINDOW(win), "A name");
                name = ewl_window_name_get(EWL_WINDOW(win));
 
                if (strcmp(name, "A name"))
                        snprintf(buf, len, "incorrect name set");
-               else
-                       ret = 1;
+               else {
+                       ewl_window_name_set(EWL_WINDOW(win), "");
+                       name = ewl_window_name_get(EWL_WINDOW(win));
+                       if (name)
+                               snprintf(buf, len, "non-empty name set");
+                       else
+                               ret = 1;
+               }
        }
 
        ewl_widget_destroy(win);
@@ -106,16 +118,22 @@
        win = ewl_window_new();
        class = ewl_window_class_get(EWL_WINDOW(win));
 
-       if (class && *class)
-               snprintf(buf, len, "default class set to %s", class);
+       if (class)
+               snprintf(buf, len, "default class set to '%s'", class);
        else {
                ewl_window_class_set(EWL_WINDOW(win), "A class");
                class = ewl_window_class_get(EWL_WINDOW(win));
 
                if (strcmp(class, "A class"))
                        snprintf(buf, len, "incorrect class set");
-               else
-                       ret = 1;
+               else {
+                       ewl_window_class_set(EWL_WINDOW(win), "");
+                       class = ewl_window_class_get(EWL_WINDOW(win));
+                       if (class)
+                               snprintf(buf, len, "non-empty class set");
+                       else
+                               ret = 1;
+               }
        }
 
        ewl_widget_destroy(win);



-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to