From: Enlightenment C. <no...@cv...> - 2008-05-07 16:06:22
|
Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src/bin/tests/window Modified Files: ewl_window_test.c Log Message: - tabs are a tricky beast. looks like I missed some. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/window/ewl_window_test.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ewl_window_test.c 6 May 2008 20:18:57 -0000 1.6 +++ ewl_window_test.c 7 May 2008 13:38:21 -0000 1.7 @@ -33,20 +33,20 @@ */ static Ewl_Unit_Test window_unit_tests[] = { - {"title set/get", title_set_get, NULL, -1, 0}, - {"name set/get", name_set_get, NULL, -1, 0}, - {"class set/get", class_set_get, NULL, -1, 0}, - {"borderless set/get", borderless_set_get, NULL, -1, 0}, - {"dialog set/get", dialog_set_get, NULL, -1, 0}, - {"fullscreen set/get", fullscreen_set_get, NULL, -1, 0}, - {"skip_taskbar set/get", skip_taskbar_set_get, NULL, -1, 0}, - {"skip_pager set/get", skip_pager_set_get, NULL, -1, 0}, - {"urgent set/get", urgent_set_get, NULL, -1, 0}, - {"modal set/get", modal_set_get, NULL, -1, 0}, - {"keyboard_grab set/get", keyboard_grab_set_get, NULL, -1, 0}, - {"pointer_grab set/get", pointer_grab_set_get, NULL, -1, 0}, - {"override set/get", override_set_get, NULL, -1, 0}, - {NULL, NULL, NULL, -1, 0} + {"title set/get", title_set_get, NULL, -1, 0}, + {"name set/get", name_set_get, NULL, -1, 0}, + {"class set/get", class_set_get, NULL, -1, 0}, + {"borderless set/get", borderless_set_get, NULL, -1, 0}, + {"dialog set/get", dialog_set_get, NULL, -1, 0}, + {"fullscreen set/get", fullscreen_set_get, NULL, -1, 0}, + {"skip_taskbar set/get", skip_taskbar_set_get, NULL, -1, 0}, + {"skip_pager set/get", skip_pager_set_get, NULL, -1, 0}, + {"urgent set/get", urgent_set_get, NULL, -1, 0}, + {"modal set/get", modal_set_get, NULL, -1, 0}, + {"keyboard_grab set/get", keyboard_grab_set_get, NULL, -1, 0}, + {"pointer_grab set/get", pointer_grab_set_get, NULL, -1, 0}, + {"override set/get", override_set_get, NULL, -1, 0}, + {NULL, NULL, NULL, -1, 0} }; void @@ -105,7 +105,7 @@ flip_border_cb(Ewl_Widget *w, void *ev, void *data) { ewl_window_borderless_set(EWL_WINDOW(data), - !ewl_window_borderless_get(EWL_WINDOW(data))); + !ewl_window_borderless_get(EWL_WINDOW(data))); } /* @@ -122,21 +122,21 @@ title = ewl_window_title_get(EWL_WINDOW(win)); if (title) - snprintf(buf, len, "default title set to '%s'", 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)); + 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 { - 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; - } + if (strcmp(title, "A title")) + snprintf(buf, len, "incorrect title set"); + 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); @@ -158,21 +158,21 @@ name = ewl_window_name_get(EWL_WINDOW(win)); if (name) - snprintf(buf, len, "default name set to '%s'", 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)); + 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 { - 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; - } + if (strcmp(name, "A name")) + snprintf(buf, len, "incorrect name set"); + 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); @@ -194,21 +194,21 @@ class = ewl_window_class_get(EWL_WINDOW(win)); if (class) - snprintf(buf, len, "default class set to '%s'", 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)); + 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 { - 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; - } + if (strcmp(class, "A class")) + snprintf(buf, len, "incorrect class set"); + 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); @@ -228,13 +228,13 @@ win = ewl_window_new(); ewl_window_borderless_set(EWL_WINDOW(win), TRUE); if (ewl_window_borderless_get(EWL_WINDOW(win))) - ret = 1; + ret = 1; else - snprintf(buf, len, "setting borderless TRUE failed"); + snprintf(buf, len, "setting borderless TRUE failed"); ewl_window_borderless_set(EWL_WINDOW(win), FALSE); if (ewl_window_borderless_get(EWL_WINDOW(win))) - snprintf(buf, len, "setting borderless FALSE failed"); + snprintf(buf, len, "setting borderless FALSE failed"); ewl_widget_destroy(win); @@ -254,20 +254,20 @@ if (!ewl_window_dialog_get(EWL_WINDOW(win))) { - ewl_window_dialog_set(EWL_WINDOW(win), TRUE); - if (ewl_window_dialog_get(EWL_WINDOW(win))) { + ewl_window_dialog_set(EWL_WINDOW(win), TRUE); + if (ewl_window_dialog_get(EWL_WINDOW(win))) { - ewl_window_dialog_set(EWL_WINDOW(win), FALSE); - if (!ewl_window_dialog_get(EWL_WINDOW(win))) - ret = 1; - else - snprintf(buf, len, "dialog unset failed"); - } - else - snprintf(buf, len, "dialog set failed"); + ewl_window_dialog_set(EWL_WINDOW(win), FALSE); + if (!ewl_window_dialog_get(EWL_WINDOW(win))) + ret = 1; + else + snprintf(buf, len, "dialog unset failed"); + } + else + snprintf(buf, len, "dialog set failed"); } else - snprintf(buf, len, "default dialog set"); + snprintf(buf, len, "default dialog set"); ewl_widget_destroy(win); @@ -287,20 +287,20 @@ if (!ewl_window_fullscreen_get(EWL_WINDOW(win))) { - ewl_window_fullscreen_set(EWL_WINDOW(win), TRUE); - if (ewl_window_fullscreen_get(EWL_WINDOW(win))) { + ewl_window_fullscreen_set(EWL_WINDOW(win), TRUE); + if (ewl_window_fullscreen_get(EWL_WINDOW(win))) { - ewl_window_fullscreen_set(EWL_WINDOW(win), FALSE); - if (!ewl_window_fullscreen_get(EWL_WINDOW(win))) - ret = 1; - else - snprintf(buf, len, "fullscreen unset failed"); - } - else - snprintf(buf, len, "fullscreen set failed"); + ewl_window_fullscreen_set(EWL_WINDOW(win), FALSE); + if (!ewl_window_fullscreen_get(EWL_WINDOW(win))) + ret = 1; + else + snprintf(buf, len, "fullscreen unset failed"); + } + else + snprintf(buf, len, "fullscreen set failed"); } else - snprintf(buf, len, "default fullscreen set"); + snprintf(buf, len, "default fullscreen set"); ewl_widget_destroy(win); @@ -320,20 +320,20 @@ if (!ewl_window_skip_taskbar_get(EWL_WINDOW(win))) { - ewl_window_skip_taskbar_set(EWL_WINDOW(win), TRUE); - if (ewl_window_skip_taskbar_get(EWL_WINDOW(win))) { + ewl_window_skip_taskbar_set(EWL_WINDOW(win), TRUE); + if (ewl_window_skip_taskbar_get(EWL_WINDOW(win))) { - ewl_window_skip_taskbar_set(EWL_WINDOW(win), FALSE); - if (!ewl_window_skip_taskbar_get(EWL_WINDOW(win))) - ret = 1; - else - snprintf(buf, len, "skip_taskbar unset failed"); - } - else - snprintf(buf, len, "skip_taskbar set failed"); + ewl_window_skip_taskbar_set(EWL_WINDOW(win), FALSE); + if (!ewl_window_skip_taskbar_get(EWL_WINDOW(win))) + ret = 1; + else + snprintf(buf, len, "skip_taskbar unset failed"); + } + else + snprintf(buf, len, "skip_taskbar set failed"); } else - snprintf(buf, len, "default skip_taskbar set"); + snprintf(buf, len, "default skip_taskbar set"); ewl_widget_destroy(win); @@ -353,20 +353,20 @@ if (!ewl_window_skip_pager_get(EWL_WINDOW(win))) { - ewl_window_skip_pager_set(EWL_WINDOW(win), TRUE); - if (ewl_window_skip_pager_get(EWL_WINDOW(win))) { + ewl_window_skip_pager_set(EWL_WINDOW(win), TRUE); + if (ewl_window_skip_pager_get(EWL_WINDOW(win))) { - ewl_window_skip_pager_set(EWL_WINDOW(win), FALSE); - if (!ewl_window_skip_pager_get(EWL_WINDOW(win))) - ret = 1; - else - snprintf(buf, len, "skip_pager unset failed"); - } - else - snprintf(buf, len, "skip_pager set failed"); + ewl_window_skip_pager_set(EWL_WINDOW(win), FALSE); + if (!ewl_window_skip_pager_get(EWL_WINDOW(win))) + ret = 1; + else + snprintf(buf, len, "skip_pager unset failed"); + } + else + snprintf(buf, len, "skip_pager set failed"); } else - snprintf(buf, len, "default skip_pager set"); + snprintf(buf, len, "default skip_pager set"); ewl_widget_destroy(win); @@ -386,20 +386,20 @@ if (!ewl_window_urgent_get(EWL_WINDOW(win))) { - ewl_window_urgent_set(EWL_WINDOW(win), TRUE); - if (ewl_window_urgent_get(EWL_WINDOW(win))) { + ewl_window_urgent_set(EWL_WINDOW(win), TRUE); + if (ewl_window_urgent_get(EWL_WINDOW(win))) { - ewl_window_urgent_set(EWL_WINDOW(win), FALSE); - if (!ewl_window_urgent_get(EWL_WINDOW(win))) - ret = 1; - else - snprintf(buf, len, "urgent unset failed"); - } - else - snprintf(buf, len, "urgent set failed"); + ewl_window_urgent_set(EWL_WINDOW(win), FALSE); + if (!ewl_window_urgent_get(EWL_WINDOW(win))) + ret = 1; + else + snprintf(buf, len, "urgent unset failed"); + } + else + snprintf(buf, len, "urgent set failed"); } else - snprintf(buf, len, "default urgent set"); + snprintf(buf, len, "default urgent set"); ewl_widget_destroy(win); @@ -419,20 +419,20 @@ if (!ewl_window_modal_get(EWL_WINDOW(win))) { - ewl_window_modal_set(EWL_WINDOW(win), TRUE); - if (ewl_window_modal_get(EWL_WINDOW(win))) { + ewl_window_modal_set(EWL_WINDOW(win), TRUE); + if (ewl_window_modal_get(EWL_WINDOW(win))) { - ewl_window_modal_set(EWL_WINDOW(win), FALSE); - if (!ewl_window_modal_get(EWL_WINDOW(win))) - ret = 1; - else - snprintf(buf, len, "modal unset failed"); - } - else - snprintf(buf, len, "modal set failed"); + ewl_window_modal_set(EWL_WINDOW(win), FALSE); + if (!ewl_window_modal_get(EWL_WINDOW(win))) + ret = 1; + else + snprintf(buf, len, "modal unset failed"); + } + else + snprintf(buf, len, "modal set failed"); } else - snprintf(buf, len, "default modal set"); + snprintf(buf, len, "default modal set"); ewl_widget_destroy(win); @@ -452,20 +452,20 @@ if (!ewl_window_keyboard_grab_get(EWL_WINDOW(win))) { - ewl_window_keyboard_grab_set(EWL_WINDOW(win), TRUE); - if (ewl_window_keyboard_grab_get(EWL_WINDOW(win))) { + ewl_window_keyboard_grab_set(EWL_WINDOW(win), TRUE); + if (ewl_window_keyboard_grab_get(EWL_WINDOW(win))) { - ewl_window_keyboard_grab_set(EWL_WINDOW(win), FALSE); - if (!ewl_window_keyboard_grab_get(EWL_WINDOW(win))) - ret = 1; - else - snprintf(buf, len, "keyboard_grab unset failed"); - } - else - snprintf(buf, len, "keyboard_grab set failed"); + ewl_window_keyboard_grab_set(EWL_WINDOW(win), FALSE); + if (!ewl_window_keyboard_grab_get(EWL_WINDOW(win))) + ret = 1; + else + snprintf(buf, len, "keyboard_grab unset failed"); + } + else + snprintf(buf, len, "keyboard_grab set failed"); } else - snprintf(buf, len, "default keyboard_grab set"); + snprintf(buf, len, "default keyboard_grab set"); ewl_widget_destroy(win); @@ -485,20 +485,20 @@ if (!ewl_window_pointer_grab_get(EWL_WINDOW(win))) { - ewl_window_pointer_grab_set(EWL_WINDOW(win), TRUE); - if (ewl_window_pointer_grab_get(EWL_WINDOW(win))) { + ewl_window_pointer_grab_set(EWL_WINDOW(win), TRUE); + if (ewl_window_pointer_grab_get(EWL_WINDOW(win))) { - ewl_window_pointer_grab_set(EWL_WINDOW(win), FALSE); - if (!ewl_window_pointer_grab_get(EWL_WINDOW(win))) - ret = 1; - else - snprintf(buf, len, "pointer_grab unset failed"); - } - else - snprintf(buf, len, "pointer_grab set failed"); + ewl_window_pointer_grab_set(EWL_WINDOW(win), FALSE); + if (!ewl_window_pointer_grab_get(EWL_WINDOW(win))) + ret = 1; + else + snprintf(buf, len, "pointer_grab unset failed"); + } + else + snprintf(buf, len, "pointer_grab set failed"); } else - snprintf(buf, len, "default pointer_grab set"); + snprintf(buf, len, "default pointer_grab set"); ewl_widget_destroy(win); @@ -518,20 +518,20 @@ if (!ewl_window_override_get(EWL_WINDOW(win))) { - ewl_window_override_set(EWL_WINDOW(win), TRUE); - if (ewl_window_override_get(EWL_WINDOW(win))) { + ewl_window_override_set(EWL_WINDOW(win), TRUE); + if (ewl_window_override_get(EWL_WINDOW(win))) { - ewl_window_override_set(EWL_WINDOW(win), FALSE); - if (!ewl_window_override_get(EWL_WINDOW(win))) - ret = 1; - else - snprintf(buf, len, "override unset failed"); - } - else - snprintf(buf, len, "override set failed"); + ewl_window_override_set(EWL_WINDOW(win), FALSE); + if (!ewl_window_override_get(EWL_WINDOW(win))) + ret = 1; + else + snprintf(buf, len, "override unset failed"); + } + else + snprintf(buf, len, "override set failed"); } else - snprintf(buf, len, "default override set"); + snprintf(buf, len, "default override set"); ewl_widget_destroy(win); |