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 alignment unit test. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/button/ewl_button_test.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_button_test.c 8 Dec 2007 06:43:08 -0000 1.2 +++ ewl_button_test.c 15 Dec 2007 04:31:09 -0000 1.3 @@ -38,6 +38,7 @@ static int image_size_match_test_set_get(char *buf, int len); 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 Ewl_Unit_Test button_unit_tests[] = { {"label set/get", label_test_set_get, NULL, -1, 0}, @@ -49,6 +50,7 @@ {"image size match set/get", image_size_match_test_set_get, NULL, -1, 0}, {"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}, {NULL, NULL, NULL, -1, 0} }; @@ -377,6 +379,34 @@ LOG_FAILURE(buf, len, "image_size_get width and height not INT_MAX"); else ret = 1; + + ewl_widget_destroy(button); + + return ret; +} + +static int +image_alignment_test_set_get(char *buf, int len) +{ + Ewl_Widget *button; + int align; + int ret = 0; + + button = ewl_button_new(); + ewl_button_alignment_set(EWL_BUTTON(button), EWL_FLAG_ALIGN_RIGHT); + align = ewl_button_alignment_get(EWL_BUTTON(button)); + + if (align == EWL_FLAG_ALIGN_RIGHT) { + ewl_button_alignment_set(EWL_BUTTON(button), + EWL_FLAG_ALIGN_TOP); + align = ewl_button_alignment_get(EWL_BUTTON(button)); + if (align == EWL_FLAG_ALIGN_TOP) + ret = 1; + else + LOG_FAILURE(buf, len, "image alignment not top"); + } + else + LOG_FAILURE(buf, len, "image alignment not right"); 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