From 7fedd5a3bb53dff09e98eb89afce44ff393e970a Mon Sep 17 00:00:00 2001 From: Jaeyun Jung Date: Tue, 25 Apr 2023 12:48:45 +0900 Subject: [PATCH] [Test] remove unnecessary test Code clean, remove empty testcase. Signed-off-by: Jaeyun Jung --- packaging/machine-learning-api.spec | 1 - tests/daemon/meson.build | 9 --- tests/daemon/unittest_dbus_model.cc | 113 ------------------------------------ 3 files changed, 123 deletions(-) delete mode 100644 tests/daemon/unittest_dbus_model.cc diff --git a/packaging/machine-learning-api.spec b/packaging/machine-learning-api.spec index 8cbfe23..8a038ee 100644 --- a/packaging/machine-learning-api.spec +++ b/packaging/machine-learning-api.spec @@ -377,7 +377,6 @@ bash %{test_script} ./tests/capi/unittest_capi_datatype_consistency %if 0%{?enable_ml_service} bash %{test_script} ./tests/daemon/unittest_ml_agent -bash %{test_script} ./tests/daemon/unittest_dbus_model bash %{test_script} ./tests/daemon/unittest_service_db bash %{test_script} ./tests/capi/unittest_capi_service_agent_client %endif diff --git a/tests/daemon/meson.build b/tests/daemon/meson.build index 263dab1..0567aef 100644 --- a/tests/daemon/meson.build +++ b/tests/daemon/meson.build @@ -7,15 +7,6 @@ unittest_ml_agent = executable('unittest_ml_agent', ) test('unittest_ml_agent', unittest_ml_agent, env: testenv, timeout: 100) -unittest_dbus_model = executable('unittest_dbus_model', - 'unittest_dbus_model.cc', - dependencies: [unittest_common_dep, ai_service_daemon_deps], - install: get_option('install-test'), - install_dir: unittest_install_dir, - include_directories: [nns_capi_include, nns_ml_agent_incs], -) -test('unittest_dbus_model', unittest_dbus_model, env: testenv, timeout: 100) - unittest_service_db = executable('unittest_service_db', 'unittest_service_db.cc', dependencies: [unittest_common_dep, service_db_dep_for_test], diff --git a/tests/daemon/unittest_dbus_model.cc b/tests/daemon/unittest_dbus_model.cc deleted file mode 100644 index 7d145f0..0000000 --- a/tests/daemon/unittest_dbus_model.cc +++ /dev/null @@ -1,113 +0,0 @@ -/** - * @file unittest_dbus_model.cc - * @date 29 Jul 2022 - * @brief Unit test for DBus Model interface - * @see https://github.com/nnstreamer/api - * @author Sangjung Woo - * @bug No known bugs - */ - -#include -#include -#include - -#include "dbus-interface.h" -#include "model-dbus.h" - -/** - * @brief Test base class of DBus Model interface - */ -class DbusModelTest : public::testing::Test -{ -protected: - GTestDBus *dbus; - GDBusProxy *server_proxy; - MachinelearningServiceModel *client_proxy; - -public: - /** - * @brief Construct a new DbusModelTest object - */ - DbusModelTest() - : dbus(nullptr), server_proxy(nullptr), client_proxy(nullptr) { } - - /** - * @brief Setup method for each test case. - */ - void SetUp() override - { - g_autofree gchar *services_dir = g_build_filename (g_get_current_dir (), "tests/services", NULL); - dbus = g_test_dbus_new (G_TEST_DBUS_NONE); - g_test_dbus_add_service_dir (dbus, services_dir); - g_test_dbus_up (dbus); - - GError *error = NULL; - server_proxy = g_dbus_proxy_new_for_bus_sync ( - G_BUS_TYPE_SESSION, - G_DBUS_PROXY_FLAGS_NONE, - NULL, - DBUS_ML_BUS_NAME, - DBUS_MODEL_PATH, - DBUS_MODEL_INTERFACE, - NULL, - &error); - - if (!server_proxy || error) { - if (error) { - g_critical ("Error Message : %s", error->message); - g_clear_error (&error); - } - } - - client_proxy = machinelearning_service_model_proxy_new_for_bus_sync ( - G_BUS_TYPE_SESSION, - G_DBUS_PROXY_FLAGS_NONE, - DBUS_ML_BUS_NAME, - DBUS_MODEL_PATH, - NULL, &error); - if (!client_proxy || error) { - if (error) { - g_critical ("Error Message : %s", error->message); - g_clear_error (&error); - } - } - } - - /** - * @brief Teardown method for each test case. - */ - void TearDown() override - { - if (server_proxy) - g_object_unref (server_proxy); - - if (client_proxy) - g_object_unref (client_proxy); - - g_test_dbus_down (dbus); - g_object_unref (dbus); - } -}; - -/** - * @brief Main gtest - */ -int -main (int argc, char **argv) -{ - int result = -1; - - try { - testing::InitGoogleTest (&argc, argv); - } catch (...) { - g_warning ("catch 'testing::internal::::ClassUniqueToAlwaysTrue'"); - } - - try { - result = RUN_ALL_TESTS (); - } catch (...) { - g_warning ("catch `testing::internal::GoogleTestFailureException`"); - } - - return result; -} -- 2.7.4