aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mgcp/mgcp_patch_test.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-11-20 10:47:14 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-11-20 10:47:14 +0100
commit475291355dc2c48dbde85559616dda415042ee13 (patch)
treed1d36a46f04a3e391cdb87f8a9f6ffca20191b57 /tests/mgcp/mgcp_patch_test.c
parentfd8513d8c398b08d0f4812b6df5a8fac7e629969 (diff)
tests: Add GNU Autotest invocation for the tests we have here
Add some std output of the applications, integrate tests.
Diffstat (limited to 'tests/mgcp/mgcp_patch_test.c')
-rw-r--r--tests/mgcp/mgcp_patch_test.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/mgcp/mgcp_patch_test.c b/tests/mgcp/mgcp_patch_test.c
index 335cfcf..683ea01 100644
--- a/tests/mgcp/mgcp_patch_test.c
+++ b/tests/mgcp/mgcp_patch_test.c
@@ -71,8 +71,10 @@ static const char mgcp_out[] =
static void test_endp_name_rewriting()
{
struct ss7_application app;
- memset(&app, 0, sizeof(app));
+ printf("Test Endpoint Name rewriting.\n");
+
+ memset(&app, 0, sizeof(app));
app.mgcp_domain_name = "foo2";
/* prepare */
@@ -83,12 +85,10 @@ static void test_endp_name_rewriting()
/* patch it now */
struct msgb *msg_out = mgcp_patch(&app, msg);
msg_out->l2h[msgb_l2len(msg_out)] = '\0';
-#ifdef DEBUG
printf("Want : '%s'\n", mgcp_out);
printf("Outpu: '%s'\n", (const char *) msg_out->l2h);
- printf("%s\n", osmo_hexdump(mgcp_out, strlen(mgcp_out)));
+ printf("%s\n", osmo_hexdump((const uint8_t *) mgcp_out, strlen(mgcp_out)));
printf("%s\n", osmo_hexdump(msg_out->l2h, msgb_l2len(msg_out)));
-#endif
ASSERT(msg_out, !=, msg, "msg should not be the same");
ASSERT(msgb_l2len(msg_out), ==, strlen(mgcp_out), "Output size wrong");
@@ -99,5 +99,6 @@ int main(int argc, char **argv)
{
test_endp_name_rewriting();
+ printf("All tests passed.\n");
return 0;
}