mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
[Unit-tests] Report test failure details as they happen. Fix issue where fst_xcheck definition did not allow its use inside conditional statements.
This commit is contained in:
committed by
Andrey Volk
parent
e6cd6391ff
commit
451900b353
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user