Add support for auto-coverage in Bluetooth-Agent
[platform/core/connectivity/bluetooth-agent.git] / unittest / mock / bluetooth-agent-mock.c
1 /*
2  * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16
17 #define _GNU_SOURCE
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <stdbool.h>
21 #include <string.h>
22 #include <glib.h>
23 #include <gio/gio.h>
24
25
26 /*Messaging Header Files*/
27 #include "msg.h"
28 #include "msg_transport_types.h"
29 #include "msg_types.h"
30 #include "email-types.h"
31
32 #ifndef API
33 #define API __attribute__ ((visibility("default")))
34 #endif
35
36
37 API int vconf_get_int(const char *in_key, const int intval)
38 {
39         return 0;
40 }
41
42 API char *vconf_get_str(const char *in_key)
43 {
44         return strdup("memory/telephony/nw_name");
45 }
46
47 API int email_service_end()
48 {
49         return EMAIL_ERROR_NONE;
50 }
51
52 API int msg_open_msg_handle(msg_handle_t *handle)
53 {
54         return MSG_SUCCESS;
55 }
56
57 API int msg_reg_sent_status_callback(msg_handle_t handle, msg_sent_status_cb cb, void *user_param)
58 {
59         return MSG_SUCCESS;
60 }
61
62 API int msg_reg_sms_message_callback(msg_handle_t handle, msg_sms_incoming_cb cb, unsigned short port, void *user_param)
63 {
64         return MSG_SUCCESS;
65 }
66
67 API GDBusConnection *g_bus_get_sync (GBusType bus_type,
68                 GCancellable *cancellable,
69                 GError **error)
70 {
71         return (void *)1234;
72 }
73
74 API guint g_dbus_connection_register_object (GDBusConnection *connection,
75                 const gchar *object_path,
76                 GDBusInterfaceInfo *interface_info,
77                 const GDBusInterfaceVTable *vtable,
78                 gpointer user_data,
79                 GDestroyNotify user_data_free_func,
80                 GError **error)
81 {
82         return 1234;
83 }
84
85 API guint g_dbus_connection_signal_subscribe (GDBusConnection *connection,
86                 const gchar *sender,
87                 const gchar *interface_name,
88                 const gchar *member,
89                 const gchar *object_path,
90                 const gchar *arg0,
91                 GDBusSignalFlags flags,
92                 GDBusSignalCallback callback,
93                 gpointer user_data,
94                 GDestroyNotify user_data_free_func)
95 {
96         return 0;
97 }
98 API void g_dbus_connection_signal_unsubscribe(GDBusConnection *connection,
99                 guint subscription_id)
100 {
101 }
102
103 API gboolean g_dbus_connection_unregister_object(GDBusConnection *connection,
104                 guint registration_id)
105 {
106         return TRUE;
107 }
108
109 API void g_object_unref(gpointer object)
110 {
111 }
112
113 API GVariant *g_dbus_proxy_call_sync(GDBusProxy *proxy,
114                 const gchar *method_name,
115                 GVariant *parameters,
116                 GDBusCallFlags flags,
117                 gint timeout_msec,
118                 GCancellable *cancellable,
119                 GError **error)
120 {
121         return NULL;
122 }
123
124 API GDBusProxy *g_dbus_proxy_new_sync(GDBusConnection *connection,
125                 GDBusProxyFlags flags,
126                 GDBusInterfaceInfo *info,
127                 const gchar *name,
128                 const gchar *object_path,
129                 const gchar *interface_name,
130                 GCancellable *cancellable,
131                 GError **error)
132 {
133         return (void *)1234;
134 }
135
136 API GVariant *g_variant_get_child_value(GVariant *value,
137                 gsize index_)
138 {
139         return (void *)1234;
140 }
141
142 API gsize g_variant_n_children(GVariant *value)
143 {
144         return 1234;
145 }
146
147 API void g_variant_unref(GVariant *value)
148 {
149 }
150
151 API void g_variant_get (GVariant *value,
152                 const gchar *format_string,
153                 ...)
154 {
155 }
156
157 API gint g_io_channel_unix_get_fd(GIOChannel *channel)
158 {
159         return 0;
160 }