diff options
author | Alfred E. Heggestad <aeh@db.org> | 2015-09-30 22:31:46 +0200 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2015-09-30 22:31:54 +0200 |
commit | a24ade0a3bdede676c4c85198ed3f1c000efaeff (patch) | |
tree | 4852712930cc37fdfe9a5f9c99fcd1cd8f4392d6 /test | |
parent | 3ba837ff863b6fcce6ebfc22f9c79eaf8d82fadb (diff) |
test: added a test for C++ api compatibility
Diffstat (limited to 'test')
-rw-r--r-- | test/cplusplus.cpp | 16 | ||||
-rw-r--r-- | test/main.c | 4 | ||||
-rw-r--r-- | test/srcs.mk | 2 | ||||
-rw-r--r-- | test/test.h | 11 |
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 |