aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/mgcp/mgcp_test.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-12-18 12:54:50 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-19 11:56:11 +0100
commit65c7a4551a34ec560d6cf96d8613d300ea4c7c2d (patch)
tree534f7226c37fb4b0dd68601df2d609d0f8a9ddbc /openbsc/tests/mgcp/mgcp_test.c
parent93c9da3b37ea760840fcccf21460f80978a30157 (diff)
mgcp/test: Use differential output for counters and timestamp
Currently the counter and output timestamp values are written out for each packet. This makes it difficult to see in the diffs what has been changed significantly. This patch changes this by showing differences for those values. The absolute input values are also shown now. In addition, the sequence numbers (the difference for the output value) are written, too. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/tests/mgcp/mgcp_test.c')
-rw-r--r--openbsc/tests/mgcp/mgcp_test.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/openbsc/tests/mgcp/mgcp_test.c b/openbsc/tests/mgcp/mgcp_test.c
index b93ce7ef2..8b1b92415 100644
--- a/openbsc/tests/mgcp/mgcp_test.c
+++ b/openbsc/tests/mgcp/mgcp_test.c
@@ -644,6 +644,10 @@ static void test_packet_error_detection(int patch_ssrc, int patch_ts)
struct sockaddr_in addr = {0};
char buffer[4096];
uint32_t last_ssrc = 0;
+ uint32_t last_timestamp = 0;
+ uint32_t last_seqno = 0;
+ int last_in_ts_err_cnt = 0;
+ int last_out_ts_err_cnt = 0;
printf("Testing packet error detection%s%s.\n",
patch_ssrc ? ", patch SSRC" : "",
@@ -687,11 +691,23 @@ static void test_packet_error_detection(int patch_ssrc, int patch_ts)
last_ssrc = state.out_stream.ssrc;
}
- printf("TS: %d, dTS: %d, TS Errs: in %d, out %d\n",
- state.out_stream.last_timestamp,
+ printf("In TS: %d, dTS: %d, Seq: %d\n",
+ state.in_stream.last_timestamp,
+ state.in_stream.last_tsdelta,
+ state.in_stream.last_seq);
+
+ printf("Out TS change: %d, dTS: %d, Seq change: %d, "
+ "TS Err change: in %+d, out %+d\n",
+ state.out_stream.last_timestamp - last_timestamp,
state.out_stream.last_tsdelta,
- state.in_stream.err_ts_counter,
- state.out_stream.err_ts_counter);
+ state.out_stream.last_seq - last_seqno,
+ state.in_stream.err_ts_counter - last_in_ts_err_cnt,
+ state.out_stream.err_ts_counter - last_out_ts_err_cnt);
+
+ last_in_ts_err_cnt = state.in_stream.err_ts_counter;
+ last_out_ts_err_cnt = state.out_stream.err_ts_counter;
+ last_timestamp = state.out_stream.last_timestamp;
+ last_seqno = state.out_stream.last_seq;
}
}