Skip to content

Commit

Permalink
Revert "Disable unit test requiring isatty()"
Browse files Browse the repository at this point in the history
This reverts commit 06b2b06.
  • Loading branch information
marcransome committed Mar 29, 2024
1 parent 2b4f10c commit 38f4292
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/test_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,21 @@ static void flog_config_with_long_subsystem_option_and_no_subsystem_fails(void *
assert_int_equal(error, FLOG_ERROR_OPTS);
}

static void
flog_config_new_with_stdin_tty_and_no_message_args_fails(void **state) {
FlogError error = TEST_ERROR;
MOCK_ARGS(
TEST_PROGRAM_NAME,
TEST_OPTION_LEVEL_SHORT,
TEST_OPTION_LEVEL_VALUE_INFO
)

FlogConfig *config = flog_config_new(mock_argc, mock_argv, &error);

assert_null(config);
assert_int_equal(error, FLOG_ERROR_MSG);
}

static void
flog_config_new_with_message_succeeds(void **state) {
FlogError error = TEST_ERROR;
Expand Down Expand Up @@ -472,6 +487,7 @@ int main(void) {
cmocka_unit_test(flog_config_new_with_long_category_opt_and_no_subsystem_opt_fails),
cmocka_unit_test(flog_config_with_short_subsystem_option_and_no_subsystem_fails),
cmocka_unit_test(flog_config_with_long_subsystem_option_and_no_subsystem_fails),
cmocka_unit_test(flog_config_new_with_stdin_tty_and_no_message_args_fails),

// flog_config_new() success tests
cmocka_unit_test(flog_config_new_with_message_succeeds),
Expand Down

0 comments on commit 38f4292

Please sign in to comment.