summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/call.c35
-rw-r--r--test/main.c1
-rw-r--r--test/test.h1
3 files changed, 37 insertions, 0 deletions
diff --git a/test/call.c b/test/call.c
index cad90a6..7c96100 100644
--- a/test/call.c
+++ b/test/call.c
@@ -234,3 +234,38 @@ int test_call_reject(void)
return err;
}
+
+
+int test_call_af_mismatch(void)
+{
+ struct fixture fix, *f = &fix;
+ int err = 0;
+
+ fixture_init(f);
+
+ ua_set_media_af(f->a.ua, AF_INET6);
+ ua_set_media_af(f->b.ua, AF_INET);
+
+ /* Make a call from A to B */
+ err = ua_connect(f->a.ua, 0, NULL, f->buri, NULL, VIDMODE_OFF);
+ TEST_ERR(err);
+
+ /* run main-loop with timeout, wait for events */
+ err = re_main_timeout(5);
+ TEST_ERR(err);
+ TEST_ERR(fix.err);
+
+ ASSERT_EQ(0, fix.a.n_incoming);
+ ASSERT_EQ(0, fix.a.n_established);
+ ASSERT_EQ(1, fix.a.n_closed);
+ ASSERT_EQ(488, fix.a.close_scode);
+
+ ASSERT_EQ(0, fix.b.n_incoming);
+ ASSERT_EQ(0, fix.b.n_established);
+ ASSERT_EQ(1, fix.b.n_closed);
+
+ out:
+ fixture_close(f);
+
+ return err;
+}
diff --git a/test/main.c b/test/main.c
index a959a5e..8215ed4 100644
--- a/test/main.c
+++ b/test/main.c
@@ -25,6 +25,7 @@ static const struct test tests[] = {
TEST(test_cplusplus),
TEST(test_call_answer),
TEST(test_call_reject),
+ TEST(test_call_af_mismatch),
};
diff --git a/test/test.h b/test/test.h
index 2600bd6..8aedc00 100644
--- a/test/test.h
+++ b/test/test.h
@@ -81,6 +81,7 @@ int test_ua_register(void);
int test_call_answer(void);
int test_call_reject(void);
+int test_call_af_mismatch(void);
#ifdef __cplusplus