From f468e720ad7f564ca9e8d4c02848026fa1100e3d Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 7 Jul 2016 14:13:16 +0200 Subject: osmux-test: remove real-time constraint by default Introduce a local #define to disable the real-time constraint from osmux-test. It would make sense to remove this completely, but in case anyone may be interested in the timing on a specific platform, I've just #defined it away. The real-time constraint to pass or fail the test is a bad idea in terms of our build server. Whenever the server is loaded, the tests will fail for no reason, like here: https://gerrit.osmocom.org/474 The real time to calculate is highly dependent also on the hardware platform. The arbitrarity of the time constraint is sort of proven by dd24cdd95f3fb8c8f which simply doubles the time to pass the test. Change-Id: Ic1da4bd22411652334f73195b2e37853e0738906 --- tests/osmux/osmux_test.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/osmux/osmux_test.c b/tests/osmux/osmux_test.c index 6fb4dad..2f5a6cd 100644 --- a/tests/osmux/osmux_test.c +++ b/tests/osmux/osmux_test.c @@ -8,6 +8,8 @@ * (at your option) any later version. */ +#define OSMUX_TEST_USE_TIMING 0 + #include #include #include @@ -15,7 +17,9 @@ #include #include #include +#if OSMUX_TEST_USE_TIMING #include +#endif #include #include @@ -51,11 +55,14 @@ static uint8_t rtp_pkt[] = { }; static int rtp_pkts; +#if OSMUX_TEST_USE_TIMING static struct timeval last; +#endif static void tx_cb(struct msgb *msg, void *data) { char buf[4096]; +#if OSMUX_TEST_USE_TIMING struct timeval now, diff; gettimeofday(&now, NULL); @@ -68,6 +75,7 @@ static void tx_cb(struct msgb *msg, void *data) (unsigned int)diff.tv_usec); exit(EXIT_FAILURE); } +#endif osmo_rtp_snprintf(buf, sizeof(buf), msg); fprintf(stderr, "extracted packet: %s\n", buf); @@ -149,7 +157,9 @@ static void osmux_test_loop(int ccid) osmux_xfrm_input(&h_input, msg, (i % 2) + ccid); if (i % 4 == 0) { +#if OSMUX_TEST_USE_TIMING gettimeofday(&last, NULL); +#endif /* After four RTP messages, squash them into the OSMUX * batch and call the routine to deliver it. -- cgit v1.2.3