]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Unit-tests] Report test failure details as they happen. Fix issue where fst_xcheck...
authorChris Rienzo <chris@signalwire.com>
Sun, 17 Jan 2021 19:41:10 +0000 (14:41 -0500)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:40 +0000 (22:00 +0300)
src/include/test/switch_fct.h
src/include/test/switch_test.h
tests/unit/switch_rtp.c

index f88821b49c055864dcf77d14f1dc9ccf06a5d877..8cb07cc20f7a8ef9731c9cc092aed485e5f366c6 100644 (file)
@@ -2858,6 +2858,10 @@ fct_standard_logger__on_chk(
     /* Only record failures. */
     if ( !fctchk__is_pass(e->chk) )
     {
+        printf("\nTEST FAIL: %s(%d): %s\n",
+            fctchk__file(e->chk),
+            fctchk__lineno(e->chk),
+            fctchk__msg(e->chk));
         fct_logger_record_failure(e->chk, &(logger->failed_cndtns_list));
     }
 }
index 7839a6c73652933bf0b2dd420e1b9629b7633a75..db5f4f7a7de93fc272263e9d2d0792d4e29ba7ed 100644 (file)
@@ -203,13 +203,13 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char
  * Check a test /w error message
  */
 #define fst_xcheck(expr, error_msg) \
-       fct_xchk(expr, "%s", error_msg);
+       (fct_xchk(expr, "%s", error_msg))
 
 /**
  * Fail a test
  */
 #define fst_fail(error_msg) \
-       fct_xchk(0, "%s", error_msg);
+       (fct_xchk(0, "%s", error_msg))
 
 /**
  * Check duration relative to test start, last marked time, or last check.
@@ -236,7 +236,7 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char
                (actual), \
                (expected), \
                (precision) \
-       );
+       )
 
 /**
  * Check if double-precision number is in range
@@ -248,7 +248,7 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char
                (actual), \
                (expected), \
                (precision) \
-       );
+       )
 
 /**
  * Run test without loading FS core
index 35de9d86301f01f88208c96d1544fe196c94358a..ebe307ad29801d4664f0d7afffbb561cbbf1db03 100644 (file)
@@ -63,7 +63,7 @@ FST_TEARDOWN_END()
                fst_requires(switch_rtp_ready(rtp_session));
                switch_rtp_activate_rtcp(rtp_session, 5, rx_port + 1, 0);
                switch_rtp_set_default_payload(rtp_session, TEST_PT);
-               fst_xcheck(switch_rtp_get_default_payload(rtp_session) == TEST_PT, "get Payload Type")
+               fst_xcheck(switch_rtp_get_default_payload(rtp_session) == TEST_PT, "get Payload Type");
                switch_rtp_set_ssrc(rtp_session, 0xabcd);
                switch_rtp_set_remote_ssrc(rtp_session, 0xcdef);
                fst_xcheck(switch_rtp_get_ssrc(rtp_session) == 0xabcd, "get SSRC");
@@ -105,9 +105,9 @@ FST_TEARDOWN_END()
                session = switch_rtp_get_core_session(rtp_session);
                fst_requires(session);
                status = switch_rtp_activate_jitter_buffer(rtp_session, 1, 10, 80, 8000);
-               fst_xcheck(status == SWITCH_STATUS_SUCCESS, "switch_rtp_activate_jitter_buffer()")
+               fst_xcheck(status == SWITCH_STATUS_SUCCESS, "switch_rtp_activate_jitter_buffer()");
                status = switch_rtp_debug_jitter_buffer(rtp_session, "debug");
-               fst_xcheck(status == SWITCH_STATUS_SUCCESS, "switch_rtp_debug_jitter_buffer()")
+               fst_xcheck(status == SWITCH_STATUS_SUCCESS, "switch_rtp_debug_jitter_buffer()");
                fst_requires(switch_rtp_get_jitter_buffer(rtp_session));
                status = switch_rtp_pause_jitter_buffer(rtp_session, SWITCH_TRUE);
                fst_xcheck(status == SWITCH_STATUS_SUCCESS, "switch_rtp_pause_jitter_buffer()");