INSTALL(FILES ${CMAKE_SOURCE_DIR}/alarmmgr_log_dump.sh DESTINATION ${TZ_SYS_ETC}/dump.d/module.d/)
ENDIF(_APPFW_FEATURE_ALARM_MANAGER_MODULE_LOG)
-IF(BUILD_GTESTS)
+IF(BUILD_GCOV)
SET(EXTRA_CFLAGS "-Werror-implicit-function-declaration")
-ELSE(BUILD_GTESTS)
+ELSE(BUILD_GCOV)
SET(EXTRA_CFLAGS "-Werror-implicit-function-declaration -fvisibility=hidden")
-ENDIF(BUILD_GTESTS)
+ENDIF(BUILD_GCOV)
IF(BUILD_GCOV)
ADD_DEFINITIONS("-DTIZEN_TEST_GCOV")
-ENDIF(BUILD_GCOV)
-
-IF(BUILD_GTESTS)
ADD_SUBDIRECTORY(unittest)
-ENDIF(BUILD_GTESTS)
+ENDIF(BUILD_GCOV)
\ No newline at end of file
BuildRequires: zip
%endif
-%if 0%{?gtests:1}
+%if 0%{?gcov:1}
BuildRequires: pkgconfig(gmock)
%endif
Requires(post): /sbin/ldconfig
-DTZ_SYS_ETC=%{TZ_SYS_ETC} \
-D_APPFW_FEATURE_ALARM_MANAGER_MODULE_LOG:BOOL=${_APPFW_FEATURE_ALARM_MANAGER_MODULE_LOG} \
-DALARM_CONF_DIR=%{_datadir}/alarm-manager \
- -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
-DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} \
make %{?jobs:-j%jobs}
#################################################
# unittests
#################################################
-%if 0%{?gtests:1}
+%if 0%{?gcov:1}
%files unittests
%{_bindir}/gtest*
%endif
void __g_dbus_node_info_unref_fake(GDBusNodeInfo *info)
{
- free(info->interfaces);
- free(info);
+ if (info && info->interfaces) {
+ free(info->interfaces);
+ free(info);
+ }
info = NULL;
return;
}
if (!info)
return NULL;
- GDBusInterfaceInfo *interface =
- (GDBusInterfaceInfo*)malloc(sizeof(GDBusInterfaceInfo));
+ GDBusInterfaceInfo **interface =
+ (GDBusInterfaceInfo**)malloc(sizeof(GDBusInterfaceInfo*));
if (!interface) {
free(info);
return NULL;
info->ref_count = 10;
info->path = NULL;
- info->interfaces = &interface;
+ info->interfaces = interface;
info->nodes = NULL;
info->annotations = NULL;
g_bus_get_sync_fake.custom_fake = __g_bus_get_sync_fake;
g_dbus_proxy_new_sync_fake.custom_fake = __g_dbus_proxy_new_sync_fake;
- g_dbus_node_info_unref_fake.custom_fake = __g_dbus_node_info_unref_fake;
}
void TearDown() override {
alarmmgr_free_alarm(alarm);
g_dbus_connection_register_object_fake.custom_fake = __g_dbus_connection_register_object_fake;
g_dbus_connection_unregister_object_fake.custom_fake = __g_dbus_connection_unregister_object_fake;
g_bus_own_name_on_connection_fake.custom_fake = __g_bus_own_name_on_connection_fake;
+ g_dbus_node_info_unref_fake.custom_fake = __g_dbus_node_info_unref_fake;
ret = alarmmgr_init(testapp);
EXPECT_EQ(ALARMMGR_RESULT_SUCCESS, ret);