From 22c4dfafe926193372be74dccef9cdf00721b807 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 18 Oct 2008 21:16:03 +0200 Subject: [PATCH] obexd: Add code for testing phonebook plugins --- obexd/src/main.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/obexd/src/main.c b/obexd/src/main.c index 7f623314c..8fc56186e 100644 --- a/obexd/src/main.c +++ b/obexd/src/main.c @@ -46,6 +46,7 @@ #include "logging.h" #include "bluetooth.h" +#include "phonebook.h" #include "obexd.h" #include "obex.h" @@ -58,6 +59,26 @@ static GMainLoop *main_loop = NULL; +static void test_phonebook(void) +{ + struct phonebook_context *context; + struct phonebook_driver *driver; + + driver = phonebook_get_driver(NULL); + if (driver == NULL) + return; + + context = g_try_new0(struct phonebook_context, 1); + if (context == NULL) + return; + + driver->create(context); + + driver->destroy(context); + + g_free(context); +} + static void tty_init(int service, const gchar *root_path, const gchar *capability, const gchar *devnode) { @@ -227,6 +248,8 @@ int main(int argc, char *argv[]) plugin_init(); + test_phonebook(); + if (option_root == NULL) option_root = g_strdup(DEFAULT_ROOT_PATH); -- 2.47.3