diff options
author | Inkyun Kil <inkyun.kil@samsung.com> | 2019-05-21 11:51:06 +0900 |
---|---|---|
committer | Inkyun Kil <inkyun.kil@samsung.com> | 2019-05-28 09:06:45 +0900 |
commit | f77e9585ff4dad4a2acc0da5447b12a08391df2d (patch) | |
tree | 2ee432f98c99f1903928931e299a0e9cf1af3a2f /unittest/mock/gio_fake.h | |
parent | 171db9786ca4159a6bfdf4d1ab1c0d3c6c271f99 (diff) | |
download | alarm-manager-f77e9585ff4dad4a2acc0da5447b12a08391df2d.tar.gz alarm-manager-f77e9585ff4dad4a2acc0da5447b12a08391df2d.tar.bz2 alarm-manager-f77e9585ff4dad4a2acc0da5447b12a08391df2d.zip |
Adds unittest for alarm-manager daemon
Change-Id: Ie1c6a63b14223f5424602f1dc9efa09965c66c0a
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
Diffstat (limited to 'unittest/mock/gio_fake.h')
-rw-r--r-- | unittest/mock/gio_fake.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/unittest/mock/gio_fake.h b/unittest/mock/gio_fake.h new file mode 100644 index 0000000..8181065 --- /dev/null +++ b/unittest/mock/gio_fake.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2019 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. + */ + +#ifndef MOCK_GIO_H_ +#define MOCK_GIO_H_ + +#include "mock.h" + +#include <glib.h> +#include <gio/gio.h> + +DECLARE_FAKE_VALUE_FUNC(GDBusConnection*, g_bus_get_sync, + GBusType, GCancellable*, GError**); + +DECLARE_FAKE_VALUE_FUNC(GDBusProxy*, g_dbus_proxy_new_sync, + GDBusConnection*, GDBusProxyFlags, GDBusInterfaceInfo*, + const gchar*, const gchar*, const gchar*, GCancellable*, GError**); + +DECLARE_FAKE_VALUE_FUNC(GDBusNodeInfo*, g_dbus_node_info_new_for_xml, + const gchar*, GError**); + +DECLARE_FAKE_VALUE_FUNC(guint, g_bus_own_name_on_connection, GDBusConnection*, + const gchar*, GBusNameOwnerFlags,GBusNameAcquiredCallback, + GBusNameLostCallback, gpointer, GDestroyNotify); + +DECLARE_FAKE_VALUE_FUNC(guint, g_dbus_connection_register_object, + GDBusConnection*, const gchar*, GDBusInterfaceInfo*, + const GDBusInterfaceVTable*, gpointer, GDestroyNotify, GError**); + +DECLARE_FAKE_VOID_FUNC(g_dbus_method_invocation_return_value, + GDBusMethodInvocation*, GVariant*); + +DECLARE_FAKE_VALUE_FUNC(GVariant*, g_dbus_connection_call_sync, GDBusConnection*, + const gchar*, const gchar*, const gchar*, const gchar*, GVariant*, + const GVariantType*, GDBusCallFlags, gint, GCancellable*, GError**); + +DECLARE_FAKE_VALUE_FUNC(const gchar*, g_dbus_method_invocation_get_sender, + GDBusMethodInvocation*); + +DECLARE_FAKE_VOID_FUNC(g_bus_unown_name, guint); + +DECLARE_FAKE_VALUE_FUNC(gboolean, g_dbus_connection_emit_signal, + GDBusConnection*, const gchar*, const gchar*, const gchar*, const gchar*, + GVariant*, GError**); + +DECLARE_FAKE_VALUE_FUNC(gboolean, g_dbus_connection_flush_sync, + GDBusConnection*, GCancellable*, GError**); + +DECLARE_FAKE_VOID_FUNC(g_dbus_node_info_unref, GDBusNodeInfo*); + +DECLARE_FAKE_VALUE_FUNC(guint, g_dbus_connection_signal_subscribe, + GDBusConnection*, const gchar*, const gchar*, const gchar*, const gchar*, + const gchar*, GDBusSignalFlags, GDBusSignalCallback, gpointer, + GDestroyNotify); + +DECLARE_FAKE_VALUE_FUNC(gboolean, g_dbus_interface_skeleton_export, + GDBusInterfaceSkeleton*, GDBusConnection*, const gchar*, GError**); + +#endif //MOCK_GIO_H_ |