diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-06-28 13:24:36 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-07-22 13:12:05 +0200 |
commit | 6041c8db271ec2a9eecba42763d23889b56267f4 (patch) | |
tree | aa1a4e710a25a6a24495ea5543bee8213700e128 /openbsc/tests | |
parent | 83cbac2ac015cacc431593b862f9c0e357f7b8be (diff) |
mgcp: Do not use errx as finding a test failure is too hard
It took me a long time to figure out that errx just exits and
the test output didn't indicate that the application was exited
early. Use a printf and good old abort in case of a failure.
Diffstat (limited to 'openbsc/tests')
-rw-r--r-- | openbsc/tests/mgcp/mgcp_transcoding_test.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.c b/openbsc/tests/mgcp/mgcp_transcoding_test.c index 9cb1fdacb..6abf24892 100644 --- a/openbsc/tests/mgcp/mgcp_transcoding_test.c +++ b/openbsc/tests/mgcp/mgcp_transcoding_test.c @@ -177,8 +177,10 @@ static int given_configured_endpoint(int in_samples, int out_samples, } rc = mgcp_transcoding_setup(endp, dst_end, src_end); - if (rc < 0) - errx(1, "setup failed: %s", strerror(-rc)); + if (rc < 0) { + printf("setup failed: %s", strerror(-rc)); + abort(); + } *out_ctx = cfg; *out_endp = endp; @@ -217,8 +219,10 @@ static int transcode_test(const char *srcfmt, const char *dstfmt, cont = mgcp_transcoding_process_rtp(endp, dst_end, buf, &len, sizeof(buf)); - if (cont < 0) - errx(1, "processing failed: %s", strerror(-cont)); + if (cont < 0) { + printf("processing failed: %s", strerror(-cont)); + abort(); + } if (len < 24) { printf("encoded: %s\n", osmo_hexdump((unsigned char *)buf, len)); @@ -302,8 +306,10 @@ static int test_repacking(int in_samples, int out_samples, int no_transcode) break; } - if (cont < 0) - errx(1, "processing failed: %s", strerror(-cont)); + if (cont < 0) { + printf("processing failed: %s", strerror(-cont)); + abort(); + } len -= 12; /* ignore RTP header */ |