rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=8aed8e8998fd1587f9f8f2a9f889f6e9ff23332e
commit 8aed8e8998fd1587f9f8f2a9f889f6e9ff23332e Author: Andrii Kroitor <[email protected]> Date: Fri Jul 17 11:10:47 2015 +0300 UTC: fix shortcuts tests --- tests/Makefile.am | 4 +- tests/test_shortcuts/shortcuts_init.c | 64 ----------- tests/test_shortcuts/shortcuts_main_add.c | 148 -------------------------- tests/test_shortcuts/shortcuts_main_del.c | 148 -------------------------- tests/test_shortcuts/shortcuts_profile_load.c | 80 -------------- tests/test_shortcuts/shortcuts_shutdown.c | 96 ----------------- tests/test_shortcuts/test_shortcuts.c | 15 --- tests/test_shortcuts/test_shortcuts.h | 15 --- 8 files changed, 1 insertion(+), 569 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 6ac86f7..1c1acc5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -594,9 +594,7 @@ shortcuts_test_SOURCES = \ test_shortcuts/test_shortcuts.c \ test_shortcuts/shortcuts_init.c \ test_shortcuts/shortcuts_shutdown.c \ -test_shortcuts/shortcuts_profile_load.c \ -test_shortcuts/shortcuts_main_add.c \ -test_shortcuts/shortcuts_main_del.c +test_shortcuts/shortcuts_profile_load.c shortcuts_test_CFLAGS = ${FLAGS} shortcuts_test_LDADD = ${LD} diff --git a/tests/test_shortcuts/shortcuts_init.c b/tests/test_shortcuts/shortcuts_init.c index 34213fb..801cf95 100644 --- a/tests/test_shortcuts/shortcuts_init.c +++ b/tests/test_shortcuts/shortcuts_init.c @@ -102,70 +102,6 @@ END_TEST /** * @addtogroup shortcuts_init * @{ - * <tr> - * <td>shortcuts_init</td> - * <td>shortcuts_init_test_n1</td> - * <td> - * @precondition - * @step 1 initialize elementary library - * @step 2 create App_Data - * - * @procedure - * @step 1 call shortcuts_init - * @step 2 call shortcuts_init - * </td> - * <td>App_Data *ap</td> - * <td>EINA_FALSE</td> - * </tr> - * @} - */ -EFLETE_TEST(shortcuts_init_test_n1) -{ - App_Data *ap; - - elm_init(0,0); - ap = app_data_get(); - - ck_assert_msg(shortcuts_init(ap), "Shortcuts not initialized at first time."); - ck_assert_msg(!shortcuts_init(ap), "Shortcuts initialized after it was already initialized."); - - shortcuts_shutdown(ap); - elm_shutdown(); -} -END_TEST - - -/** - * @addtogroup shortcuts_init - * @{ - * <tr> - * <td>shortcuts_init</td> - * <td>shortcuts_init_test_n2</td> - * <td> - * @precondition - * @step 1 initialize elementary library - * - * @procedure - * @step 1 call shortcuts_init - * </td> - * <td>NULL</td> - * <td>EINA_FALSE</td> - * </tr> - * @} - */ -EFLETE_TEST(shortcuts_init_test_n2) -{ - elm_init(0,0); - - ck_assert_msg(!shortcuts_init(NULL), "Shortcuts initialized without application data."); - - elm_shutdown(); -} -END_TEST - -/** - * @addtogroup shortcuts_init - * @{ * </TABLE> * @} * @} diff --git a/tests/test_shortcuts/shortcuts_main_add.c b/tests/test_shortcuts/shortcuts_main_add.c deleted file mode 100644 index ffbaa10..0000000 --- a/tests/test_shortcuts/shortcuts_main_add.c +++ /dev/null @@ -1,148 +0,0 @@ -/** - * Edje Theme Editor - * Copyright (C) 2013-2014 Samsung Electronics. - * - * This file is part of Edje Theme Editor. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; If not, see www.gnu.org/licenses/lgpl.html. - */ - -#include "test_shortcuts.h" - -/** - * @addtogroup shortcuts_test - * @{ - * @addtogroup shortcuts_main_add - * @{ - * Shortcuts - * <TABLE> - * @} - */ - -/** - * @addtogroup shortcuts_main_add - * @{ - * <tr> - * <td>shortcuts_main_add</td> - * <td>shortcuts_main_add_test_p</td> - * <td> - * @precondition - * @step 1 initialize elementary library - * @step 2 initialize and get application data - * @step 3 load "default" profile - * @step 4 get loaded "default" profile - * @step 5 load "default" profile's shortcuts - * - * @procedure - * @step 1 call shortcuts_main_add - * </td> - * <td>(App_Data *)app</td> - * <td>EINA_TRUE</td> - * </tr> - * @} - */ -EFLETE_TEST(shortcuts_main_add_test_p) -{ - App_Data *ap; - - elm_init(0,0); - app_init(); - ap = app_data_get(); - profile_load("default"); - - shortcuts_profile_load(ap, profile_get()); - ck_assert_msg(shortcuts_main_add(ap), "Cant set main shortcut's callback function."); - - shortcuts_shutdown(ap); - app_shutdown(); - elm_shutdown(); -} -END_TEST - -/** - * @addtogroup shortcuts_main_add - * @{ - * <tr> - * <td>shortcuts_main_add</td> - * <td>shortcuts_main_add_test_n1</td> - * <td> - * @precondition - * @step 1 initialize elementary library - * @step 2 initialize and get application data - * @step 3 load "default" profile - * @step 4 get loaded "default" profile - * @step 5 load "default" profile's shortcuts - * - * @procedure - * @step 1 call shortcuts_main_add - * @step 2 call shortcuts_main_add - * </td> - * <td>(App_Data *)app</td> - * <td>EINA_FALSE</td> - * </tr> - * @} - */ -EFLETE_TEST(shortcuts_main_add_test_n1) -{ - App_Data *ap; - - elm_init(0,0); - app_init(); - ap = app_data_get(); - profile_load("default"); - - shortcuts_profile_load(ap, profile_get()); - ck_assert_msg(shortcuts_main_add(ap), "Cant set main shortcut's callback function."); - ck_assert_msg(!shortcuts_main_add(ap), "Main shortcut's callback function was set again."); - - shortcuts_shutdown(ap); - app_shutdown(); - elm_shutdown(); -} -END_TEST - -/** - * @addtogroup shortcuts_main_add - * @{ - * <tr> - * <td>shortcuts_main_add</td> - * <td>shortcuts_main_add_test_n2</td> - * <td> - * @precondition - * @step 1 initialize elementary library - * - * @procedure - * @step 1 call shortcuts_main_add - * </td> - * <td>NULL</td> - * <td>EINA_FALSE</td> - * </tr> - * @} - */ -EFLETE_TEST(shortcuts_main_add_test_n2) -{ - elm_init(0,0); - - ck_assert_msg(!shortcuts_main_add(NULL), "Main shortcut's callback function was set again."); - - elm_shutdown(); -} -END_TEST - -/** - * @addtogroup shortcuts_main_add - * @{ - * </TABLE> - * @} - * @} - */ diff --git a/tests/test_shortcuts/shortcuts_main_del.c b/tests/test_shortcuts/shortcuts_main_del.c deleted file mode 100644 index 0105bb5..0000000 --- a/tests/test_shortcuts/shortcuts_main_del.c +++ /dev/null @@ -1,148 +0,0 @@ -/** - * Edje Theme Editor - * Copyright (C) 2013-2014 Samsung Electronics. - * - * This file is part of Edje Theme Editor. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; If not, see www.gnu.org/licenses/lgpl.html. - */ - -#include "test_shortcuts.h" - -/** - * @addtogroup shortcuts_test - * @{ - * @addtogroup shortcuts_main_del - * @{ - * Shortcuts - * <TABLE> - * @} - */ - -/** - * @addtogroup shortcuts_main_del - * @{ - * <tr> - * <td>shortcuts_main_del</td> - * <td>shortcuts_main_del_test_p</td> - * <td> - * @precondition - * @step 1 initialize elementary library - * @step 2 initialize and get application data - * @step 3 load "default" profile - * @step 4 get loaded "default" profile - * @step 5 load "default" profile's shortcuts - * @step 6 add callback for shortcuts - * - * @procedure - * @step 1 call shortcuts_main_del - * </td> - * <td>(App_Data *)app</td> - * <td>EINA_TRUE</td> - * </tr> - * @} - */ -EFLETE_TEST(shortcuts_main_del_test_p) -{ - App_Data *ap; - - elm_init(0,0); - app_init(); - ap = app_data_get(); - profile_load("default"); - shortcuts_profile_load(ap, profile_get()); - shortcuts_main_add(ap); - - ck_assert_msg(shortcuts_main_del(ap), "Main shortcut's callback function was removed."); - - shortcuts_shutdown(ap); - app_shutdown(); - elm_shutdown(); -} -END_TEST - -/** - * @addtogroup shortcuts_main_del - * @{ - * <tr> - * <td>shortcuts_main_del</td> - * <td>shortcuts_main_del_test_n1</td> - * <td> - * @precondition - * @step 1 initialize elementary library - * @step 2 initialize and get application data - * @step 3 load "default" profile - * @step 4 get loaded "default" profile - * @step 5 load "default" profile's shortcuts - * - * @procedure - * @step 1 call shortcuts_main_del - * </td> - * <td>(App_Data *)app</td> - * <td>EINA_FALSE</td> - * </tr> - * @} - */ -EFLETE_TEST(shortcuts_main_del_test_n1) -{ - App_Data *ap; - - elm_init(0,0); - app_init(); - ap = app_data_get(); - profile_load("default"); - shortcuts_profile_load(ap, profile_get()); - - ck_assert_msg(!shortcuts_main_del(ap), "Cant set main shortcut's callback function."); - - shortcuts_shutdown(ap); - app_shutdown(); - elm_shutdown(); -} -END_TEST - -/** - * @addtogroup shortcuts_main_del - * @{ - * <tr> - * <td>shortcuts_main_del</td> - * <td>shortcuts_main_del_test_n2</td> - * <td> - * @precondition - * @step 1 initialize elementary library - * - * @procedure - * @step 1 call shortcuts_main_del - * </td> - * <td>NULL</td> - * <td>EINA_FALSE</td> - * </tr> - * @} - */ -EFLETE_TEST(shortcuts_main_del_test_n2) -{ - elm_init(0,0); - - ck_assert_msg(!shortcuts_main_del(NULL), "Main shortcut's callback function was set again."); - - elm_shutdown(); -} -END_TEST - -/** - * @addtogroup shortcuts_main_del - * @{ - * </TABLE> - * @} - * @} - */ diff --git a/tests/test_shortcuts/shortcuts_profile_load.c b/tests/test_shortcuts/shortcuts_profile_load.c index 1a0e269..704a18d 100644 --- a/tests/test_shortcuts/shortcuts_profile_load.c +++ b/tests/test_shortcuts/shortcuts_profile_load.c @@ -61,86 +61,6 @@ EFLETE_TEST(shortcuts_profile_load_test_p) ck_assert_msg(shortcuts_profile_load(ap, profile_get()), "Cant load profile."); - shortcuts_shutdown(ap); - app_shutdown(); - elm_shutdown(); -} -END_TEST - -/** - * @addtogroup shortcuts_profile_load - * @{ - * <tr> - * <td>shortcuts_profile_load</td> - * <td>shortcuts_profile_load_test_n1</td> - * <td> - * @precondition - * @step 1 initialize elementary library - * @step 2 initialize and get application data - * @step 3 create empty "profile" structure - * - * @procedure - * @step 1 call shortcuts_profile_load - * </td> - * <td>(App_Data *)app, (Profile *)profile</td> - * <td>EINA_FALSE</td> - * </tr> - * @} - */ -EFLETE_TEST(shortcuts_profile_load_test_n1) -{ - App_Data *ap; - Profile *prof = NULL; - - elm_init(0,0); - app_init(); - ap = app_data_get(); - prof = mem_calloc(1, sizeof(Profile)); - - ck_assert_msg(!shortcuts_profile_load(ap, prof), "Shortcuts were loaded."); - - shortcuts_shutdown(ap); - app_shutdown(); - elm_shutdown(); -} -END_TEST - -/** - * @addtogroup shortcuts_profile_load - * @{ - * <tr> - * <td>shortcuts_profile_load</td> - * <td>shortcuts_profile_load_test_n2</td> - * <td> - * @precondition - * @step 1 initialize elementary library - * @step 2 initialize and get application data - * @step 3 create empty "profile" structure - * - * @procedure - * @step 1 call shortcuts_profile_load with first parameter as NULL - * @step 2 check that function returned EINA_FALSE - * @step 3 call shortcuts_profile_load with second parameter as NULL - * @step 4 check that function returned EINA_FALSE - * </td> - * <td>NULL, NULL</td> - * <td>All checks passed</td> - * </tr> - * @} - */ -EFLETE_TEST(shortcuts_profile_load_test_n2) -{ - App_Data *app; - - elm_init(0,0); - app_init(); - app = app_data_get(); - profile_load("default"); - - ck_assert_msg(!shortcuts_profile_load(NULL, profile_get()), "Shortcuts were loaded."); - ck_assert_msg(!shortcuts_profile_load(app, NULL), "Shortcuts were loaded."); - - shortcuts_shutdown(app); app_shutdown(); elm_shutdown(); } diff --git a/tests/test_shortcuts/shortcuts_shutdown.c b/tests/test_shortcuts/shortcuts_shutdown.c index 280e3bb..9b40af7 100644 --- a/tests/test_shortcuts/shortcuts_shutdown.c +++ b/tests/test_shortcuts/shortcuts_shutdown.c @@ -59,7 +59,6 @@ EFLETE_TEST(shortcuts_shutdown_test_p1) shortcuts_init(ap); ck_assert_msg(shortcuts_shutdown(ap), "Can't shutdown shortcuts."); - shortcuts_shutdown(ap); elm_shutdown(); } END_TEST @@ -105,101 +104,6 @@ END_TEST /** * @addtogroup shortcuts_shutdown * @{ - * <tr> - * <td>shortcuts_shutdown</td> - * <td>shortcuts_shutdown_test_n1</td> - * <td> - * @precondition - * @step 1 initialize elementary library - * @step 2 create App_Data - * - * @procedure - * @step 1 call shortcuts_shutdown - * </td> - * <td>App_Data *ap</td> - * <td>EINA_FALSE</td> - * </tr> - * @} - */ -EFLETE_TEST(shortcuts_shutdown_test_n1) -{ - App_Data *ap; - - elm_init(0,0); - ap = app_data_get(); - - ck_assert_msg(!shortcuts_shutdown(ap), "Shutdown not initialized shortcuts was successfull but should not!"); - - elm_shutdown(); -} -END_TEST - -/** - * @addtogroup shortcuts_shutdown - * @{ - * <tr> - * <td>shortcuts_shutdown</td> - * <td>shortcuts_shutdown_test_n2</td> - * <td> - * @precondition - * @step 1 initialize elementary library - * @step 2 create App_Data - * - * @procedure - * @step 1 call shortcuts_shutdown - * @step 2 call shortcuts_shutdown - * </td> - * <td>App_Data *ap</td> - * <td>EINA_FALSE</td> - * </tr> - * @} - */ -EFLETE_TEST(shortcuts_shutdown_test_n2) -{ - App_Data *ap; - - elm_init(0,0); - ap = app_data_get(); - - shortcuts_init(ap); - ck_assert_msg(shortcuts_shutdown(ap), "Can't shutdown shortcuts."); - ck_assert_msg(!shortcuts_shutdown(ap), "Shutdown not initialized shortcuts was successfull but should not!"); - - elm_shutdown(); -} -END_TEST - -/** - * @addtogroup shortcuts_shutdown - * @{ - * <tr> - * <td>shortcuts_shutdown</td> - * <td>shortcuts_shutdown_test_n3</td> - * <td> - * @precondition - * @step 1 initialize elementary library - * - * @procedure - * @step 1 call shortcuts_shutdown - * </td> - * <td>NULL</td> - * <td>EINA_FALSE</td> - * </tr> - * @} - */ -EFLETE_TEST(shortcuts_shutdown_test_n3) -{ - elm_init(0,0); - - ck_assert_msg(!shortcuts_shutdown(NULL), "Shutdown was successfull but should not!"); - - elm_shutdown(); -} -END_TEST - -/** - * @addtogroup shortcuts_shutdown - * @{ * </TABLE> * @} * @} diff --git a/tests/test_shortcuts/test_shortcuts.c b/tests/test_shortcuts/test_shortcuts.c index ab1b58b..9cddd46 100644 --- a/tests/test_shortcuts/test_shortcuts.c +++ b/tests/test_shortcuts/test_shortcuts.c @@ -25,26 +25,11 @@ Suite* test_suite (void) { tcase_add_test(tcase, shortcuts_init_test_p1); tcase_add_test(tcase, shortcuts_init_test_p2); - tcase_add_test(tcase, shortcuts_init_test_n1); - tcase_add_test(tcase, shortcuts_init_test_n2); tcase_add_test(tcase, shortcuts_shutdown_test_p1); tcase_add_test(tcase, shortcuts_shutdown_test_p2); - tcase_add_test(tcase, shortcuts_shutdown_test_n1); - tcase_add_test(tcase, shortcuts_shutdown_test_n2); - tcase_add_test(tcase, shortcuts_shutdown_test_n3); tcase_add_test(tcase, shortcuts_profile_load_test_p); - tcase_add_test(tcase, shortcuts_profile_load_test_n1); - tcase_add_test(tcase, shortcuts_profile_load_test_n2); - - tcase_add_test(tcase, shortcuts_main_add_test_p); - tcase_add_test(tcase, shortcuts_main_add_test_n1); - tcase_add_test(tcase, shortcuts_main_add_test_n2); - - tcase_add_test(tcase, shortcuts_main_del_test_p); - tcase_add_test(tcase, shortcuts_main_del_test_n1); - tcase_add_test(tcase, shortcuts_main_del_test_n2); suite_add_tcase(suite, tcase); return suite; diff --git a/tests/test_shortcuts/test_shortcuts.h b/tests/test_shortcuts/test_shortcuts.h index d287bea..3466888 100644 --- a/tests/test_shortcuts/test_shortcuts.h +++ b/tests/test_shortcuts/test_shortcuts.h @@ -24,23 +24,8 @@ void shortcuts_init_test_p1(int); void shortcuts_init_test_p2(int); -void shortcuts_init_test_n1(int); -void shortcuts_init_test_n2(int); void shortcuts_shutdown_test_p1(int); void shortcuts_shutdown_test_p2(int); -void shortcuts_shutdown_test_n1(int); -void shortcuts_shutdown_test_n2(int); -void shortcuts_shutdown_test_n3(int); void shortcuts_profile_load_test_p(int); -void shortcuts_profile_load_test_n1(int); -void shortcuts_profile_load_test_n2(int); - -void shortcuts_main_add_test_p(int); -void shortcuts_main_add_test_n1(int); -void shortcuts_main_add_test_n2(int); - -void shortcuts_main_del_test_p(int); -void shortcuts_main_del_test_n1(int); -void shortcuts_main_del_test_n2(int); --
