elm_win: Add test for elm_win_window_id_get 79/142879/1
authorse.osadchy <se.osadchy@samsung.com>
Mon, 7 Aug 2017 11:53:07 +0000 (14:53 +0300)
committerse.osadchy <se.osadchy@samsung.com>
Mon, 7 Aug 2017 11:53:07 +0000 (14:53 +0300)
Change-Id: Ifdf485db90f793b6db30ae327cea5bc6212e45ae

TC/elementary/win/tslist
TC/elementary/win/tslist_mobile
TC/elementary/win/tslist_tv
TC/elementary/win/tslist_wear
TC/elementary/win/utc_elm_win_window_id_get.c [new file with mode: 0644]

index c4d947e0cb55d01889fe40726e750969989f7b18..a260fc14a49bef60d0ab9cfba805fdcc5f96fb43 100644 (file)
@@ -121,3 +121,4 @@ utc_elm_win_wm_rotation_preferred_rotation_get.c
 utc_elm_win_wm_rotation_preferred_rotation_set.c
 utc_elm_win_wm_rotation_supported_get.c
 #utc_elm_win_xwindow_get.c
+utc_elm_win_window_id_get.c
index c4d947e0cb55d01889fe40726e750969989f7b18..a260fc14a49bef60d0ab9cfba805fdcc5f96fb43 100644 (file)
@@ -121,3 +121,4 @@ utc_elm_win_wm_rotation_preferred_rotation_get.c
 utc_elm_win_wm_rotation_preferred_rotation_set.c
 utc_elm_win_wm_rotation_supported_get.c
 #utc_elm_win_xwindow_get.c
+utc_elm_win_window_id_get.c
index 43c69789cdc8b8fe9edd33da09e942b9968e362a..fd4147746c3e49d900466e40ae8968eb449ac772 100644 (file)
@@ -121,3 +121,4 @@ utc_elm_win_wm_rotation_preferred_rotation_get.c
 utc_elm_win_wm_rotation_preferred_rotation_set.c
 utc_elm_win_wm_rotation_supported_get.c
 #utc_elm_win_xwindow_get.c
+utc_elm_win_window_id_get.c
index 8163b1c500573e4fb5eed1e765b605fcd74e034b..b259d191392a9af1db7e8e709ae6487f506f010e 100644 (file)
@@ -121,3 +121,4 @@ utc_elm_win_wm_rotation_preferred_rotation_get.c
 utc_elm_win_wm_rotation_preferred_rotation_set.c
 utc_elm_win_wm_rotation_supported_get.c
 #utc_elm_win_xwindow_get.c
+utc_elm_win_window_id_get.c
diff --git a/TC/elementary/win/utc_elm_win_window_id_get.c b/TC/elementary/win/utc_elm_win_window_id_get.c
new file mode 100644 (file)
index 0000000..afd1f32
--- /dev/null
@@ -0,0 +1,107 @@
+#include <check.h>
+#include <Elementary.h>
+#include "../../utc_negative_unitest.h"
+Evas_Object *main_win = NULL;
+
+/**
+ * @addtogroup elm_win
+ * @{
+ * @defgroup elm_win_window_id_get elm_win_window_id_get()
+ *
+ * @precondition
+ * @step 1 Initialize Elementary
+ * @step 2 Create a main window
+ */
+
+static void
+setup(void)
+{
+   printf(" ============ Startup ============ \n");
+   elm_init(0, NULL);
+   main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
+   if (main_win == NULL)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a main window..", __FILE__, __LINE__);
+     }
+}
+
+static void
+teardown(void)
+{
+   if (main_win != NULL)
+     {
+        evas_object_del(main_win);
+        main_win = NULL;
+     }
+   elm_shutdown();
+   printf(" ============ Cleanup ============ \n");
+}
+
+/**
+ * @addtogroup elm_win_window_id_get
+ * @{
+ * @objective Positive test case checks if function call with valid values to get the window's
+ * id works properly and without segmentation fault.
+ * @n Input Data:
+ * @li the window object
+ *
+ * @procedure
+ * @step 1 Call elm_win_window_id_get() with valid values.
+ * @step 2 Get the window's id.
+ *
+ * @passcondition
+ * @li Test passes if returned value is not NULL and there is no segmentation fault.
+ * @}
+ */
+START_TEST(utc_elm_win_window_id_get_p)
+{
+   if (main_win == NULL)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+
+   Ecore_Window *ewin = NULL;
+
+   ewin = elm_win_window_id_get(main_win);
+   if (ewin == NULL)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+
+/**
+ *@}
+ */
+Suite *
+test_suite(void)
+{
+   Suite *suite = suite_create("utc_elm_win_window_id_get");
+
+   TCase *tcase = tcase_create("TCase");
+   tcase_set_timeout(tcase, 30);
+   tcase_add_checked_fixture(tcase, setup, teardown);
+   tcase_add_test(tcase, utc_elm_win_window_id_get_p);
+   suite_add_tcase(suite, tcase);
+
+   return suite;
+}
+
+int
+main()
+{
+   int number_failed;
+
+   Suite *suite = test_suite();
+   SRunner *srunner = srunner_create(suite);
+   srunner_set_log(srunner, "utc_elm_win_window_id_get.log");
+   srunner_set_xml(srunner, "utc_elm_win_window_id_get.xml");
+   srunner_run_all(srunner, CK_NORMAL);
+   number_failed = srunner_ntests_failed(srunner);
+   srunner_free(srunner);
+
+   return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}