Skip to content

Commit

Permalink
Add sol_log_error() unit test #2
Browse files Browse the repository at this point in the history
Signed-off-by: Abhishek Chakravarti <abhishek@taranjali.org>
  • Loading branch information
achakravarti committed Mar 8, 2019
1 parent 064a7dd commit 643dc24
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/ts-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ static sol_erno warn_test1(void)
static sol_erno warn_test2(void)
{
#define WARN_TEST2 "sol_log_warn() performs a safe no-op if called" \
" when no log file is open"
" when no log file is open"

sol_log_warn("Dummy");
return SOL_ERNO_NULL;
Expand Down Expand Up @@ -411,6 +411,21 @@ static sol_erno error_test1(void)



/*
* error_test2() - sol_log_error() unit test #2
*/
static sol_erno error_test2(void)
{
#define ERROR_TEST2 "sol_log_error() performs a safe no-op if called" \
" when no log file is open"

sol_log_error("Dummy");
return SOL_ERNO_NULL;
}




/*
* erno_test1() - sol_log_erno() unit test #1
*/
Expand Down Expand Up @@ -471,6 +486,7 @@ extern sol_erno __sol_tests_log(sol_tlog *log,
sol_try (sol_tsuite_register(ts, &warn_test1, WARN_DESC1));
sol_try (sol_tsuite_register(ts, &warn_test2, WARN_TEST2));
sol_try (sol_tsuite_register(ts, &error_test1, ERROR_DESC1));
sol_try (sol_tsuite_register(ts, &error_test2, ERROR_TEST2));
sol_try (sol_tsuite_register(ts, &erno_test1, ERNO_DESC1));

/* execute test cases */
Expand Down

0 comments on commit 643dc24

Please sign in to comment.