summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/cplusplus.cpp16
-rw-r--r--test/main.c4
-rw-r--r--test/srcs.mk2
-rw-r--r--test/test.h11
4 files changed, 33 insertions, 0 deletions
diff --git a/test/cplusplus.cpp b/test/cplusplus.cpp
new file mode 100644
index 0000000..b6ddaa9
--- /dev/null
+++ b/test/cplusplus.cpp
@@ -0,0 +1,16 @@
+/**
+ * @file test/cplusplus.cpp Baresip selftest -- C++ compatibility
+ *
+ * Copyright (C) 2010 - 2015 Creytiv.com
+ */
+#include <re.h>
+#include <rem.h>
+#include <baresip.h>
+#include "test.h"
+
+
+int test_cplusplus(void)
+{
+ re_printf("c++ ok\n");
+ return 0;
+}
diff --git a/test/main.c b/test/main.c
index c32cd4b..11cc1b2 100644
--- a/test/main.c
+++ b/test/main.c
@@ -28,6 +28,10 @@ static int run_tests(void)
if (err)
return err;
+ err = test_cplusplus();
+ if (err)
+ return err;
+
return 0;
}
diff --git a/test/srcs.mk b/test/srcs.mk
index df16f8b..4115fdb 100644
--- a/test/srcs.mk
+++ b/test/srcs.mk
@@ -10,4 +10,6 @@ TEST_SRCS += ua.c
TEST_SRCS += sip_server.c
TEST_SRCS += test.c
+TEST_SRCS += cplusplus.c
+
TEST_SRCS += main.c
diff --git a/test/test.h b/test/test.h
index 20807b6..c2caa6a 100644
--- a/test/test.h
+++ b/test/test.h
@@ -56,3 +56,14 @@ int test_cmd(void);
int test_ua_alloc(void);
int test_uag_find_param(void);
int test_ua_register(void);
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int test_cplusplus(void);
+
+#ifdef __cplusplus
+}
+#endif