diff options
author | Harald Welte <laforge@gnumonks.org> | 2019-02-26 22:36:11 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2019-02-26 22:37:57 +0100 |
commit | 313cf355817fa8774f34ce5a2c95b6473d12fa63 (patch) | |
tree | 999f22447f61d718ba497c4eab444a925ce18228 /tests/gbproxy/gbproxy_test.c | |
parent | b6f8b74b07cef1f04bf45e6dc5592c4b24cca4c0 (diff) |
gbproxy_test: Fix test expectations of gprs_ns_rcvmsg()
gprs_ns_rcvmsg() in old libosmocore returns "number of bytes transmitted
by any response PDU we sent as a result of the received message", while
modern libosmocore simply retunrs '0' for any successfully received
message. Let's make sure any non-negative responses lead to a
reproducible test output with both old and new libosmocore.
Change-Id: I7a48d14aed19825b87a02ccf9ee9cbfe0853342c
Diffstat (limited to 'tests/gbproxy/gbproxy_test.c')
-rw-r--r-- | tests/gbproxy/gbproxy_test.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c index 55776be8f..f5c730db9 100644 --- a/tests/gbproxy/gbproxy_test.c +++ b/tests/gbproxy/gbproxy_test.c @@ -1302,7 +1302,13 @@ static int gprs_process_message(struct gprs_ns_inst *nsi, const char *text, stru ret = gprs_ns_rcvmsg(nsi, msg, peer, GPRS_NS_LL_UDP); - printf("result (%s) = %d\n\n", text, ret); + /* gprs_ns_rcvmsg() in old libosmocore returns "number of bytes + * transmitted by any response PDU we sent as a result of the + * received message", while modern libosmocore simply retunrs '0' + * for any successfully received message. Let's make sure any + * non-negative responses lead to a reproducible test output + * with both old and new libosmocore. */ + printf("result (%s) = %d\n\n", text, ret < 0 ? ret : 0); msgb_free(msg); |