aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-10-12 09:11:32 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-10-12 09:11:32 +0200
commitd74cce266bbc6ec519376601a2004f4fa8155b64 (patch)
treeebaa1db540e7e92e9ab9a3a83d0d7cda8173ac4a /openbsc/tests
parent2aedfbdfe1dfb4df84418af4bb39c40ca1cc5128 (diff)
parent696212798291688a85afc956b6d80c10c7acb033 (diff)
Merge branch 'zecke/features/osmux-reliability'
Not verified that the audio handling is working. I saw a circuit set-up of the call though.
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/mgcp/mgcp_test.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/openbsc/tests/mgcp/mgcp_test.c b/openbsc/tests/mgcp/mgcp_test.c
index b2cb938ce..ec86c55a9 100644
--- a/openbsc/tests/mgcp/mgcp_test.c
+++ b/openbsc/tests/mgcp/mgcp_test.c
@@ -1175,6 +1175,31 @@ static void test_no_name(void)
talloc_free(cfg);
}
+static void test_osmux_cid(void)
+{
+ int id, i;
+
+ OSMO_ASSERT(osmux_used_cid() == 0);
+ id = osmux_get_cid();
+ OSMO_ASSERT(id == 0);
+ OSMO_ASSERT(osmux_used_cid() == 1);
+ osmux_put_cid(id);
+ OSMO_ASSERT(osmux_used_cid() == 0);
+
+ for (i = 0; i < 128; ++i) {
+ id = osmux_get_cid();
+ OSMO_ASSERT(id == i);
+ OSMO_ASSERT(osmux_used_cid() == i + 1);
+ }
+
+ id = osmux_get_cid();
+ OSMO_ASSERT(id == -1);
+
+ for (i = 0; i < 256; ++i)
+ osmux_put_cid(i);
+ OSMO_ASSERT(osmux_used_cid() == 0);
+}
+
int main(int argc, char **argv)
{
osmo_init_logging(&log_info);
@@ -1193,6 +1218,7 @@ int main(int argc, char **argv)
test_multilple_codec();
test_no_cycle();
test_no_name();
+ test_osmux_cid();
printf("Done\n");
return EXIT_SUCCESS;