Add new tests to aul_test tool 76/265276/2
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 13 Oct 2021 22:45:59 +0000 (07:45 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Mon, 18 Oct 2021 04:44:13 +0000 (04:44 +0000)
To test alias appid feature, new testcases are added.

Adds:
 - aul_set_alias_appid_test
 - aul_unset_alias_appid_test
 - aul_enable_alias_info_test
 - aul_disable_alias_info_test

Change-Id: Ib9f99c28963a3ec7c8723b7f91cab644972cfa3a
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
tool/aul_test/tests/aul_disable_alias_info_test.cc [new file with mode: 0644]
tool/aul_test/tests/aul_enable_alias_info_test.cc [new file with mode: 0644]
tool/aul_test/tests/aul_set_alias_appid_test.cc [new file with mode: 0644]
tool/aul_test/tests/aul_unset_alias_appid_test.cc [new file with mode: 0644]

diff --git a/tool/aul_test/tests/aul_disable_alias_info_test.cc b/tool/aul_test/tests/aul_disable_alias_info_test.cc
new file mode 100644 (file)
index 0000000..7279e43
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "include/aul.h"
+
+#include "aul_test.hh"
+#include "log_private.hh"
+
+namespace aul_test {
+
+class AulDisableAliasInfoTest : public AulTest {
+ public:
+  AulDisableAliasInfoTest()
+      : AulTest("disable_alias_info", "aul_disable_alias_info",
+                "disable_alias_info <appid>") {}
+
+  virtual ~AulDisableAliasInfoTest() {}
+
+  void SetUp() override {}
+
+  void TearDown() override {}
+
+  int Test(int argc, char** argv) override {
+    if (argc < 3) {
+      Usage();
+      return -1;
+    }
+
+    _D("[aul_disable_alias_info test] %s", argv[2]);
+    return aul_disable_alias_info(argv[2]);
+  }
+};
+
+AUL_TEST_REGISTER(AulDisableAliasInfoTest, disable_alias_info_test);
+
+}  // namespace aul_test
diff --git a/tool/aul_test/tests/aul_enable_alias_info_test.cc b/tool/aul_test/tests/aul_enable_alias_info_test.cc
new file mode 100644 (file)
index 0000000..8f7cf66
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "include/aul.h"
+
+#include "aul_test.hh"
+#include "log_private.hh"
+
+namespace aul_test {
+
+class AulEnableAliasInfoTest : public AulTest {
+ public:
+  AulEnableAliasInfoTest()
+      : AulTest("enable_alias_info", "aul_enable_alias_info",
+                "enable_alias_info <appid>") {}
+
+  virtual ~AulEnableAliasInfoTest() {}
+
+  void SetUp() override {}
+
+  void TearDown() override {}
+
+  int Test(int argc, char** argv) override {
+    if (argc < 3) {
+      Usage();
+      return -1;
+    }
+
+    _D("[aul_enable_alias_info test] %s", argv[2]);
+    return aul_enable_alias_info(argv[2]);
+  }
+};
+
+AUL_TEST_REGISTER(AulEnableAliasInfoTest, enable_alias_info_test);
+
+}  // namespace aul_test
diff --git a/tool/aul_test/tests/aul_set_alias_appid_test.cc b/tool/aul_test/tests/aul_set_alias_appid_test.cc
new file mode 100644 (file)
index 0000000..2b0f62d
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "include/aul.h"
+
+#include "aul_test.hh"
+#include "log_private.hh"
+
+namespace aul_test {
+
+class AulSetAliasAppidTest : public AulTest {
+ public:
+  AulSetAliasAppidTest()
+      : AulTest("set_alias_appid", "aul_set_alias_appid",
+                "set_alias_appid <alias_appid> <appid>") {}
+
+  virtual ~AulSetAliasAppidTest() {}
+
+  void SetUp() override {}
+
+  void TearDown() override {}
+
+  int Test(int argc, char** argv) override {
+    if (argc < 4) {
+      Usage();
+      return -1;
+    }
+
+    _D("[aul_set_alias_appid test] %s %s", argv[2], argv[3]);
+    return aul_set_alias_appid(argv[2], argv[3]);
+  }
+};
+
+AUL_TEST_REGISTER(AulSetAliasAppidTest, set_alias_appid_test);
+
+}  // namespace aul_test
diff --git a/tool/aul_test/tests/aul_unset_alias_appid_test.cc b/tool/aul_test/tests/aul_unset_alias_appid_test.cc
new file mode 100644 (file)
index 0000000..9f5aa8c
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "include/aul.h"
+
+#include "aul_test.hh"
+#include "log_private.hh"
+
+namespace aul_test {
+
+class AulUnsetAliasAppidTest : public AulTest {
+ public:
+  AulUnsetAliasAppidTest()
+      : AulTest("unset_alias_appid", "aul_unset_alias_appid",
+                "unset_alias_appid <alias_appid>") {}
+
+  virtual ~AulUnsetAliasAppidTest() {}
+
+  void SetUp() override {}
+
+  void TearDown() override {}
+
+  int Test(int argc, char** argv) override {
+    if (argc < 3) {
+      Usage();
+      return -1;
+    }
+
+    _D("[aul_unset_alias_appid test] %s", argv[2]);
+    return aul_unset_alias_appid(argv[2]);
+  }
+};
+
+AUL_TEST_REGISTER(AulUnsetAliasAppidTest, unset_alias_appid_test);
+
+}  // namespace aul_test