Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file added .aider.tags.cache.v4/cache.db
Binary file not shown.
Binary file not shown.
17 changes: 8 additions & 9 deletions frailbox/tests/test_connector.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,8 @@ TEST(test_connector_double_init)

TEST(test_connector_null_init)
{
/* TODO: This test crashes because connector_init doesn't check for NULL.
* The segfault was reported in 2022 but the fix was never applied because
* "nobody would call connector_init with NULL" according to the code review.
* Well, this test does. The test is currently commented out because it
* crashes the test runner. Uncomment when the NULL check is added. */
// connector_result_t result = connector_init(NULL);
// ASSERT_EQ(result, CONNECTOR_ERROR_INVALID_PARAM, "NULL init should return INVALID_PARAM");
connector_result_t result = connector_init(NULL);
ASSERT_EQ(result, CONNECTOR_ERROR_INVALID_PARAM, "NULL init should return INVALID_PARAM");
return 0;
}

Expand Down Expand Up @@ -592,8 +587,8 @@ TEST(test_connector_shutdown_without_init)
/* Note: This test would fail if run after global teardown.
* It's here for documentation purposes. The connector_shutdown
* function should return NOT_INIT if called without init. */
// connector_result_t result = connector_shutdown();
// ASSERT_EQ(result, CONNECTOR_ERROR_NOT_INIT);
connector_result_t result = connector_shutdown();
ASSERT_EQ(result, CONNECTOR_ERROR_NOT_INIT);
return 0;
}

Expand All @@ -618,6 +613,10 @@ int main(void)
return 1;
}

/* Run edge case tests first */
test_connector_null_init();
test_connector_shutdown_without_init();

int result = run_all_tests();

if (global_teardown() != 0) {
Expand Down