summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSukhyungKang <shine.kang@samsung.com>2023-08-22 10:51:31 +0900
committerSukhyungKang <shine.kang@samsung.com>2023-09-06 09:45:07 +0900
commitc8bc1ce7f9b00d269c9c5fad6542e1048738e4db (patch)
tree7fe21a0c231d3cf9eb99914c7c2c8f00a7501ef1
parentc504090c8bb6d70937e28fd3d07eb1380a369823 (diff)
downloadnotification-refsf/for/tizen.tar.gz
notification-refsf/for/tizen.tar.bz2
notification-refsf/for/tizen.zip
Add notification unittestrefsf/for/tizen
Change-Id: I045b5f72d2d20f024b35cc1e3d51bff5fa7008d8 Signed-off-by: SukhyungKang <shine.kang@samsung.com>
-rw-r--r--CMakeLists.txt9
-rw-r--r--packaging/notification.spec21
-rw-r--r--tests/CMakeLists.txt4
-rw-r--r--tests/mock/app_common_mock.cc6
-rw-r--r--tests/mock/app_common_mock.hh (renamed from tests/mock/app_common_mock.h)2
-rw-r--r--tests/mock/aul_mock.cc239
-rw-r--r--tests/mock/aul_mock.hh101
-rw-r--r--tests/mock/glib_mock.cc6
-rw-r--r--tests/mock/glib_mock.hh (renamed from tests/mock/glib_mock.h)2
-rw-r--r--tests/mock/mock_hook.hh (renamed from tests/mock/mock_hook.h)0
-rw-r--r--tests/mock/module_mock.hh (renamed from tests/mock/module_mock.h)0
-rw-r--r--tests/mock/security_manager_mock.cc6
-rw-r--r--tests/mock/security_manager_mock.hh (renamed from tests/mock/security_manager_mock.h)2
-rw-r--r--tests/mock/smack_mock.cc6
-rw-r--r--tests/mock/smack_mock.hh (renamed from tests/mock/smack_mock.h)2
-rw-r--r--tests/mock/test_fixture.cc2
-rw-r--r--tests/mock/test_fixture.hh (renamed from tests/mock/test_fixture.h)2
-rw-r--r--tests/mock/tzplatform_config_mock.cc6
-rw-r--r--tests/mock/tzplatform_config_mock.hh (renamed from tests/mock/tzplatform_config_mock.h)2
-rw-r--r--tests/noti_ex_unittest/CMakeLists.txt (renamed from tests/unittest/CMakeLists.txt)0
-rw-r--r--tests/noti_ex_unittest/src/test_main.cc (renamed from tests/unittest/src/test_main.cc)0
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_abstract_item.cc (renamed from tests/unittest/src/test_noti_ex_abstract_item.cc)8
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_app_control_action.cc (renamed from tests/unittest/src/test_noti_ex_app_control_action.cc)4
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_button_item.cc (renamed from tests/unittest/src/test_noti_ex_button_item.cc)4
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_chat_message_item.cc (renamed from tests/unittest/src/test_noti_ex_chat_message_item.cc)6
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_checkbox_item.cc (renamed from tests/unittest/src/test_noti_ex_checkbox_item.cc)4
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_entry_item.cc (renamed from tests/unittest/src/test_noti_ex_entry_item.cc)4
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_event_info.cc (renamed from tests/unittest/src/test_noti_ex_event_info.cc)4
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_group_item.cc (renamed from tests/unittest/src/test_noti_ex_group_item.cc)4
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_icon_item.cc (renamed from tests/unittest/src/test_noti_ex_icon_item.cc)6
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_image_item.cc (renamed from tests/unittest/src/test_noti_ex_image_item.cc)6
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_input_selector_item.cc (renamed from tests/unittest/src/test_noti_ex_input_selector_item.cc)4
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_progress_item.cc (renamed from tests/unittest/src/test_noti_ex_progress_item.cc)4
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_shared_file.cc (renamed from tests/unittest/src/test_noti_ex_shared_file.cc)14
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_text_item.cc (renamed from tests/unittest/src/test_noti_ex_text_item.cc)4
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_time_item.cc (renamed from tests/unittest/src/test_noti_ex_time_item.cc)4
-rw-r--r--tests/noti_ex_unittest/src/test_noti_ex_visibility_action.cc (renamed from tests/unittest/src/test_noti_ex_visibility_action.cc)4
-rw-r--r--tests/noti_unittest/CMakeLists.txt57
-rw-r--r--tests/noti_unittest/src/test_main.cc37
-rw-r--r--tests/noti_unittest/src/test_noti_notification.cc47
40 files changed, 576 insertions, 67 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b69932c..e0c68ff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,5 +5,10 @@ ADD_SUBDIRECTORY(notification-ex)
ADD_SUBDIRECTORY(tests)
ENABLE_TESTING()
-SET(NOTIFICATION_UNIT_TESTS notification-ex_unittests)
-ADD_TEST(NAME ${NOTIFICATION_UNIT_TESTS} COMMAND ${NOTIFICATION_UNIT_TESTS}) \ No newline at end of file
+SET(NOTIFICATION_EX_UNIT_TESTS notification-ex_unittests)
+ADD_TEST(NAME ${NOTIFICATION_EX_UNIT_TESTS} COMMAND ${NOTIFICATION_EX_UNIT_TESTS})
+ADD_DEPENDENCIES(${NOTIFICATION_EX_UNIT_TESTS} notification-ex)
+
+SET(NOTIFICATION_UNIT_TESTS notification_unittests)
+ADD_TEST(NAME ${NOTIFICATION_UNIT_TESTS} COMMAND ${NOTIFICATION_UNIT_TESTS})
+ADD_DEPENDENCIES(${NOTIFICATION_UNIT_TESTS} notification)
diff --git a/packaging/notification.spec b/packaging/notification.spec
index 17ee72c..a0b6664 100644
--- a/packaging/notification.spec
+++ b/packaging/notification.spec
@@ -101,7 +101,7 @@ setup() {
test_main() {
echo "test_main start"
- /usr/bin/notification-ex_unittests
+ /usr/bin/<NAME>_unittests
}
teardown() {
@@ -119,6 +119,11 @@ EOF
mkdir -p %{buildroot}%{_bindir}/tizen-unittests/%{name}
install -m 0755 run-unittest.sh %{buildroot}%{_bindir}/tizen-unittests/%{name}/
+sed -i -e 's/<NAME>/notification/g' %{buildroot}%{_bindir}/tizen-unittests/%{name}/run-unittest.sh
+
+mkdir -p %{buildroot}%{_bindir}/tizen-unittests/%{name}-ex
+install -m 0755 run-unittest.sh %{buildroot}%{_bindir}/tizen-unittests/%{name}-ex/
+sed -i -e 's/<NAME>/notification-ex/g' %{buildroot}%{_bindir}/tizen-unittests/%{name}-ex/run-unittest.sh
mkdir -p %{buildroot}%{upgrade_script_path}
cp -f scripts/505.notification_upgrade.sh %{buildroot}%{upgrade_script_path}
@@ -218,6 +223,20 @@ GTest for notification-ex
%{_bindir}/notification-ex_unittests
%{_bindir}/tizen-unittests/%{name}/run-unittest.sh
+#################################################
+# notification_unittests
+#################################################
+%package -n notification_unittests
+Summary: GTest for notification
+Group: Development/Libraries
+
+%description -n notification_unittests
+GTest for notification
+
+%files -n notification_unittests
+%{_bindir}/notification_unittests
+%{_bindir}/tizen-unittests/%{name}-ex/run-unittest.sh
+
%if 0%{?gcov:1}
%files gcov
%{_datadir}/gcov/obj/*
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 907a64d..5e5460b 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,2 +1,2 @@
-ADD_SUBDIRECTORY(unittest)
-ADD_DEPENDENCIES(notification-ex_unittests notification-ex)
+ADD_SUBDIRECTORY(noti_unittest)
+ADD_SUBDIRECTORY(noti_ex_unittest)
diff --git a/tests/mock/app_common_mock.cc b/tests/mock/app_common_mock.cc
index 2a49180..ef5ba69 100644
--- a/tests/mock/app_common_mock.cc
+++ b/tests/mock/app_common_mock.cc
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-#include "app_common_mock.h"
+#include "app_common_mock.hh"
-#include "mock_hook.h"
-#include "test_fixture.h"
+#include "mock_hook.hh"
+#include "test_fixture.hh"
extern "C" int app_get_name(char** arg1) {
return MOCK_HOOK_P1(AppCommonMock, app_get_name, arg1);
diff --git a/tests/mock/app_common_mock.h b/tests/mock/app_common_mock.hh
index 18bcbc8..c1b85bc 100644
--- a/tests/mock/app_common_mock.h
+++ b/tests/mock/app_common_mock.hh
@@ -20,7 +20,7 @@
#include <gmock/gmock.h>
#include <app_common.h>
-#include "module_mock.h"
+#include "module_mock.hh"
class AppCommonMock : public virtual ModuleMock {
public:
diff --git a/tests/mock/aul_mock.cc b/tests/mock/aul_mock.cc
new file mode 100644
index 0000000..073b902
--- /dev/null
+++ b/tests/mock/aul_mock.cc
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * 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 "aul_mock.hh"
+
+#include "mock_hook.hh"
+#include "test_fixture.hh"
+
+// // aul_app_manager.h
+// extern "C" int aul_app_manager_foreach_app_context(
+// aul_app_manager_app_context_cb callback, void* user_data) {
+// return MOCK_HOOK_P2(AulMock, aul_app_manager_foreach_app_context, callback,
+// user_data);
+// }
+
+// extern "C" int aul_app_manager_foreach_all_app_context(
+// aul_app_manager_app_context_cb callback, void* user_data) {
+// return MOCK_HOOK_P2(AulMock, aul_app_manager_foreach_all_app_context,
+// callback, user_data);
+// }
+
+// extern "C" int aul_app_context_create(const char* app_id,
+// aul_app_context_h* app_context) {
+// return MOCK_HOOK_P2(AulMock, aul_app_context_create, app_id, app_context);
+// }
+
+// extern "C" int aul_app_context_create_with_inst_id(
+// const char *app_id, const char *inst_id, aul_app_context_h *app_context) {
+// return MOCK_HOOK_P3(AulMock, aul_app_context_create_with_inst_id, app_id,
+// inst_id, app_context);
+// }
+
+// extern "C" int aul_app_context_create_with_pid(int pid,
+// aul_app_context_h* app_context) {
+// return MOCK_HOOK_P2(AulMock, aul_app_context_create_with_pid, pid,
+// app_context);
+// }
+
+// extern "C" int aul_app_context_destroy(aul_app_context_h app_context) {
+// return MOCK_HOOK_P1(AulMock, aul_app_context_destroy, app_context);
+// }
+
+// extern "C" int aul_app_context_clone(aul_app_context_h app_context,
+// aul_app_context_h* clone) {
+// return MOCK_HOOK_P2(AulMock, aul_app_context_clone, app_context, clone);
+// }
+
+// extern "C" int aul_app_context_get_app_id(aul_app_context_h app_context,
+// char** app_id) {
+// return MOCK_HOOK_P2(AulMock, aul_app_context_get_app_id, app_context, app_id);
+// }
+
+// extern "C" int aul_app_context_get_pkg_id(aul_app_context_h app_context,
+// char** pkg_id) {
+// return MOCK_HOOK_P2(AulMock, aul_app_context_get_pkg_id, app_context, pkg_id);
+// }
+
+// extern "C" int aul_app_context_get_inst_id(aul_app_context_h app_context,
+// char** inst_id) {
+// return MOCK_HOOK_P2(AulMock, aul_app_context_get_inst_id, app_context,
+// inst_id);
+// }
+
+// extern "C" int aul_app_context_get_pid(aul_app_context_h app_context,
+// int* pid) {
+// return MOCK_HOOK_P2(AulMock, aul_app_context_get_pid, app_context, pid);
+// }
+
+// extern "C" int aul_app_context_get_status(aul_app_context_h app_context,
+// int* status) {
+// return MOCK_HOOK_P2(AulMock, aul_app_context_get_status, app_context, status);
+// }
+
+// extern "C" int aul_app_context_is_sub_app(aul_app_context_h app_context,
+// bool* is_sub_app) {
+// return MOCK_HOOK_P2(AulMock, aul_app_context_is_sub_app, app_context,
+// is_sub_app);
+// }
+
+// extern "C" int aul_app_context_is_running(aul_app_context_h app_context,
+// bool* is_running) {
+// return MOCK_HOOK_P2(AulMock, aul_app_context_is_running, app_context,
+// is_running);
+// }
+
+// extern "C" int aul_app_context_is_equal(aul_app_context_h lhs,
+// aul_app_context_h rhs, bool* equal) {
+// return MOCK_HOOK_P3(AulMock, aul_app_context_is_equal, lhs, rhs, equal);
+// }
+
+// // aul_app_event.h
+// extern "C" int aul_app_event_create_with_appid(
+// const char* app_id, aul_app_event_launched_cb launched_cb,
+// aul_app_event_terminated_cb terminated_cb, void* user_data,
+// aul_app_event_h* app_event) {
+// return MOCK_HOOK_P5(AulMock, aul_app_event_create_with_appid, app_id,
+// launched_cb, terminated_cb, user_data, app_event);
+// }
+
+// extern "C" int aul_app_event_create(aul_app_event_launched_cb launched_cb,
+// aul_app_event_terminated_cb terminated_cb,
+// void* user_data,
+// aul_app_event_h* app_event) {
+// return MOCK_HOOK_P4(AulMock, aul_app_event_create, launched_cb, terminated_cb,
+// user_data, app_event);
+// }
+
+// extern "C" int aul_app_event_destroy(aul_app_event_h app_event) {
+// return MOCK_HOOK_P1(AulMock, aul_app_event_destroy, app_event);
+// }
+
+// // aul_window.h
+// extern "C" int aul_window_stack_get(aul_window_stack_h* handle) {
+// return MOCK_HOOK_P1(AulMock, aul_window_stack_get, handle);
+// }
+
+// extern "C" int aul_window_stack_del(aul_window_stack_h handle) {
+// return MOCK_HOOK_P1(AulMock, aul_window_stack_del, handle);
+// }
+
+// extern "C" int aul_window_stack_foreach(aul_window_stack_h handle,
+// void (*iter_cb)(aul_window_info_h info,
+// void* data),
+// void* data) {
+// return MOCK_HOOK_P3(AulMock, aul_window_stack_foreach, handle, iter_cb, data);
+// }
+
+// extern "C" int aul_window_info_get_visibility(aul_window_info_h info,
+// int* visibility) {
+// return MOCK_HOOK_P2(AulMock, aul_window_info_get_visibility, info,
+// visibility);
+// }
+
+// extern "C" int aul_window_info_get_pid(aul_window_info_h info, int* pid) {
+// return MOCK_HOOK_P2(AulMock, aul_window_info_get_pid, info, pid);
+// }
+
+// extern "C" int aul_window_get_focused_pid(int* pid) {
+// return MOCK_HOOK_P1(AulMock, aul_window_get_focused_pid, pid);
+// }
+
+// extern "C" int aul_window_attach(const char* parent_app_id,
+// const char* child_app_id) {
+// return MOCK_HOOK_P2(AulMock, aul_window_attach, parent_app_id, child_app_id);
+// }
+
+// extern "C" int aul_window_attach_below(const char* parent_app_id,
+// const char* child_app_id) {
+// return MOCK_HOOK_P2(AulMock, aul_window_attach_below, parent_app_id,
+// child_app_id);
+// }
+
+// extern "C" int aul_window_detach(const char* app_id) {
+// return MOCK_HOOK_P1(AulMock, aul_window_detach, app_id);
+// }
+
+// // aul.h
+extern "C" int aul_app_get_appid_bypid(int pid, char* appid, int len) {
+ return MOCK_HOOK_P3(AulMock, aul_app_get_appid_bypid, pid, appid, len);
+}
+
+// extern "C" int aul_resume_app_by_instance_id(const char* appid,
+// const char* inst_id) {
+// return MOCK_HOOK_P2(AulMock, aul_resume_app_by_instance_id, appid, inst_id);
+// }
+
+// extern "C" int aul_app_is_running(const char* appid) {
+// return MOCK_HOOK_P1(AulMock, aul_app_is_running, appid);
+// }
+
+// extern "C" int aul_resume_app(const char* appid) {
+// return MOCK_HOOK_P1(AulMock, aul_resume_app, appid);
+// }
+
+// extern "C" int aul_terminate_pid(int pid) {
+// return MOCK_HOOK_P1(AulMock, aul_terminate_pid, pid);
+// }
+
+// extern "C" int aul_terminate_bgapp_pid(int pid) {
+// return MOCK_HOOK_P1(AulMock, aul_terminate_bgapp_pid, pid);
+// }
+
+// extern "C" int aul_get_app_shared_data_path_by_appid(const char* appid,
+// char** path) {
+// return MOCK_HOOK_P2(AulMock, aul_get_app_shared_data_path_by_appid, appid,
+// path);
+// }
+
+// extern "C" int aul_get_app_shared_resource_path_by_appid(const char* appid,
+// char** path) {
+// return MOCK_HOOK_P2(AulMock, aul_get_app_shared_resource_path_by_appid, appid,
+// path);
+// }
+
+// extern "C" int aul_get_app_shared_trusted_path_by_appid(const char* appid,
+// char** path) {
+// return MOCK_HOOK_P2(AulMock, aul_get_app_shared_trusted_path_by_appid, appid,
+// path);
+// }
+
+// extern "C" int aul_get_app_external_shared_data_path_by_appid(const char* appid,
+// char** path) {
+// return MOCK_HOOK_P2(AulMock, aul_get_app_external_shared_data_path_by_appid,
+// appid, path);
+// }
+
+// extern "C" int aul_terminate_pid_without_restart(int pid) {
+// return MOCK_HOOK_P1(AulMock, aul_terminate_pid_without_restart, pid);
+// }
+
+// // aul_svc.h
+// extern "C" int aul_svc_get_appid_by_alias_appid(const char* alias_appid,
+// char** appid) {
+// return MOCK_HOOK_P2(AulMock, aul_svc_get_appid_by_alias_appid, alias_appid,
+// appid);
+// }
+
+// // aul_app_group.h
+
+// extern "C" int aul_app_group_add(int win_id) {
+// return MOCK_HOOK_P1(AulMock, aul_app_group_add, win_id);
+// }
+
+// extern "C" int aul_app_group_remove(int win_id) {
+// return MOCK_HOOK_P1(AulMock, aul_app_group_remove, win_id);
+// }
diff --git a/tests/mock/aul_mock.hh b/tests/mock/aul_mock.hh
new file mode 100644
index 0000000..9d16b6a
--- /dev/null
+++ b/tests/mock/aul_mock.hh
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ */
+
+#ifndef UNIT_TESTS_MOCK_AUL_MOCK_H_
+#define UNIT_TESTS_MOCK_AUL_MOCK_H_
+
+#include <aul.h>
+#include <gmock/gmock.h>
+#include <aul.h>
+#include <aul_app_event.h>
+#include <aul_app_group.h>
+#include <aul_app_manager.h>
+#include <aul_svc.h>
+#include <aul_window.h>
+
+#include "module_mock.hh"
+
+class AulMock : public virtual ModuleMock {
+ public:
+ AulMock() {
+ using ::testing::_;
+ using ::testing::Return;
+ using ::testing::Invoke;
+ }
+
+ // MOCK_METHOD2(aul_app_manager_foreach_app_context,
+ // int(aul_app_manager_app_context_cb, void*));
+ // MOCK_METHOD2(aul_app_manager_foreach_all_app_context,
+ // int(aul_app_manager_app_context_cb, void*));
+ // MOCK_METHOD2(aul_app_context_create, int(const char*, aul_app_context_h*));
+ // MOCK_METHOD1(aul_app_context_destroy, int(aul_app_context_h));
+ // MOCK_METHOD2(aul_app_context_get_app_id, int(aul_app_context_h, char**));
+ // MOCK_METHOD2(aul_app_context_get_pid, int(aul_app_context_h, pid_t*));
+ // MOCK_METHOD2(aul_app_context_get_pkg_id, int(aul_app_context_h, char**));
+ // MOCK_METHOD2(aul_app_context_get_status, int(aul_app_context_h, int*));
+ // MOCK_METHOD2(aul_app_context_is_running, int(aul_app_context_h, bool*));
+ // MOCK_METHOD3(aul_app_context_is_equal,
+ // int(aul_app_context_h, aul_app_context_h, bool*));
+ // MOCK_METHOD2(aul_app_context_is_sub_app, int(aul_app_context_h, bool*));
+ // MOCK_METHOD2(aul_app_context_clone,
+ // int(aul_app_context_h, aul_app_context_h*));
+ // MOCK_METHOD3(aul_app_context_create_with_inst_id,
+ // int(const char*, const char*, aul_app_context_h*));
+ // MOCK_METHOD2(aul_app_context_get_inst_id, int(aul_app_context_h, char**));
+ // MOCK_METHOD2(aul_app_context_create_with_pid, int(pid_t, aul_app_context_h*));
+
+ // MOCK_METHOD4(aul_app_event_create,
+ // int(aul_app_event_launched_cb, aul_app_event_terminated_cb,
+ // void*, aul_app_event_h*));
+ // MOCK_METHOD1(aul_app_event_destroy, int(aul_app_event_h));
+ // MOCK_METHOD5(aul_app_event_create_with_appid,
+ // int(const char*, aul_app_event_launched_cb,
+ // aul_app_event_terminated_cb, void*, aul_app_event_h*));
+
+ // MOCK_METHOD2(aul_window_info_get_visibility, int(aul_window_info_h, int*));
+ // MOCK_METHOD2(aul_window_info_get_pid, int(aul_window_info_h, int*));
+ // MOCK_METHOD1(aul_window_stack_get, int(aul_window_stack_h*));
+ // MOCK_METHOD3(aul_window_stack_foreach,
+ // int(aul_window_stack_h, void (*)(aul_window_info_h, void*),
+ // void*));
+ // MOCK_METHOD1(aul_window_stack_del, int(aul_window_stack_h));
+ // MOCK_METHOD1(aul_window_get_focused_pid, int(int*));
+ // MOCK_METHOD2(aul_window_attach, int(const char*, const char*));
+ // MOCK_METHOD1(aul_window_detach, int(const char*));
+ // MOCK_METHOD2(aul_window_attach_below, int(const char*, const char*));
+
+ MOCK_METHOD3(aul_app_get_appid_bypid, int(int, char*, int));
+ // MOCK_METHOD2(aul_svc_get_appid_by_alias_appid, int(const char*, char**));
+ // MOCK_METHOD2(aul_resume_app_by_instance_id, int(const char*, const char*));
+ // MOCK_METHOD1(aul_app_is_running, int(const char*));
+ // MOCK_METHOD1(aul_resume_app, int(const char*));
+ // MOCK_METHOD1(aul_terminate_pid, int(int));
+ // MOCK_METHOD1(aul_terminate_bgapp_pid, int(int));
+ // MOCK_METHOD2(aul_get_app_shared_data_path_by_appid, int(const char*, char**));
+ // MOCK_METHOD2(aul_get_app_shared_resource_path_by_appid,
+ // int(const char*, char**));
+ // MOCK_METHOD2(aul_get_app_shared_trusted_path_by_appid,
+ // int(const char*, char**));
+ // MOCK_METHOD2(aul_get_app_external_shared_data_path_by_appid,
+ // int(const char*, char**));
+ // MOCK_METHOD1(aul_terminate_pid_without_restart, int(int));
+
+ // MOCK_METHOD1(aul_app_group_add, int(int));
+ // MOCK_METHOD1(aul_app_group_remove, int(int));
+
+};
+
+#endif // UNIT_TESTS_MOCK_AUL_MOCK_H_
diff --git a/tests/mock/glib_mock.cc b/tests/mock/glib_mock.cc
index 15569ac..7c33ca0 100644
--- a/tests/mock/glib_mock.cc
+++ b/tests/mock/glib_mock.cc
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-#include "glib_mock.h"
+#include "glib_mock.hh"
-#include "mock_hook.h"
-#include "test_fixture.h"
+#include "mock_hook.hh"
+#include "test_fixture.hh"
extern "C" GFile* g_file_new_for_path(const char* arg1) {
return MOCK_HOOK_P1(GlibMock, g_file_new_for_path, arg1);
diff --git a/tests/mock/glib_mock.h b/tests/mock/glib_mock.hh
index 03688ad..2a6cb1e 100644
--- a/tests/mock/glib_mock.h
+++ b/tests/mock/glib_mock.hh
@@ -21,7 +21,7 @@
#include <glib.h>
#include <gmock/gmock.h>
-#include "module_mock.h"
+#include "module_mock.hh"
class GlibMock : public virtual ModuleMock {
public:
diff --git a/tests/mock/mock_hook.h b/tests/mock/mock_hook.hh
index 29b0932..29b0932 100644
--- a/tests/mock/mock_hook.h
+++ b/tests/mock/mock_hook.hh
diff --git a/tests/mock/module_mock.h b/tests/mock/module_mock.hh
index 9b19d89..9b19d89 100644
--- a/tests/mock/module_mock.h
+++ b/tests/mock/module_mock.hh
diff --git a/tests/mock/security_manager_mock.cc b/tests/mock/security_manager_mock.cc
index 85710d6..67c2dad 100644
--- a/tests/mock/security_manager_mock.cc
+++ b/tests/mock/security_manager_mock.cc
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-#include "security_manager_mock.h"
+#include "security_manager_mock.hh"
-#include "mock_hook.h"
-#include "test_fixture.h"
+#include "mock_hook.hh"
+#include "test_fixture.hh"
extern "C" int security_manager_private_sharing_req_new(private_sharing_req** arg1) {
return MOCK_HOOK_P1(SecurityManagerMock, security_manager_private_sharing_req_new, arg1);
diff --git a/tests/mock/security_manager_mock.h b/tests/mock/security_manager_mock.hh
index c5424fd..cc35956 100644
--- a/tests/mock/security_manager_mock.h
+++ b/tests/mock/security_manager_mock.hh
@@ -20,7 +20,7 @@
#include <security-manager.h>
#include <gmock/gmock.h>
-#include "module_mock.h"
+#include "module_mock.hh"
class SecurityManagerMock : public virtual ModuleMock {
public:
diff --git a/tests/mock/smack_mock.cc b/tests/mock/smack_mock.cc
index 4b8388d..28aae23 100644
--- a/tests/mock/smack_mock.cc
+++ b/tests/mock/smack_mock.cc
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-#include "smack_mock.h"
+#include "smack_mock.hh"
-#include "mock_hook.h"
-#include "test_fixture.h"
+#include "mock_hook.hh"
+#include "test_fixture.hh"
extern "C" ssize_t smack_new_label_from_path(const char* arg1,
const char* arg2, int arg3, char** arg4) {
diff --git a/tests/mock/smack_mock.h b/tests/mock/smack_mock.hh
index 2517c16..4ebdf44 100644
--- a/tests/mock/smack_mock.h
+++ b/tests/mock/smack_mock.hh
@@ -20,7 +20,7 @@
#include <gmock/gmock.h>
#include <sys/smack.h>
-#include "module_mock.h"
+#include "module_mock.hh"
class SmackMock : public virtual ModuleMock {
public:
diff --git a/tests/mock/test_fixture.cc b/tests/mock/test_fixture.cc
index 27f5666..50f39e9 100644
--- a/tests/mock/test_fixture.cc
+++ b/tests/mock/test_fixture.cc
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "test_fixture.h"
+#include "test_fixture.hh"
#include <memory>
diff --git a/tests/mock/test_fixture.h b/tests/mock/test_fixture.hh
index 1ea3b8f..0bf58d1 100644
--- a/tests/mock/test_fixture.h
+++ b/tests/mock/test_fixture.hh
@@ -24,7 +24,7 @@
#include <string>
#include <utility>
-#include "module_mock.h"
+#include "module_mock.hh"
class TestFixture : public ::testing::Test {
public:
diff --git a/tests/mock/tzplatform_config_mock.cc b/tests/mock/tzplatform_config_mock.cc
index e6b3cbd..6094654 100644
--- a/tests/mock/tzplatform_config_mock.cc
+++ b/tests/mock/tzplatform_config_mock.cc
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-#include "tzplatform_config_mock.h"
+#include "tzplatform_config_mock.hh"
-#include "mock_hook.h"
-#include "test_fixture.h"
+#include "mock_hook.hh"
+#include "test_fixture.hh"
extern "C" const char* tzplatform_getenv(enum tzplatform_variable arg1) {
return MOCK_HOOK_P1(TzplatformConfigMock, tzplatform_getenv, arg1);
diff --git a/tests/mock/tzplatform_config_mock.h b/tests/mock/tzplatform_config_mock.hh
index b6c75e4..43d1ac1 100644
--- a/tests/mock/tzplatform_config_mock.h
+++ b/tests/mock/tzplatform_config_mock.hh
@@ -20,7 +20,7 @@
#include <tzplatform_config.h>
#include <gmock/gmock.h>
-#include "module_mock.h"
+#include "module_mock.hh"
class TzplatformConfigMock : public virtual ModuleMock {
public:
diff --git a/tests/unittest/CMakeLists.txt b/tests/noti_ex_unittest/CMakeLists.txt
index 58e266b..58e266b 100644
--- a/tests/unittest/CMakeLists.txt
+++ b/tests/noti_ex_unittest/CMakeLists.txt
diff --git a/tests/unittest/src/test_main.cc b/tests/noti_ex_unittest/src/test_main.cc
index ad7ec6c..ad7ec6c 100644
--- a/tests/unittest/src/test_main.cc
+++ b/tests/noti_ex_unittest/src/test_main.cc
diff --git a/tests/unittest/src/test_noti_ex_abstract_item.cc b/tests/noti_ex_unittest/src/test_noti_ex_abstract_item.cc
index e9d8459..3d1549a 100644
--- a/tests/unittest/src/test_noti_ex_abstract_item.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_abstract_item.cc
@@ -28,9 +28,10 @@
#include "notification-ex/group_item.h"
#include "notification-ex/button_item.h"
-#include "mock/test_fixture.h"
-#include "mock/smack_mock.h"
-#include "mock/app_common_mock.h"
+#include "mock/test_fixture.hh"
+#include "mock/smack_mock.hh"
+#include "mock/app_common_mock.hh"
+#include "mock/aul_mock.hh"
#define MY_ITEM_TYPE AbstractItem::Type::Custom + 1
@@ -87,6 +88,7 @@ class MyFactory : public IItemFactory {
};
class Mocks :
+ virtual public ::testing::NiceMock<AulMock>,
virtual public ::testing::NiceMock<SmackMock>,
virtual public ::testing::NiceMock<AppCommonMock> {};
} // namespace
diff --git a/tests/unittest/src/test_noti_ex_app_control_action.cc b/tests/noti_ex_unittest/src/test_noti_ex_app_control_action.cc
index 1bdd3c4..70f53e1 100644
--- a/tests/unittest/src/test_noti_ex_app_control_action.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_app_control_action.cc
@@ -17,8 +17,8 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "mock/app_common_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/app_common_mock.hh"
+#include "mock/test_fixture.hh"
#include "notification-ex/app_control_action.h"
#include "notification-ex/action_inflator.h"
diff --git a/tests/unittest/src/test_noti_ex_button_item.cc b/tests/noti_ex_unittest/src/test_noti_ex_button_item.cc
index edc1560..7c39bf6 100644
--- a/tests/unittest/src/test_noti_ex_button_item.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_button_item.cc
@@ -16,8 +16,8 @@
#include <gmock/gmock.h>
-#include "mock/app_common_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/app_common_mock.hh"
+#include "mock/test_fixture.hh"
#include "notification-ex/button_item.h"
#include "notification-ex/item_inflator.h"
diff --git a/tests/unittest/src/test_noti_ex_chat_message_item.cc b/tests/noti_ex_unittest/src/test_noti_ex_chat_message_item.cc
index e5b8772..aa0f9fb 100644
--- a/tests/unittest/src/test_noti_ex_chat_message_item.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_chat_message_item.cc
@@ -17,9 +17,9 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "mock/app_common_mock.h"
-#include "mock/smack_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/app_common_mock.hh"
+#include "mock/smack_mock.hh"
+#include "mock/test_fixture.hh"
#include "notification-ex/chat_message_item.h"
#include "notification-ex/item_inflator.h"
diff --git a/tests/unittest/src/test_noti_ex_checkbox_item.cc b/tests/noti_ex_unittest/src/test_noti_ex_checkbox_item.cc
index a2f2a6a..e27f192 100644
--- a/tests/unittest/src/test_noti_ex_checkbox_item.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_checkbox_item.cc
@@ -17,8 +17,8 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "mock/app_common_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/app_common_mock.hh"
+#include "mock/test_fixture.hh"
#include "notification-ex/checkbox_item.h"
#include "notification-ex/item_inflator.h"
diff --git a/tests/unittest/src/test_noti_ex_entry_item.cc b/tests/noti_ex_unittest/src/test_noti_ex_entry_item.cc
index 869e25a..6234c44 100644
--- a/tests/unittest/src/test_noti_ex_entry_item.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_entry_item.cc
@@ -17,8 +17,8 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "mock/app_common_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/app_common_mock.hh"
+#include "mock/test_fixture.hh"
#include "notification-ex/entry_item.h"
#include "notification-ex/item_inflator.h"
diff --git a/tests/unittest/src/test_noti_ex_event_info.cc b/tests/noti_ex_unittest/src/test_noti_ex_event_info.cc
index c480953..91f5505 100644
--- a/tests/unittest/src/test_noti_ex_event_info.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_event_info.cc
@@ -16,8 +16,8 @@
#include <gmock/gmock.h>
-#include "mock/app_common_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/app_common_mock.hh"
+#include "mock/test_fixture.hh"
#include "notification-ex/event_info_internal.h"
using namespace tizen_base;
diff --git a/tests/unittest/src/test_noti_ex_group_item.cc b/tests/noti_ex_unittest/src/test_noti_ex_group_item.cc
index 5a1dc89..e00ae1f 100644
--- a/tests/unittest/src/test_noti_ex_group_item.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_group_item.cc
@@ -20,8 +20,8 @@
#include "notification-ex/button_item.h"
#include "notification-ex/text_item.h"
#include "notification-ex/item_inflator.h"
-#include "mock/app_common_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/app_common_mock.hh"
+#include "mock/test_fixture.hh"
using namespace tizen_base;
using namespace notification;
diff --git a/tests/unittest/src/test_noti_ex_icon_item.cc b/tests/noti_ex_unittest/src/test_noti_ex_icon_item.cc
index 5925d3c..0ca4010 100644
--- a/tests/unittest/src/test_noti_ex_icon_item.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_icon_item.cc
@@ -17,9 +17,9 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "mock/app_common_mock.h"
-#include "mock/smack_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/app_common_mock.hh"
+#include "mock/smack_mock.hh"
+#include "mock/test_fixture.hh"
#include "notification-ex/icon_item.h"
#include "notification-ex/item_inflator.h"
diff --git a/tests/unittest/src/test_noti_ex_image_item.cc b/tests/noti_ex_unittest/src/test_noti_ex_image_item.cc
index 63968cb..0aeb77e 100644
--- a/tests/unittest/src/test_noti_ex_image_item.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_image_item.cc
@@ -17,9 +17,9 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "mock/smack_mock.h"
-#include "mock/app_common_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/smack_mock.hh"
+#include "mock/app_common_mock.hh"
+#include "mock/test_fixture.hh"
#include "notification-ex/image_item.h"
#include "notification-ex/item_inflator.h"
diff --git a/tests/unittest/src/test_noti_ex_input_selector_item.cc b/tests/noti_ex_unittest/src/test_noti_ex_input_selector_item.cc
index 2e13a6e..e8b2669 100644
--- a/tests/unittest/src/test_noti_ex_input_selector_item.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_input_selector_item.cc
@@ -16,8 +16,8 @@
#include <gmock/gmock.h>
-#include "mock/app_common_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/app_common_mock.hh"
+#include "mock/test_fixture.hh"
#include "notification-ex/input_selector_item.h"
#include "notification-ex/item_inflator.h"
diff --git a/tests/unittest/src/test_noti_ex_progress_item.cc b/tests/noti_ex_unittest/src/test_noti_ex_progress_item.cc
index 348e0c5..0328ef3 100644
--- a/tests/unittest/src/test_noti_ex_progress_item.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_progress_item.cc
@@ -16,8 +16,8 @@
#include <gmock/gmock.h>
-#include "mock/app_common_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/app_common_mock.hh"
+#include "mock/test_fixture.hh"
#include "notification-ex/progress_item.h"
#include "notification-ex/item_inflator.h"
diff --git a/tests/unittest/src/test_noti_ex_shared_file.cc b/tests/noti_ex_unittest/src/test_noti_ex_shared_file.cc
index 2b58335..edbd6e7 100644
--- a/tests/unittest/src/test_noti_ex_shared_file.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_shared_file.cc
@@ -17,16 +17,17 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "mock/app_common_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/app_common_mock.hh"
+#include "mock/test_fixture.hh"
#include "notification-ex/shared_file.h"
#include "notification-ex/image_item.h"
#include "notification-ex/common.h"
-#include "mock/glib_mock.h"
-#include "mock/smack_mock.h"
-#include "mock/tzplatform_config_mock.h"
-#include "mock/security_manager_mock.h"
+#include "mock/glib_mock.hh"
+#include "mock/smack_mock.hh"
+#include "mock/tzplatform_config_mock.hh"
+#include "mock/security_manager_mock.hh"
+#include "mock/aul_mock.hh"
using namespace notification;
@@ -92,6 +93,7 @@ class SharedFileTest : public TestFixture {
virtual void SetUp() {
item = make_shared<ImageItem>(id, image_path);
shared_file = new SharedFile();
+ item->SetSenderAppId("notification-ex_unittests");
}
virtual void TearDown() {
diff --git a/tests/unittest/src/test_noti_ex_text_item.cc b/tests/noti_ex_unittest/src/test_noti_ex_text_item.cc
index 7f5c318..744a230 100644
--- a/tests/unittest/src/test_noti_ex_text_item.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_text_item.cc
@@ -17,8 +17,8 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "mock/app_common_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/app_common_mock.hh"
+#include "mock/test_fixture.hh"
#include "notification-ex/text_item.h"
#include "notification-ex/item_inflator.h"
diff --git a/tests/unittest/src/test_noti_ex_time_item.cc b/tests/noti_ex_unittest/src/test_noti_ex_time_item.cc
index 1e5c29b..94edabe 100644
--- a/tests/unittest/src/test_noti_ex_time_item.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_time_item.cc
@@ -17,8 +17,8 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "mock/app_common_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/app_common_mock.hh"
+#include "mock/test_fixture.hh"
#include "notification-ex/time_item.h"
#include "notification-ex/item_inflator.h"
diff --git a/tests/unittest/src/test_noti_ex_visibility_action.cc b/tests/noti_ex_unittest/src/test_noti_ex_visibility_action.cc
index 258d8e5..d56e26d 100644
--- a/tests/unittest/src/test_noti_ex_visibility_action.cc
+++ b/tests/noti_ex_unittest/src/test_noti_ex_visibility_action.cc
@@ -19,8 +19,8 @@
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "mock/app_common_mock.h"
-#include "mock/test_fixture.h"
+#include "mock/app_common_mock.hh"
+#include "mock/test_fixture.hh"
#include "notification-ex/visibility_action.h"
#include "notification-ex/action_inflator.h"
diff --git a/tests/noti_unittest/CMakeLists.txt b/tests/noti_unittest/CMakeLists.txt
new file mode 100644
index 0000000..10bdf56
--- /dev/null
+++ b/tests/noti_unittest/CMakeLists.txt
@@ -0,0 +1,57 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+PROJECT(notification_unittests C CXX)
+
+INCLUDE(FindPkgConfig)
+PKG_CHECK_MODULES(notification_unittests REQUIRED
+ dlog
+ dbus-1
+ gmock
+ capi-appfw-app-control
+ glib-2.0
+ gio-2.0
+ gio-unix-2.0
+ aul
+ security-manager
+ libtzplatform-config
+)
+
+FOREACH(flag ${notification_unittests_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall")
+
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}")
+SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
+SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
+
+
+SET(INIT-SRCS ${CMAKE_SOURCE_DIR}/notification/src/notification_init.c)
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/notification/src)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/notification/include)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../mock)
+
+
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src SOURCES)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../mock MOCK_SOURCES)
+AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/notification/src NOTIFICATION_SOURCES)
+
+LIST(REMOVE_ITEM NOTIFICATION_SOURCES ${INIT-SRCS})
+
+ADD_EXECUTABLE(${PROJECT_NAME}
+ ${SOURCES}
+ ${NOTIFICATION_SOURCES}
+ ${MOCK_SOURCES}
+)
+
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${EXTRA_CFLAGS}")
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${notification_unittests_LDFLAGS}
+ ${pkgs_LDFLAGS}
+ ${pkgs_LIBRARIES}
+ gmock
+ notification
+)
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin/)
diff --git a/tests/noti_unittest/src/test_main.cc b/tests/noti_unittest/src/test_main.cc
new file mode 100644
index 0000000..ad7ec6c
--- /dev/null
+++ b/tests/noti_unittest/src/test_main.cc
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * 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 <gtest/gtest.h>
+#include <gmock/gmock.h>
+
+int main(int argc, char** argv) {
+ int ret = -1;
+
+ try {
+ testing::InitGoogleTest(&argc, argv);
+ } catch(...) {
+ std::cout << "Exception occurred" << std::endl;
+ }
+
+ try {
+ ret = RUN_ALL_TESTS();
+ } catch (const ::testing::internal::GoogleTestFailureException& e) {
+ ret = -1;
+ std::cout << "GoogleTestFailureException was thrown:" << e.what() << std::endl;
+ }
+
+ return ret;
+}
diff --git a/tests/noti_unittest/src/test_noti_notification.cc b/tests/noti_unittest/src/test_noti_notification.cc
new file mode 100644
index 0000000..c61a690
--- /dev/null
+++ b/tests/noti_unittest/src/test_noti_notification.cc
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * 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 <gtest/gtest.h>
+#include <gmock/gmock.h>
+
+#include "notification/include/notification.h"
+#include "mock/aul_mock.hh"
+#include "mock/test_fixture.hh"
+#include "mock/app_common_mock.hh"
+#include "mock/aul_mock.hh"
+
+namespace {
+class Mocks :
+ virtual public ::testing::NiceMock<AulMock>,
+ virtual public ::testing::NiceMock<AppCommonMock> {};
+} // namespace
+
+class NotificationTest : public TestFixture {
+ public:
+ NotificationTest() : TestFixture(std::make_unique<::Mocks>()) {}
+ virtual void SetUp() {
+ }
+ virtual void TearDown() {
+ }
+};
+
+TEST_F(NotificationTest, create) {
+ notification_h noti = nullptr;
+ noti = notification_create(NOTIFICATION_TYPE_NOTI);
+
+ //EXPECT_NE(noti, nullptr);
+ ASSERT_EQ(noti, nullptr);
+}