Enlightenment CVS committal

Author  : ningerso
Project : e17
Module  : libs/ewl

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


Modified Files:
        ewl_button_test.c 


Log Message:
Add button fill policy unit test.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/button/ewl_button_test.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_button_test.c   15 Dec 2007 04:31:09 -0000      1.3
+++ ewl_button_test.c   15 Dec 2007 04:37:10 -0000      1.4
@@ -39,6 +39,7 @@
 static int image_size_differ_test_set_get(char *buf, int len);
 static int image_size_max_int_test_set_get(char *buf, int len);
 static int image_alignment_test_set_get(char *buf, int len);
+static int image_fill_policy_test_set_get(char *buf, int len);
 
 static Ewl_Unit_Test button_unit_tests[] = {
                {"label set/get", label_test_set_get, NULL, -1, 0},
@@ -51,6 +52,7 @@
                {"image size differ set/get", image_size_differ_test_set_get, 
NULL, -1, 0},
                {"image size max int set/get", image_size_max_int_test_set_get, 
NULL, -1, 0},
                {"image alignment set/get", image_alignment_test_set_get, NULL, 
-1, 0},
+               {"image fill policy set/get", image_fill_policy_test_set_get, 
NULL, -1, 0},
                {NULL, NULL, NULL, -1, 0}
        };
 
@@ -407,6 +409,34 @@
        }
        else
                LOG_FAILURE(buf, len, "image alignment not right");
+
+       ewl_widget_destroy(button);
+
+       return ret;
+}
+
+static int
+image_fill_policy_test_set_get(char *buf, int len)
+{
+       Ewl_Widget *button;
+       int align;
+       int ret = 0;
+
+       button = ewl_button_new();
+       ewl_button_fill_policy_set(EWL_BUTTON(button), EWL_FLAG_FILL_NONE);
+       align = ewl_button_fill_policy_get(EWL_BUTTON(button));
+
+       if (align == EWL_FLAG_FILL_NONE) {
+               ewl_button_fill_policy_set(EWL_BUTTON(button),
+                               EWL_FLAG_FILL_FILL);
+               align = ewl_button_fill_policy_get(EWL_BUTTON(button));
+               if (align == EWL_FLAG_FILL_FILL)
+                       ret = 1;
+               else
+                       LOG_FAILURE(buf, len, "image fill policy not fill");
+       }
+       else
+               LOG_FAILURE(buf, len, "image fill policy not none");
 
        ewl_widget_destroy(button);
 



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