0009_input: Add ecore_wl2_window_input_region_get() TCs 58/314158/3
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 8 Jul 2024 02:25:30 +0000 (11:25 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 8 Jul 2024 02:39:59 +0000 (11:39 +0900)
[----------] 92 tests from etTestInput (47832 ms total)

[----------] Global test environment tear-down
[==========] 92 tests from 1 test suite ran. (47833 ms total)
[  PASSED  ] 92 tests.

Change-Id: Idad51d2daa6936433e2b840e1d0df74858ffcd6c
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/testcase/0009_input.cpp

index 3be025ecca020d3d220044339fc14a187df6f922..b57244d168487c4f0705b1e1b4b3cf57bdd4212b 100644 (file)
@@ -1317,6 +1317,74 @@ TEST_F(etTestInput, window_input_region_set_null_window)
    ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
 }
 
+TEST_F(etTestInput, window_input_region_get)
+{
+   Ecore_Wl2_Window *wlwin = NULL;
+   Eina_Bool ret = EINA_TRUE; // intentional
+   int x = 0, y = 0, w = 10, h = 10;
+   int out_x = 0, out_y = 0, out_w = 0, out_h = 0;
+
+   etWin *tw = initNormalWin("TCWin_WindowInputRegionSet", EINA_FALSE);
+   ASSERT_TRUE(tw != NULL) << "failed to init window";
+
+   showTCWin(tw);
+   ASSERT_VIS_ON(tw);
+
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(tw->elm_win);
+   EINA_SAFETY_ON_NULL_RETURN(wlwin);
+
+   // return void, so just for coverage and checking crash
+   ecore_wl2_window_input_region_set(wlwin, x, y, w, h);
+   ASSERT_TRUE(ret);
+
+   ecore_wl2_window_input_region_get(wlwin, &out_x, &out_y, &out_w, &out_h);
+
+   ASSERT_EQ(x, out_x);
+   ASSERT_EQ(y, out_y);
+   ASSERT_EQ(w, out_w);
+   ASSERT_EQ(h, out_h);
+
+   ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
+}
+
+TEST_F(etTestInput, window_input_region_get_null_window)
+{
+   Eina_Bool ret = EINA_TRUE; // intentional
+   int x = 0, y = 0, w = 0, h = 0;
+
+   // return void, so just for coverage and checking crash
+   ecore_wl2_window_input_region_get(NULL, &x, &y, &w, &h);
+   ASSERT_TRUE(ret);
+
+   ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
+}
+
+TEST_F(etTestInput, window_input_region_get_null_position)
+{
+   Ecore_Wl2_Window *wlwin = NULL;
+   Eina_Bool ret = EINA_TRUE; // intentional
+   int x = 0, y = 0, w = 10, h = 10;
+
+   etWin *tw = initNormalWin("TCWin_WindowInputRegionGSet", EINA_FALSE);
+   ASSERT_TRUE(tw != NULL) << "failed to init window";
+
+   showTCWin(tw);
+   ASSERT_VIS_ON(tw);
+
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(tw->elm_win);
+   EINA_SAFETY_ON_NULL_RETURN(wlwin);
+
+   // return void, so just for coverage and checking crash
+   ecore_wl2_window_input_region_set(wlwin, x, y, w, h);
+   ASSERT_TRUE(ret);
+
+   // return void, so just for coverage and checking crash
+   ecore_wl2_window_input_region_get(wlwin, NULL, NULL, NULL, NULL);
+   ASSERT_TRUE(ret);
+
+   ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
+}
+
 #ifndef DISABLE_GESTURE_TESTS
 TEST_F(etTestInput, gesture_tap22)
 {