TestFunction
TestFunction
Description
Function pointer type for test functions.
Success
Function returns true if test passed, false if failed.
Failure
Function cannot fail - always returns boolean result.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
TestRunner.c:26:
// Run a specific deadend test using setjmp/longjmp to capture aborts
bool test_deadend(TestFunction test_func, bool expect_failure) {
if (!test_func) {
WriteFmt("[ERROR] test_deadend: NULL test function provided\n");- In
TestRunner.c:74:
/// Run an array of simple tests
int simple_test_driver(TestFunction *tests, int count) {
if (!tests) {
WriteFmt("[ERROR] simple_test_driver: NULL tests array provided\n");- In
TestRunner.c:103:
/// Run an array of deadend tests (all expecting failure)
int deadend_test_driver(TestFunction *tests, int count) {
if (!tests) {
WriteFmt("[ERROR] deadend_test_driver: NULL tests array provided\n");- In
TestRunner.c:135:
/// Main test driver - handles everything: normal tests and deadend tests
int run_test_suite(
TestFunction *normal_tests,
int normal_count,
TestFunction *deadend_tests,- In
TestRunner.c:137:
TestFunction *normal_tests,
int normal_count,
TestFunction *deadend_tests,
int deadend_count,
const char *test_name- In
TestRunner.h:34:
/// TAGS: Testing, Deadend, Control
///
bool test_deadend(TestFunction test_func, bool expect_failure);
///
- In
TestRunner.h:47:
/// TAGS: Testing, Driver, Simple
///
int simple_test_driver(TestFunction *tests, int count);
///
- In
TestRunner.h:60:
/// TAGS: Testing, Driver, Deadend
///
int deadend_test_driver(TestFunction *tests, int count);
///
- In
TestRunner.h:77:
///
int run_test_suite(
TestFunction *normal_tests,
int normal_count,
TestFunction *deadend_tests,- In
TestRunner.h:79:
TestFunction *normal_tests,
int normal_count,
TestFunction *deadend_tests,
int deadend_count,
const char *test_name- In
Parse.c:147:
int main(void) {
TestFunction tests[] = {
test_kvconfig_basic_parse,
test_kvconfig_comments_quotes_and_duplicates, int main(int argc, char *argv[]) {
// Array of test functions
TestFunction tests[] = {
test_two_level_nesting_writing,
test_three_level_nesting_writing, int main(int argc, char *argv[]) {
// Array of test functions
TestFunction tests[] = {
test_simple_string_parsing,
test_simple_numbers, int main(int argc, char *argv[]) {
// Array of test functions
TestFunction tests[] = {
test_basic_iterator_functionality,
test_simple_json_object, int main(int argc, char *argv[]) {
// Array of test functions
TestFunction tests[] = {
test_empty_object_writing,
test_empty_array_writing, int main(int argc, char *argv[]) {
// Array of test functions
TestFunction tests[] = {
test_simple_string_writing,
test_simple_numbers_writing,- In
RoundTrip.c:780:
int main(int argc, char *argv[]) {
// Array of test functions
TestFunction tests[] = {
test_simple_roundtrip,
test_numeric_roundtrip, int main(int argc, char *argv[]) {
// Array of test functions
TestFunction tests[] = {
test_empty_object_reading,
test_empty_array_reading,
// Deadend tests that would cause program termination
TestFunction deadend_tests[] = {
test_bitvec_find_pattern_null_source, test_bitvec_find_pattern_null_pattern,
test_bitvec_find_last_pattern_null_source, test_bitvec_find_last_pattern_null_pattern,- In
Map.Type.c:114:
int main(void) {
TestFunction tests[] = {
test_map_type_defaults,
test_map_type_with_value_compare,- In
Str.Insert.c:332:
// Array of test functions
TestFunction tests[] = {
test_str_insert_char_at,
test_str_insert_cstr,- In
Float.Math.c:393:
WriteFmt("[INFO] Starting Float.Math tests\n\n");
TestFunction tests[] = {
test_float_negate_abs,
test_float_add_small_small,- In
Float.Math.c:409:
};
TestFunction deadend_tests[] = {
test_float_div_by_zero,
};- In
Vec.Ops.c:159:
// Array of test functions
TestFunction tests[] = {test_vec_swap_items, test_vec_reverse, test_vec_sort};
int total_tests = sizeof(tests) / sizeof(tests[0]);- In
Vec.Access.c:236:
// Array of test functions
TestFunction tests[] = {
test_vec_at,
test_vec_ptr_at, WriteFmt("[INFO] Starting Int.Convert tests\n\n");
TestFunction tests[] = {
test_int_from_unsigned_integer,
test_int_bytes_le_round_trip, };
TestFunction deadend_tests[] = {
test_int_from_binary_invalid_digit,
test_int_from_decimal_invalid_digit,- In
Map.Remove.c:121:
int main(void) {
TestFunction tests[] = {
test_map_remove_value,
test_map_remove_pair,- In
Int.Compare.c:80:
WriteFmt("[INFO] Starting Int.Compare tests\n\n");
TestFunction tests[] = {
test_int_compare,
test_int_compare_wrappers,- In
Io.Read.c:978:
// Array of test functions
TestFunction tests[] = {
test_integer_decimal_reading,
test_integer_hex_reading,- In
Map.Foreach.c:80:
int main(void) {
TestFunction tests[] = {
test_map_foreach_ptr,
test_map_foreach_multimap_iterators,
// Array of test functions
TestFunction tests[] = {
test_bitvec_get,
test_bitvec_set,
// Array of normal test functions
TestFunction tests[] = {
test_bitvec_foreach_idx,
test_bitvec_foreach,
// Array of deadend test functions
TestFunction deadend_tests[] = {
test_bitvec_foreach_invalid_usage,
test_bitvec_run_lengths_null_bv,- In
Vec.Remove.c:826:
int main(int argc, char *argv[]) {
// Array of normal test functions
TestFunction normal_tests[] = {
test_vec_pop_back,
test_vec_pop_front,- In
Map.Insert.c:99:
int main(void) {
TestFunction tests[] = {
test_map_insert_and_set,
test_map_set_first, WriteFmt("[INFO] Starting Float.Compare tests\n\n");
TestFunction tests[] = {
test_float_compare_small_small,
test_float_compare_very_large_large,- In
Str.Type.c:152:
// Array of normal test functions
TestFunction tests[] = {test_str_type, test_strs_type, test_validate_str, test_validate_strs};
// Array of deadend test functions (tests that should crash/abort)
- In
Str.Type.c:155:
// Array of deadend test functions (tests that should crash/abort)
TestFunction deadend_tests[] = {test_validate_invalid_str, test_validate_invalid_strs};
int total_tests = sizeof(tests) / sizeof(tests[0]);
// Deadend tests that would cause program termination
TestFunction deadend_tests[] = {
test_bitvec_find_deadend_tests,
test_bitvec_predicate_deadend_tests,- In
Io.Write.c:719:
// Array of test functions
TestFunction tests[] = {
test_basic_formatting,
test_string_formatting,
// Array of normal test functions
TestFunction tests[] = {
test_str_foreach_idx,
test_str_foreach_reverse_idx,- In
Vec.Memory.c:184:
// Array of test functions
TestFunction tests[] = {test_vec_try_reduce_space, test_vec_resize, test_vec_reserve, test_vec_clear};
int total_tests = sizeof(tests) / sizeof(tests[0]);- In
Vec.Init.c:257:
// Array of test functions
TestFunction tests[] = {
test_vec_init_basic,
test_vec_init_aligned,
// Array of normal test functions
TestFunction tests[] = {
test_str_from_u64,
test_str_from_i64,
// Array of deadend test functions
TestFunction deadend_tests[] = {
test_str_conversion_null_failures,
test_str_conversion_bounds_failures,
// Array of normal test functions
TestFunction tests[] = {
test_bitvec_foreach_idx,
test_bitvec_foreach,
// Array of normal test functions
TestFunction tests[] = {
test_bitvec_pop,
test_bitvec_remove_single,
// Array of deadend test functions
TestFunction deadend_tests[] = {
test_bitvec_remove_null_failures,
test_bitvec_remove_range_null_failures,
// Array of normal test functions
TestFunction tests[] = {
test_bitvec_hamming_distance_basic,
test_bitvec_hamming_distance_edge_cases,
// Array of deadend test functions
TestFunction deadend_tests[] = {
test_bitvec_hamming_distance_null_bv1,
test_bitvec_hamming_distance_null_bv2,
// Array of normal test functions
TestFunction tests[] = {
test_bitvec_equals,
test_bitvec_compare,
// Array of deadend test functions
TestFunction deadend_tests[] = {
test_bitvec_compare_null_failures,
test_bitvec_subset_null_failures,
// Array of normal test functions
TestFunction tests[] = {
test_bitvec_init,
test_bitvec_deinit,
// Array of deadend test functions (expected failure scenarios)
TestFunction deadend_tests[] = {
test_bitvec_null_pointer_failures,
test_bitvec_invalid_operations,- In
Str.Memory.c:188:
// Array of test functions
TestFunction tests[] = {
test_str_try_reduce_space,
test_str_swap_char_at,
// Array of deadend test functions
TestFunction deadend_tests[] = {
test_bitvec_bitwise_null_failures,
test_bitvec_bitwise_ops_null_failures,
// Array of normal test functions
TestFunction tests[] = {
test_bitvec_shift_left,
test_bitvec_shift_right,- In
Vec.Type.c:74:
// Array of test functions
TestFunction tests[] = {test_vec_type_basic, test_vec_validate};
int total_tests = sizeof(tests) / sizeof(tests[0]);- In
Int.Access.c:159:
WriteFmt("[INFO] Starting Int.Access tests\n\n");
TestFunction tests[] = {
test_int_bit_length,
test_int_byte_length,- In
Int.Access.c:171:
};
TestFunction deadend_tests[] = {
test_int_log2_zero,
};- In
Map.Ops.c:176:
int main(void) {
TestFunction tests[] = {
test_map_deep_copy_zstrs,
test_map_policy_switch_preserves_entries,- In
BitVec.Type.c:54:
// Array of test functions
TestFunction tests[] = {test_bitvec_type_basic, test_bitvec_validate};
int total_tests = sizeof(tests) / sizeof(tests[0]);
// Array of deadend test functions
TestFunction deadend_tests[] = {
test_bitvec_foreach_invalid_usage,
test_bitvec_run_lengths_null_bv,- In
Str.Ops.c:252:
// Array of test functions
TestFunction tests[] =
{test_str_cmp, test_str_find, test_str_starts_ends_with, test_str_replace, test_str_split, test_str_strip};
// Array of normal test functions
TestFunction tests[] = {
test_vec_foreach,
test_vec_foreach_idx,
// Array of normal test functions
TestFunction tests[] = {
test_bitvec_shrink_to_fit,
test_bitvec_set_capacity,
// Array of deadend test functions
TestFunction deadend_tests[] = {
test_bitvec_memory_null_failures,
test_bitvec_swap_null_failures,
// Array of normal test functions
TestFunction tests[] = {
test_bitvec_to_string,
test_bitvec_from_string,
// Array of deadend test functions
TestFunction deadend_tests[] = {
test_bitvec_convert_null_failures,
test_bitvec_from_string_null_failures,- In
Map.Init.c:121:
int main(void) {
TestFunction tests[] = {
test_map_reserve_and_clear,
test_map_rehash_policy_switch,
// Array of normal test functions
TestFunction tests[] = {
test_bitvec_shift_left,
test_bitvec_shift_right,
// Array of deadend test functions
TestFunction deadend_tests[] = {
test_bitvec_bitwise_null_failures,
test_bitvec_bitwise_ops_null_failures,
// Array of test functions
TestFunction tests[] = {
test_complex_vec_init,
test_complex_vec_push,
// Array of normal test functions
TestFunction tests[] = {
test_bitvec_insert_range,
test_bitvec_insert_multiple,
// Array of deadend test functions
TestFunction deadend_tests[] = {
test_bitvec_insert_null_failures,
test_bitvec_insert_invalid_range_failures,- In
Str.Access.c:132:
// Array of test functions
TestFunction tests[] =
{test_str_first, test_str_last, test_str_begin, test_str_end, test_str_char_at, test_str_char_ptr_at};
// Array of test functions (adding new tests to existing ones)
TestFunction tests[] = {
test_bitvec_get,
test_bitvec_set,
// Deadend tests that would cause program termination
TestFunction deadend_tests[] = {
test_bitvec_find_deadend_tests,
test_bitvec_predicate_deadend_tests, WriteFmt("[INFO] Starting Float.Convert tests\n\n");
TestFunction tests[] = {
test_float_from_unsigned_integer,
test_float_from_signed_integer, };
TestFunction deadend_tests[] = {
test_float_from_str_invalid,
test_float_from_str_null,- In
Int.Math.c:930:
WriteFmt("[INFO] Starting Int.Math tests\n\n");
TestFunction tests[] = {
test_int_shift_left_grows,
test_int_shift_right_shrinks,- In
Int.Math.c:975:
};
TestFunction deadend_tests[] = {
test_int_add_null_result,
test_int_shift_left_null, WriteFmt("[INFO] Starting Float.Access tests\n\n");
TestFunction tests[] = {
test_float_is_zero,
test_float_is_negative,- In
Float.Type.c:63:
WriteFmt("[INFO] Starting Float.Type tests\n\n");
TestFunction tests[] = {
test_float_init,
test_float_clear,
// Array of test functions
TestFunction tests[] = {
test_bitvec_basic_pattern_functions,
test_bitvec_find_pattern,
// Deadend tests that would cause program termination
TestFunction deadend_tests[] = {
test_bitvec_find_pattern_null_source,
test_bitvec_find_pattern_null_pattern,- In
Int.Type.c:60:
WriteFmt("[INFO] Starting Int.Type tests\n\n");
TestFunction tests[] = {
test_int_init,
test_int_clear,
// Array of test functions
TestFunction tests[] = {
test_bitvec_basic_pattern_functions, test_bitvec_find_pattern, test_bitvec_find_last_pattern,
test_bitvec_find_all_pattern, test_bitvec_pattern_edge_cases, test_bitvec_pattern_stress_tests,- In
Str.Init.c:208:
// Array of test functions
TestFunction tests[] = {
test_str_init,
test_str_init_from_cstr,- In
Vec.Insert.c:471:
// Array of test functions
TestFunction tests[] = {
test_vec_push_back,
test_vec_push_front,- In
Map.Access.c:92:
int main(void) {
TestFunction tests[] = {
test_map_contains_and_find,
test_map_get_ptr,- In
Str.Remove.c:189:
// Array of test functions
TestFunction tests[] = {
test_str_pop_back,
test_str_pop_front,
Last updated on