From 0169971a59e9822c094e82f3e4a28f2763ea0f34 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 5 Sep 2014 12:23:36 +0200 Subject: [PATCH] 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. --- openbsc/tests/mgcp/mgcp_transcoding_test.c | 3 +++ 1 file changed, 3 insertions(+) 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);