aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/mgcp/mgcp_test.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-02-03 13:25:42 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-02-03 13:32:34 +0100
commitcdfc2061bb1e7c92d86eb48ddc81f4221ab70be3 (patch)
tree018eeb1810ba0732a3551a5b33aa18193424cad5 /openbsc/tests/mgcp/mgcp_test.c
parentba41978b9716db906f5696cd850d6a67667dd481 (diff)
mgcp: Round the frame time otherwise we have porting issues
With the current multiplication we might end up with 19999 as time on i386. When we round it ends up as 20000 on i386 and should work the same on AMD64.
Diffstat (limited to 'openbsc/tests/mgcp/mgcp_test.c')
-rw-r--r--openbsc/tests/mgcp/mgcp_test.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/openbsc/tests/mgcp/mgcp_test.c b/openbsc/tests/mgcp/mgcp_test.c
index fdb189006..498a1d8e6 100644
--- a/openbsc/tests/mgcp/mgcp_test.c
+++ b/openbsc/tests/mgcp/mgcp_test.c
@@ -28,6 +28,7 @@
#include <limits.h>
#include <dlfcn.h>
#include <time.h>
+#include <math.h>
char *strline_r(char *str, char **saveptr);
@@ -800,7 +801,7 @@ static void test_packet_error_detection(int patch_ssrc, int patch_ts)
for (i = 0; i < ARRAY_SIZE(test_rtp_packets1); ++i) {
struct rtp_packet_info *info = test_rtp_packets1 + i;
- force_monotonic_time_us = 1000000ULL * info->txtime;
+ force_monotonic_time_us = round(1000000.0 * info->txtime);
OSMO_ASSERT(info->len <= sizeof(buffer));
OSMO_ASSERT(info->len >= 0);