From ac194ae7b170d98c0a5d622cdff97d1b5c5709ed Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 6 Mar 2018 22:24:07 +0100 Subject: [PATCH 1/2] fix warning in timeout test --- lib/test/common/timeout_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test/common/timeout_test.cc b/lib/test/common/timeout_test.cc index c2451cdb0..4bde95f66 100644 --- a/lib/test/common/timeout_test.cc +++ b/lib/test/common/timeout_test.cc @@ -89,7 +89,7 @@ int timer_thread_test() printf("Target duration: %dms, started: %ld:%ld, ended: %ld:%ld, actual duration %dms\n", duration_msec, c.start_time[1].tv_sec, c.start_time[1].tv_usec, c.start_time[2].tv_sec, c.start_time[2].tv_usec, diff_ms); - result = (duration_msec - result_tolerance <= diff_ms < duration_msec + result_tolerance); + result = ((duration_msec - result_tolerance) < diff_ms || diff_ms < (duration_msec + result_tolerance)); if(result) { printf("Timer thread test passed\n"); From ac0f9345582539cfe14f3cd2601c9f055135962d Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 6 Mar 2018 22:33:57 +0100 Subject: [PATCH 2/2] fix leaks in viterbi and modem tests --- lib/src/phy/fec/test/viterbi_test.c | 1 + lib/src/phy/modem/test/modem_test.c | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/src/phy/fec/test/viterbi_test.c b/lib/src/phy/fec/test/viterbi_test.c index 28c60bce6..e4cf6f312 100644 --- a/lib/src/phy/fec/test/viterbi_test.c +++ b/lib/src/phy/fec/test/viterbi_test.c @@ -279,6 +279,7 @@ int main(int argc, char **argv) { free(llr); free(llr_c); free(data_rx); + free(data_rx2); if (snr_points == 1) { int expected_errors = get_expected_errors(nof_frames, seed, frame_length, tail_biting, ebno_db); diff --git a/lib/src/phy/modem/test/modem_test.c b/lib/src/phy/modem/test/modem_test.c index 600115386..ed9bef522 100644 --- a/lib/src/phy/modem/test/modem_test.c +++ b/lib/src/phy/modem/test/modem_test.c @@ -197,6 +197,7 @@ int main(int argc, char **argv) { } } + free(llr2); free(llr); free(symbols); free(symbols_bytes);