summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-09-05 12:23:36 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-09-05 12:25:32 +0200
commit0169971a59e9822c094e82f3e4a28f2763ea0f34 (patch)
tree3c835b1a24fc341cb930aaa857d58870c8ca353b
parent0454e32861b7e5b5d00b721d5dd8df3df46eb097 (diff)
mgcp: Re-load the state after the transcoding change
Jacob ran the tests with ASAN and noticed that the state is dead. This is on purpose as we have forced a change in the transcoding. Re-load the state and verify that it has not changed in the other cases.
-rw-r--r--openbsc/tests/mgcp/mgcp_transcoding_test.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.c b/openbsc/tests/mgcp/mgcp_transcoding_test.c
index 1dbdb51f9..747fd9af4 100644
--- a/openbsc/tests/mgcp/mgcp_transcoding_test.c
+++ b/openbsc/tests/mgcp/mgcp_transcoding_test.c
@@ -465,6 +465,7 @@ static void test_transcode_change(void)
len = audio_packets_pcma[0].len;
memcpy(buf, audio_packets_pcma[0].data, len);
res = mgcp_transcoding_process_rtp(endp, &endp->bts_end, buf, &len, ARRAY_SIZE(buf));
+ state = endp->bts_end.rtp_process_data;
OSMO_ASSERT(res == sizeof(struct rtp_hdr));
OSMO_ASSERT(state->sample_cnt == 0);
OSMO_ASSERT(state->src_fmt == AF_PCMA);
@@ -475,6 +476,7 @@ static void test_transcode_change(void)
len = res;
res = mgcp_transcoding_process_rtp(endp, &endp->bts_end, buf, &len, ARRAY_SIZE(buf));
OSMO_ASSERT(res == -ENOMSG);
+ OSMO_ASSERT(state == endp->bts_end.rtp_process_data);
/* now check that comfort noise doesn't change anything */
@@ -483,6 +485,7 @@ static void test_transcode_change(void)
hdr = (struct rtp_hdr *) buf;
hdr->payload_type = 12;
res = mgcp_transcoding_process_rtp(endp, &endp->bts_end, buf, &len, ARRAY_SIZE(buf));
+ OSMO_ASSERT(state == endp->bts_end.rtp_process_data);
OSMO_ASSERT(state->sample_cnt == 80);
OSMO_ASSERT(state->src_fmt == AF_PCMA);
OSMO_ASSERT(state->dst_fmt == AF_GSM);