0009_input: Add negative TCs related to input 61/313661/3
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 1 Jul 2024 01:14:32 +0000 (10:14 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 1 Jul 2024 01:16:49 +0000 (10:16 +0900)
Change-Id: I5a0850dfb0b6cbcf7a6d364e496d503219bfb065
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/testcase/0009_input.cpp

index 384636db1ec27e5f0cedfc98ab16127cc9ecf701..a862ec1a0ca0be48a408489c952396062b33cba3 100644 (file)
@@ -470,6 +470,17 @@ TEST_F(etTestInput, input_pointer_set)
    ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
 }
 
+TEST_F(etTestInput, input_pointer_set_null_input)
+{
+   Eina_Bool ret = EINA_TRUE; // intentional
+
+   // return void, so just for coverage and checking crash
+   ecore_wl2_input_pointer_set(NULL, NULL, 0, 0);
+   ASSERT_TRUE(ret);
+
+   ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
+}
+
 TEST_F(etTestInput, input_cursor_theme_name_set)
 {
    Ecore_Wl2_Display *display = NULL;
@@ -491,6 +502,17 @@ TEST_F(etTestInput, input_cursor_theme_name_set)
    ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
 }
 
+TEST_F(etTestInput, input_cursor_theme_name_set_null_input)
+{
+   Eina_Bool ret = EINA_TRUE; // intentional
+
+   // return void, so just for coverage and checking crash
+   ecore_wl2_input_cursor_theme_name_set(NULL, "custom_cursor_theme");
+   ASSERT_TRUE(ret);
+
+   ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
+}
+
 TEST_F(etTestInput, input_cursor_default_restore)
 {
    Ecore_Wl2_Display *display = NULL;
@@ -512,6 +534,18 @@ TEST_F(etTestInput, input_cursor_default_restore)
    ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
 }
 
+TEST_F(etTestInput, input_cursor_default_restore_null_input)
+{
+   Eina_Bool ret = EINA_TRUE; // intentional
+
+   // return void, so just for coverage and checking crash
+   ecore_wl2_input_cursor_default_restore(NULL);
+
+   ASSERT_TRUE(ret);
+
+   ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
+}
+
 TEST_F(etTestInput, input_cursor_get)
 {
    Ecore_Wl2_Display *display = NULL;
@@ -565,7 +599,7 @@ TEST_F(etTestInput, input_cursor_size_set)
 
 TEST_F(etTestInput, input_cursor_size_set_null_input)
 {
-   Eina_Bool ret = EINA_TRUE;
+   Eina_Bool ret = EINA_TRUE; // intentional
 
    // return void, so just for coverage and checking crash
    ecore_wl2_input_cursor_size_set(NULL, 64);
@@ -702,6 +736,16 @@ TEST_F(etTestInput, cursor_visible_set)
    ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
 }
 
+TEST_F(etTestInput, cursor_visible_set_null_win)
+{
+   Eina_Bool ret = EINA_TRUE; // intentional
+
+   ecore_wl2_window_cursor_visible_set(NULL, EINA_TRUE); // just for API coverage
+   ASSERT_TRUE(ret);
+
+   ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
+}
+
 TEST_F(etTestInput, pointer_constraints_lock_pointer)
 {
    Ecore_Wl2_Window *wlwin = NULL;
@@ -737,6 +781,13 @@ TEST_F(etTestInput, pointer_constraints_lock_pointer)
    ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
 }
 
+TEST_F(etTestInput, pointer_constraints_lock_pointer_null_win)
+{
+   Eina_Bool ret = EINA_TRUE; // intentional
+   ret = ecore_wl2_window_pointer_constraints_lock_pointer(NULL);
+   ASSERT_FALSE(ret);
+}
+
 TEST_F(etTestInput, locked_pointer_region_set)
 {
    Ecore_Wl2_Window *wlwin = NULL;
@@ -760,6 +811,17 @@ TEST_F(etTestInput, locked_pointer_region_set)
    ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
 }
 
+TEST_F(etTestInput, locked_pointer_region_set_null_win)
+{
+   Eina_Bool ret = EINA_TRUE; // intentional
+
+   // return void, so just for coverage and checking E20 crash
+   ecore_wl2_window_locked_pointer_region_set(NULL, 0, 0, 100, 100);
+   ASSERT_TRUE(ret);
+
+   ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
+}
+
 TEST_F(etTestInput, locked_pointer_cursor_position_hint_set)
 {
    Ecore_Wl2_Window *wlwin = NULL;
@@ -781,6 +843,17 @@ TEST_F(etTestInput, locked_pointer_cursor_position_hint_set)
    ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
 }
 
+TEST_F(etTestInput, locked_pointer_cursor_position_hint_set_null_win)
+{
+   Eina_Bool ret = EINA_TRUE; // intentional
+
+   // return void, so just for coverage and checking E20 crash
+   ecore_wl2_window_locked_pointer_cursor_position_hint_set(NULL, 100, 100);
+   ASSERT_TRUE(ret);
+
+   ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
+}
+
 #ifndef DISABLE_GESTURE_TESTS
 TEST_F(etTestInput, gesture_tap22)
 {