elm_win: Update elm_win_floating_mode_set test
authorse.osadchy <se.osadchy@samsung.com>
Thu, 20 Apr 2017 11:23:24 +0000 (14:23 +0300)
committerse.osadchy <se.osadchy@samsung.com>
Thu, 20 Apr 2017 11:23:57 +0000 (14:23 +0300)
Change-Id: I3fc7af948dd381f831b9b629db8ab3e0db76ce0f
Signed-off-by: Sergey Osadchy <se.osadchy@samsung.com>
TC/elementary/win/utc_elm_win_floating_mode_set.c

index bde54cfdf088e11cc5bdd20f70dc59ad85c74cad..95e227889945413fd4704ad14d7d89464b84cccb 100644 (file)
@@ -39,7 +39,7 @@ teardown(void)
 /**
  * @addtogroup elm_win_floating_mode_set
  * @{
- * @objective Positive test case checks if function call with valid value
+ * @objective Positive test case 01 checks if function call with valid value
  * to activate/deactivate the floating mode of window
  * object works properly and without segmentation fault
  * @n Input Data:
@@ -56,14 +56,13 @@ teardown(void)
  * @li Test passes if returned value is same as specified value and there is no segmentation fault
  * @}
  */
-START_TEST(utc_elm_win_floating_mode_set_p)
+START_TEST(utc_elm_win_floating_mode_set_p1)
 {
    if (main_win == NULL)
      {
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
      }
 
-
    elm_win_floating_mode_set(main_win, EINA_TRUE);
    if (elm_win_floating_mode_get(main_win) != EINA_TRUE)
      {
@@ -76,6 +75,51 @@ START_TEST(utc_elm_win_floating_mode_set_p)
         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
+
+/**
+ * @addtogroup elm_win_floating_mode_set
+ * @{
+ * @objective Positive test case 02 checks if function call with valid value
+ * to activate/deactivate the floating mode of window
+ * object works properly and without segmentation fault
+ * @n Input Data:
+ * @li the window object
+ * @li EINA_TRUE as the window's floating mode state
+ *
+ * @procedure
+ * @step 1 Disable borderless for main window
+ * @step 2 Call elm_win_floating_mode_set with EINA_TRUE value
+ * @step 3 Get the window floating mode state
+ *
+ * @passcondition
+ * @li Test passes if returned value is same as specified value and there is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_win_floating_mode_set_p2)
+{
+   Eina_Bool border = EINA_TRUE;
+   Eina_Bool fmode = EINA_FALSE;
+
+   if (main_win == NULL)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+
+   elm_win_borderless_set(main_win, EINA_FALSE);
+   border = elm_win_borderless_get(main_win);
+   if (border == EINA_TRUE)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+   elm_win_floating_mode_set(main_win, EINA_TRUE);
+   fmode = elm_win_floating_mode_get(main_win);
+   if (fmode == EINA_FALSE)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
 
    printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
 }
@@ -115,7 +159,8 @@ test_suite(void)
    TCase *tcase = tcase_create("TCase");
    tcase_set_timeout(tcase, 30);
    tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_elm_win_floating_mode_set_p);
+   tcase_add_test(tcase, utc_elm_win_floating_mode_set_p1);
+   tcase_add_test(tcase, utc_elm_win_floating_mode_set_p2);
    tcase_add_test(tcase, utc_elm_win_floating_mode_set_n);
    suite_add_tcase(suite, tcase);