0012_auxhint: added test for ecore_wl2_window_aux_hint_generate 22/258222/1
authorJunseok, Kim <juns.kim@samsung.com>
Wed, 12 May 2021 09:14:05 +0000 (18:14 +0900)
committerJunseok, Kim <juns.kim@samsung.com>
Wed, 12 May 2021 09:14:05 +0000 (18:14 +0900)
Change-Id: Ida305681bc3371960425f7771ea25831d9be96ec

data/img/etTestAuxHint/aux_hint_id_val_get.png [new file with mode: 0644]
data/img/etTestAuxHint/delete_generated_hint.png [new file with mode: 0644]
data/img/etTestAuxHint/generate_duplicated_hint.png [new file with mode: 0644]
data/img/etTestAuxHint/generate_hint.png [new file with mode: 0644]
data/img/etTestAuxHint/generate_hint_id_robustness.png [new file with mode: 0644]
src/testcase/0012_aux_hint.cpp

diff --git a/data/img/etTestAuxHint/aux_hint_id_val_get.png b/data/img/etTestAuxHint/aux_hint_id_val_get.png
new file mode 100644 (file)
index 0000000..94cc9df
Binary files /dev/null and b/data/img/etTestAuxHint/aux_hint_id_val_get.png differ
diff --git a/data/img/etTestAuxHint/delete_generated_hint.png b/data/img/etTestAuxHint/delete_generated_hint.png
new file mode 100644 (file)
index 0000000..94cc9df
Binary files /dev/null and b/data/img/etTestAuxHint/delete_generated_hint.png differ
diff --git a/data/img/etTestAuxHint/generate_duplicated_hint.png b/data/img/etTestAuxHint/generate_duplicated_hint.png
new file mode 100644 (file)
index 0000000..94cc9df
Binary files /dev/null and b/data/img/etTestAuxHint/generate_duplicated_hint.png differ
diff --git a/data/img/etTestAuxHint/generate_hint.png b/data/img/etTestAuxHint/generate_hint.png
new file mode 100644 (file)
index 0000000..94cc9df
Binary files /dev/null and b/data/img/etTestAuxHint/generate_hint.png differ
diff --git a/data/img/etTestAuxHint/generate_hint_id_robustness.png b/data/img/etTestAuxHint/generate_hint_id_robustness.png
new file mode 100644 (file)
index 0000000..94cc9df
Binary files /dev/null and b/data/img/etTestAuxHint/generate_hint_id_robustness.png differ
index f7dfb2c..39eb209 100644 (file)
@@ -167,3 +167,152 @@ TEST_F(etTestAuxHint, revert_hint_using_add)
    ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
 }
 
+TEST_F(etTestAuxHint, generate_hint)
+{
+   int hint_id = -1;
+
+   initTC();
+
+   // add hint with generate(2, "win.test.auxhint", "test")
+   hint_id = etRunner::get().generateAuxHint(tw, "win.test.auxhint", "test");
+   ASSERT_NE(hint_id, -1);
+   ASSERT_HINT(tw, hint_id, "win.test.auxhint", "test");
+
+   ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
+}
+
+TEST_F(etTestAuxHint, generate_duplicated_hint)
+{
+   Eina_Bool ret = EINA_FALSE;
+   int hint_id = -1;
+
+   initTC();
+
+   // add hint (486, "win.test.auxhint", "test")
+   ret = etRunner::get().addAuxHint(tw, test_hint_id, "win.test.auxhint", "test");
+   ASSERT_TRUE(ret);
+   ASSERT_HINT(tw, test_hint_id, "win.test.auxhint", "test");
+
+   // change hint with generate(486, "win.test.auxhint", "test2")
+   hint_id = etRunner::get().generateAuxHint(tw, "win.test.auxhint", "test2");
+   ASSERT_EQ(hint_id, test_hint_id);
+   ASSERT_HINT(tw, hint_id, "win.test.auxhint", "test2");
+
+   // verify server's aux hint of "win.test.auxhint" // "origin"
+   ev_result_hint = etRunner::get().getAuxHint(tw, "win.test.auxhint");
+   compareHint(ev_result_hint, test_hint_id, "win.test.auxhint", "test2");
+
+   ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
+}
+
+TEST_F(etTestAuxHint, delete_generated_hint)
+{
+   Eina_Bool ret = EINA_FALSE;
+   int hint_id = -1, hint_id2 = -1;
+
+   initTC();
+   etRunner::get().addSupportedAuxHint("win.test.auxhint.2");
+
+   // generate hint (2, "win.test.auxhint", "test")
+   hint_id = etRunner::get().generateAuxHint(tw, "win.test.auxhint", "test");
+   ASSERT_NE(hint_id, -1);
+   ASSERT_HINT(tw, hint_id, "win.test.auxhint", "test");
+
+   ret = etRunner::get().delAuxHint(tw, hint_id);
+   ASSERT_TRUE(ret);
+   ASSERT_HINT(tw, hint_id, "win.test.auxhint", "test");
+
+   // generate hint (2, "win.test.auxhint", "test")
+   hint_id2 = etRunner::get().generateAuxHint(tw, "win.test.auxhint.2", "test2");
+   ASSERT_EQ(hint_id2, hint_id);
+   ASSERT_HINT(tw, hint_id2, "win.test.auxhint.2", "test2");
+
+   ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
+}
+
+TEST_F(etTestAuxHint, generate_hint_id_robustness)
+{
+   int hint_id = -1;
+   int invalIDList[] = {1, 10, 49, 8, 30, 0x7fffffff, -49, 0xfff000, 0xf0f0f0, 5, 10};
+   char auxHintStr[30] = {0};
+   Eina_Bool ret = EINA_FALSE;
+
+   // disable timeout
+   etRunner::get().setTCTimeout(EINA_FALSE, 0);
+
+   initTC();
+   etRunner::get().addSupportedAuxHint("win.test.auxhint.dup");
+
+   for (int i = 0 ; i < 11 ; i++)
+     {
+        ret = etRunner::get().addAuxHint(tw, invalIDList[i] , "win.test.auxhint.dup", "test");
+        ASSERT_TRUE(ret);
+        ASSERT_NE(hint_id, EINA_FALSE);
+        etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_AUX_HINT_CHANGED);
+     }
+
+   for (int i = 0 ; i <= 50 ; i++)
+     {
+        sprintf(auxHintStr, "win.test.testhint.%d", i);
+        etRunner::get().addSupportedAuxHint(auxHintStr);
+        hint_id = etRunner::get().generateAuxHint(tw, auxHintStr, "test");
+        ASSERT_NE(hint_id, -1);
+
+        ASSERT_HINT(tw, hint_id, auxHintStr, "test");
+
+        for (int j = 0 ; j < 11 ; j++)
+          {
+             ASSERT_NE(hint_id, invalIDList[j]);
+          }
+     }
+
+   etRunner::get().setTCTimeout(EINA_TRUE, 10);
+
+   ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
+}
+
+// FOR ecore_wl2_window_aux_hint APIs
+TEST_F(etTestAuxHint, aux_hint_id_val_get)
+{
+   int hint_id = -1;
+   int returned_hint_id = -1;
+   int invalIDList[] = {1, 10, 49, 8, 30, 0x7fffffff, -49, 0xfff000, 0xf0f0f0, 5, 10};
+   char auxHintStr[30] = {0};
+   char auxHintVal[30] = {0};
+   Eina_Bool ret = EINA_FALSE;
+
+   // disable timeout
+   etRunner::get().setTCTimeout(EINA_FALSE, 0);
+
+   initTC();
+   etRunner::get().addSupportedAuxHint("win.test.auxhint.dup");
+
+   for (int i = 0 ; i < 11 ; i++)
+     {
+        ret = etRunner::get().addAuxHint(tw, invalIDList[i] , "win.test.auxhint.dup", "test");
+        ASSERT_TRUE(ret);
+        ASSERT_NE(hint_id, EINA_FALSE);
+        etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_AUX_HINT_CHANGED);
+     }
+
+   for (int i = 0 ; i <= 50 ; i++)
+     {
+        sprintf(auxHintStr, "win.test.testhint.%d", i);
+        sprintf(auxHintVal, "test%d", i);
+        etRunner::get().addSupportedAuxHint(auxHintStr);
+        hint_id = etRunner::get().generateAuxHint(tw, auxHintStr, auxHintVal);
+        ASSERT_NE(hint_id, -1);
+
+        ASSERT_HINT(tw, hint_id, auxHintStr, auxHintVal);
+
+        returned_hint_id = etRunner::get().getAuxHintID(tw, auxHintStr);
+        std::string hint_val = etRunner::get().getAuxHintValue(tw, returned_hint_id);
+        ASSERT_EQ(returned_hint_id, hint_id);
+        ASSERT_TRUE(hint_val == std::string(auxHintVal));
+     }
+
+   etRunner::get().setTCTimeout(EINA_TRUE, 10);
+
+   ASSERT_EQ(etRunner::get().verifyTC(testCaseName, testName), EINA_TRUE);
+}
+