summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am9
-rw-r--r--unit/test-mux.c57
3 files changed, 65 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index fe317312..73524780 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,3 +34,4 @@ unit/test-common
unit/test-util
unit/test-sms
unit/test-simutil
+unit/test-mux
diff --git a/Makefile.am b/Makefile.am
index b753c0d9..cbbdf331 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -184,7 +184,8 @@ AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @GTHREAD_CFLAGS@ \
-DPLUGINDIR=\""$(build_plugindir)"\"
INCLUDES = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/src \
- -I$(srcdir)/gdbus -I$(srcdir)/gisi -I$(srcdir)/gatchat
+ -I$(srcdir)/gdbus -I$(srcdir)/gisi \
+ -I$(srcdir)/gatmux -I$(srcdir)/gatchat
doc_files = doc/overview.txt \
doc/manager-api.txt doc/modem-api.txt doc/network-api.txt \
@@ -212,7 +213,7 @@ dist_man_MANS = doc/ofonod.8
unit_objects =
noinst_PROGRAMS = unit/test-common unit/test-util \
- unit/test-sms unit/test-simutil
+ unit/test-sms unit/test-simutil unit/test-mux
unit_test_common_SOURCES = unit/test-common.c src/common.c
unit_test_common_LDADD = @GLIB_LIBS@
@@ -231,6 +232,10 @@ unit_test_simutil_SOURCES = unit/test-simutil.c src/util.c \
unit_test_simutil_LDADD = @GLIB_LIBS@
unit_objects += $(unit_test_simutil_OBJECTS)
+unit_test_mux_SOURCES = unit/test-mux.c gatmux/gsm0710_p.h gatmux/gsm0710.c
+unit_test_mux_LDADD = @GLIB_LIBS@
+unit_objects += $(unit_test_mux_OBJECTS)
+
DISTCHECK_CONFIGURE_FLAGS = --disable-datafiles
diff --git a/unit/test-mux.c b/unit/test-mux.c
new file mode 100644
index 00000000..ad757f38
--- /dev/null
+++ b/unit/test-mux.c
@@ -0,0 +1,57 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2008-2009 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <glib.h>
+#include <glib/gprintf.h>
+
+#include "gsm0710_p.h"
+
+static void debug_message(struct gsm0710_context *ctx, const char *msg)
+{
+ g_print("debug: %s\n", msg);
+}
+
+static void test_setup(void)
+{
+ struct gsm0710_context ctx;
+
+ gsm0710_initialize(&ctx);
+
+ ctx.fd = -1;
+ ctx.debug_message = debug_message;
+
+ gsm0710_startup(&ctx, 0);
+
+ gsm0710_shutdown(&ctx);
+}
+
+int main(int argc, char **argv)
+{
+ g_test_init(&argc, &argv, NULL);
+
+ g_test_add_func("/testmux/Setup", test_setup);
+
+ return g_test_run();
+}