diff --git a/src/torture/torture.h b/src/torture/torture.h index 161f1024..d3c2718c 100644 --- a/src/torture/torture.h +++ b/src/torture/torture.h @@ -48,17 +48,17 @@ extern T_Test g_torture_tests[0xffffff]; } #if COMPILER_MSVC -#pragma section(".CRT$XCU", read) -# define T_BeginTest_(name) \ +# pragma section(".CRT$XCU", read) +# define TEST_(name) \ T_AddTest(name, __LINE__) \ __declspec(allocate(".CRT$XCU")) void(*r_##name)(void) = t_add_test_##name; \ __pragma(comment(linker, "/include:" Stringify(r_##name))) #else -# define T_BeginTest_(name) T_AddTest(name, __LINE__, __attribute__((constructor))) +# define TEST_(name) T_AddTest(name, __LINE__, __attribute__((constructor))) #endif -#define T_BeginTest(name) \ - T_BeginTest_(name) \ +#define TEST(name) \ + TEST_(name) \ T_RunSig(name) #define T_Ok(c) do { if (!(c)) { result_out->fail_file = __FILE__; result_out->fail_line = __LINE__; result_out->fail_cond = Stringify(c); result_out->status = T_RunStatus_Fail; return; } } while(0) diff --git a/src/torture/torture_base.c b/src/torture/torture_base.c index ba8e46d4..a79a57f9 100644 --- a/src/torture/torture_base.c +++ b/src/torture/torture_base.c @@ -3,7 +3,7 @@ #define T_Group "Base" -T_BeginTest(str8_list_substr) +TEST(str8_list_substr) { String8List zero_list = {0}; @@ -69,7 +69,7 @@ T_BeginTest(str8_list_substr) } } -T_BeginTest(bit_array) +TEST(bit_array) { for (U64 start=0; start<32*3; start++) { for (U64 end=start; end<32*3; end++) { diff --git a/src/torture/torture_d2r.c b/src/torture/torture_d2r.c index 88ec815f..eadda433 100644 --- a/src/torture/torture_d2r.c +++ b/src/torture/torture_d2r.c @@ -57,14 +57,14 @@ d2rt_type_from_name(RDI_Parsed *rdi, RDI_ParsedNameMap *map, char *name) return 0; } -T_BeginTest(d2r_types) +TEST(d2r_types) { DW_Writer *writer = dw_writer_begin(DW_Format_32Bit, DW_Version_5, DW_CompUnitKind_Compile, Arch_x64); { dw_writer_tag_begin(writer, DW_TagKind_CompileUnit); dw_writer_push_attrib_stringf(writer, DW_AttribKind_Producer, "Test"); -#define DeclBaseType(tt, n, e, s) \ +#define DeclBaseType(tt, n, e, s) \ DW_WriterTag *tt = dw_writer_tag_begin(writer, DW_TagKind_BaseType); \ dw_writer_push_attrib_sint(writer, DW_AttribKind_ByteSize, s); \ dw_writer_push_attrib_enum(writer, DW_AttribKind_Encoding, DW_ATE_##e); \ @@ -104,8 +104,8 @@ dw_writer_tag_end(writer); DeclBaseType(decimal128_type, "_Decimal128", DecimalFloat, 16); #undef DeclBaseType -#define DeclStdint(n, a) \ -do { \ +#define DeclStdint(n, a) \ +do { \ dw_writer_tag_begin(writer, DW_TagKind_Typedef); \ dw_writer_push_attrib_stringf(writer, DW_AttribKind_Name, n); \ dw_writer_push_attrib_ref(writer, DW_AttribKind_Type, a); \ @@ -147,8 +147,8 @@ dw_writer_tag_end(writer); \ RDI_ParsedNameMap types_map = {0}; rdi_parsed_from_name_map(rdi, types_nm, &types_map); -#define TestBuiltinType(n, bs, r) \ -do { \ +#define TestBuiltinType(n, bs, r) \ +do { \ RDI_TypeNode *alias = d2rt_type_from_name(rdi, &types_map, n); \ T_Ok(alias); \ T_Ok(alias->kind == RDI_TypeKind_Alias); \ @@ -194,8 +194,8 @@ T_Ok(str8_match(str8_from_rdi_string_idx(rdi, type->built_in.name_string_idx), s TestBuiltinType("_Decimal128", 16, Decimal128); #undef TestBuiltinType -#define TestStdint(n, s, t) \ -do { \ +#define TestStdint(n, s, t) \ +do { \ RDI_TypeNode *td = d2rt_type_from_name(rdi, &types_map, n); \ T_Ok(td); \ T_Ok(td->kind == RDI_TypeKind_Alias); \ @@ -221,7 +221,7 @@ T_Ok(str8_match(str8_from_rdi_string_idx(rdi, type->built_in.name_string_idx), s dw_writer_end(&writer); } -T_BeginTest(d2r_line_table) +TEST(d2r_line_table) { DW_Writer *writer = dw_writer_begin(DW_Format_32Bit, DW_Version_5, DW_CompUnitKind_Compile, Arch_x64); String8 comp_dir = str8_lit("c:/DEVEL/"); @@ -282,7 +282,7 @@ T_BeginTest(d2r_line_table) dw_writer_end(&writer); } -T_BeginTest(d2r_checksums) +TEST(d2r_checksums) { DW_Writer *writer = dw_writer_begin(DW_Format_32Bit, DW_Version_5, DW_CompUnitKind_Compile, Arch_x64); @@ -318,7 +318,7 @@ T_BeginTest(d2r_checksums) } #if SUBPROGRAM_CONVERSION_TEST -T_BeginTest(d2r_subprogram) +TEST(d2r_subprogram) { DW_Writer *writer = dw_writer_begin(DW_Format_32Bit, DW_Version_5, DW_CompUnitKind_Compile, Arch_x64); @@ -438,7 +438,7 @@ T_BeginTest(d2r_subprogram) } #endif -T_BeginTest(d2r_general) +TEST(d2r_general) { DW_Writer *writer = dw_writer_begin(DW_Format_32Bit, DW_Version_5, DW_CompUnitKind_Compile, Arch_x64); { diff --git a/src/torture/torture_dwarf.c b/src/torture/torture_dwarf.c index 00aa9999..0cf63150 100644 --- a/src/torture/torture_dwarf.c +++ b/src/torture/torture_dwarf.c @@ -45,7 +45,7 @@ t_dw_test_sleb128(U64 v, U64 expected_length) return is_ok; } -T_BeginTest(test_leb128) +TEST(test_leb128) { T_Ok(t_dw_test_uleb128(0, 1)); T_Ok(t_dw_test_sleb128(0, 1)); @@ -134,7 +134,7 @@ dw_input_from_writer(Arena *arena, DW_Writer *writer) return input; } -T_BeginTest(dwarf_32bit) +TEST(dwarf_32bit) { DW_Writer *writer = dw_writer_begin(DW_Format_32Bit, DW_Version_5, DW_CompUnitKind_Compile, Arch_x64); dw_writer_tag_begin(writer, DW_TagKind_CompileUnit); @@ -162,7 +162,7 @@ T_BeginTest(dwarf_32bit) dw_writer_end(&writer); } -T_BeginTest(dwarf_64bit) +TEST(dwarf_64bit) { DW_Writer *writer = dw_writer_begin(DW_Format_64Bit, DW_Version_5, DW_CompUnitKind_Compile, Arch_x64); dw_writer_tag_begin(writer, DW_TagKind_CompileUnit); @@ -190,7 +190,7 @@ T_BeginTest(dwarf_64bit) dw_writer_end(&writer); } -T_BeginTest(dwarf_line_opcodes) +TEST(dwarf_line_opcodes) { DW_Writer *writer = dw_writer_begin(DW_Format_32Bit, DW_Version_5, DW_CompUnitKind_Compile, Arch_x64); String8 comp_dir = str8_lit("c:/devel/"); @@ -359,7 +359,7 @@ T_BeginTest(dwarf_line_opcodes) dw_writer_end(&writer); } -T_BeginTest(dwarf_line_emit) +TEST(dwarf_line_emit) { DW_Writer *writer = dw_writer_begin(DW_Format_32Bit, DW_Version_5, DW_CompUnitKind_Compile, Arch_x64); String8 comp_dir = str8_lit("c:/devel/"); @@ -559,7 +559,7 @@ T_BeginTest(dwarf_line_emit) } } -T_BeginTest(dwarf_writer) +TEST(dwarf_writer) { DW_Writer *writer = dw_writer_begin(DW_Format_32Bit, DW_Version_5, DW_CompUnitKind_Compile, Arch_x64); // info @@ -859,7 +859,7 @@ T_BeginTest(dwarf_writer) dw_writer_end(&writer); } -T_BeginTest(value_in_register) +TEST(value_in_register) { // setup register context REGS_RegBlockX64 regs = {0}; @@ -883,7 +883,7 @@ T_BeginTest(value_in_register) T_Ok(expr_value.u64 == value); } -T_BeginTest(value_in_x_register) +TEST(value_in_x_register) { // setup register context REGS_RegBlockX64 regs = {0}; @@ -907,7 +907,7 @@ T_BeginTest(value_in_x_register) T_Ok(expr_value.u64 == value); } -T_BeginTest(address_of_value) +TEST(address_of_value) { // compile a simple program which reads address U64 addr = 0xdeadbeef; @@ -925,7 +925,7 @@ T_BeginTest(address_of_value) T_Ok(expr_value.addr == addr); } -T_BeginTest(register_relative_variable) +TEST(register_relative_variable) { // setup register context REGS_RegBlockX64 regs = {0}; @@ -947,7 +947,7 @@ T_BeginTest(register_relative_variable) T_Ok(expr_value.addr == (1 + 44)); } -T_BeginTest(frame_relative_variable) +TEST(frame_relative_variable) { DW_ExprEnc expr_encs[] = { DW_ExprEnc_Op(FBReg), DW_ExprEnc_SLEB128(-50) }; String8 expr_data = dw_encode_expr(arena, Arch_x64, DW_Format_64Bit, expr_encs, ArrayCount(expr_encs)); @@ -969,7 +969,7 @@ MACHINE_OP_MEM_READ(t_machine_op_mem_read) return MachineOpResult_Ok; } -T_BeginTest(call_by_reference) +TEST(call_by_reference) { U8 *memory = push_array(arena, U8, 128); U64 value = 0xc0ffee; @@ -993,7 +993,7 @@ T_BeginTest(call_by_reference) T_Ok(*(U64 *)expr_value.generic.str == value); } -T_BeginTest(plus_uconst) +TEST(plus_uconst) { U64 struct_addr = 0x123; DW_ExprEnc expr_encs[] = { DW_ExprEnc_Op(Addr), DW_ExprEnc_Addr(struct_addr), DW_ExprEnc_Op(PlusUConst), DW_ExprEnc_ULEB128(4) }; @@ -1008,7 +1008,7 @@ T_BeginTest(plus_uconst) } #if 0 -T_BeginTest(reg_split_spill) +TEST(reg_split_spill) { // setup register context REGS_RegBlockX64 regs = {0}; diff --git a/src/torture/torture_eval.c b/src/torture/torture_eval.c index da461a9e..617974b7 100644 --- a/src/torture/torture_eval.c +++ b/src/torture/torture_eval.c @@ -1,6 +1,6 @@ #define T_Group "eval" -T_BeginTest(eval_compiler_basics) +TEST(eval_compiler_basics) { E_Cache *eval_cache = e_cache_alloc(); e_select_cache(eval_cache); diff --git a/src/torture/torture_p2r.c b/src/torture/torture_p2r.c index 9fb67705..17f76c5e 100644 --- a/src/torture/torture_p2r.c +++ b/src/torture/torture_p2r.c @@ -4,7 +4,7 @@ // TODO: location is not baked consistently #if !COMPILER_CLANG || (COMPILER_CLANG && BUILD_DEBUG) -T_BeginTest(p2r_determ) +TEST(p2r_determ) { U64 num_repeats_per_pdb = 32; String8 pdb_paths[] = diff --git a/src/torture/torture_radlink.c b/src/torture/torture_radlink.c index ab332910..9ff94e09 100644 --- a/src/torture/torture_radlink.c +++ b/src/torture/torture_radlink.c @@ -82,7 +82,7 @@ t_write_entry_obj(void) #define T_Group "Linker" -T_BeginTest(machine_compat_check) +TEST(machine_compat_check) { // unknown.obj { @@ -134,7 +134,7 @@ T_BeginTest(machine_compat_check) T_Ok(g_last_exit_code != 0); } -T_BeginTest(simple_link_test) +TEST(simple_link_test) { U8 text_payload[] = { 0xC3 }; @@ -213,7 +213,7 @@ T_BeginTest(simple_link_test) } -T_BeginTest(out_of_bounds_section_number) +TEST(out_of_bounds_section_number) { // bad.obj { @@ -254,7 +254,7 @@ T_BeginTest(out_of_bounds_section_number) } -T_BeginTest(merge) +TEST(merge) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -336,7 +336,7 @@ T_BeginTest(merge) } } -T_BeginTest(link_undef) +TEST(link_undef) { String8 undef_obj; { @@ -369,7 +369,7 @@ T_BeginTest(link_undef) T_Ok(g_last_exit_code == LNK_Error_UnresolvedSymbol); } -T_BeginTest(link_unref_undef) +TEST(link_unref_undef) { String8 undef_obj; { @@ -397,7 +397,7 @@ T_BeginTest(link_unref_undef) T_Ok(g_last_exit_code != 0); } -T_BeginTest(weak_lib_vs_weak_lib) +TEST(weak_lib_vs_weak_lib) { String8 a_obj; { @@ -462,7 +462,7 @@ T_BeginTest(weak_lib_vs_weak_lib) } } -T_BeginTest(weak_lib_vs_weak_nolib) +TEST(weak_lib_vs_weak_nolib) { String8 a_obj; { @@ -510,7 +510,7 @@ T_BeginTest(weak_lib_vs_weak_nolib) } } -T_BeginTest(weak_lib_vs_weak_alias) +TEST(weak_lib_vs_weak_alias) { String8 a_obj; { @@ -545,7 +545,7 @@ T_BeginTest(weak_lib_vs_weak_alias) T_Ok(g_last_exit_code == LNK_Error_MultiplyDefinedSymbol); } -T_BeginTest(weak_lib_vs_weak_antidep) +TEST(weak_lib_vs_weak_antidep) { String8 a_obj; { @@ -593,7 +593,7 @@ T_BeginTest(weak_lib_vs_weak_antidep) } } -T_BeginTest(weak_alias_vs_weak_alias) +TEST(weak_alias_vs_weak_alias) { String8 a; { @@ -636,7 +636,7 @@ T_BeginTest(weak_alias_vs_weak_alias) T_Ok(g_last_exit_code == LNK_Error_MultiplyDefinedSymbol); } -T_BeginTest(weak_alias_vs_weak_lib) +TEST(weak_alias_vs_weak_lib) { String8 a_obj; { @@ -684,7 +684,7 @@ T_BeginTest(weak_alias_vs_weak_lib) } } -T_BeginTest(weak_alias_vs_weak_nolib) +TEST(weak_alias_vs_weak_nolib) { String8 a_obj; { @@ -732,7 +732,7 @@ T_BeginTest(weak_alias_vs_weak_nolib) } } -T_BeginTest(weak_alias_vs_weak_antidep) +TEST(weak_alias_vs_weak_antidep) { String8 a_obj; { @@ -780,7 +780,7 @@ T_BeginTest(weak_alias_vs_weak_antidep) } } -T_BeginTest(weak_nolib_vs_weak_nolib) +TEST(weak_nolib_vs_weak_nolib) { String8 a_obj; { @@ -827,7 +827,7 @@ T_BeginTest(weak_nolib_vs_weak_nolib) } } -T_BeginTest(weak_nolib_vs_weak_lib) +TEST(weak_nolib_vs_weak_lib) { String8 a_obj; { @@ -874,7 +874,7 @@ T_BeginTest(weak_nolib_vs_weak_lib) } } -T_BeginTest(weak_nolib_vs_weak_alias) +TEST(weak_nolib_vs_weak_alias) { String8 a_obj; { @@ -908,7 +908,7 @@ T_BeginTest(weak_nolib_vs_weak_alias) T_Ok(g_last_exit_code == LNK_Error_MultiplyDefinedSymbol); } -T_BeginTest(weak_nolib_vs_weak_antidep) +TEST(weak_nolib_vs_weak_antidep) { String8 a_obj; { @@ -955,7 +955,7 @@ T_BeginTest(weak_nolib_vs_weak_antidep) } } -T_BeginTest(weak_antidep_vs_weak_antidep) +TEST(weak_antidep_vs_weak_antidep) { String8 a_obj; { @@ -1020,7 +1020,7 @@ T_BeginTest(weak_antidep_vs_weak_antidep) } } -T_BeginTest(weak_antidep_vs_weak_nolib) +TEST(weak_antidep_vs_weak_nolib) { String8 a_obj; { @@ -1067,7 +1067,7 @@ T_BeginTest(weak_antidep_vs_weak_nolib) } } -T_BeginTest(weak_antidep_vs_weak_lib) +TEST(weak_antidep_vs_weak_lib) { String8 a_obj; { @@ -1114,7 +1114,7 @@ T_BeginTest(weak_antidep_vs_weak_lib) } } -T_BeginTest(weak_antidep_vs_weak_alias) +TEST(weak_antidep_vs_weak_alias) { String8 a_obj; { @@ -1161,7 +1161,7 @@ T_BeginTest(weak_antidep_vs_weak_alias) } } -T_BeginTest(weak_vs_common) +TEST(weak_vs_common) { String8 weak_obj; { @@ -1217,7 +1217,7 @@ T_BeginTest(weak_vs_common) T_Ok(bss->vsize == 2); } -T_BeginTest(abs_vs_weak) +TEST(abs_vs_weak) { U32 abs_value = 0x123; U8 text_code[] = { 0x48, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC3 }; @@ -1272,7 +1272,7 @@ T_BeginTest(abs_vs_weak) T_Ok(str8_match(imm, str8_struct(&expected_imm), 0)); } -T_BeginTest(abs_vs_regular) +TEST(abs_vs_regular) { String8 shared_symbol_name = str8_lit("foo"); @@ -1322,7 +1322,7 @@ T_BeginTest(abs_vs_regular) T_Ok(g_last_exit_code != 0); } -T_BeginTest(abs_vs_common) +TEST(abs_vs_common) { String8 shared_symbol_name = str8_lit("foo"); @@ -1367,7 +1367,7 @@ T_BeginTest(abs_vs_common) } } -T_BeginTest(abs_vs_abs) +TEST(abs_vs_abs) { String8 a_obj; { @@ -1393,7 +1393,7 @@ T_BeginTest(abs_vs_abs) T_Ok(g_last_exit_code == LNK_Error_MultiplyDefinedSymbol); } -T_BeginTest(undef_weak_lib) +TEST(undef_weak_lib) { String8 weak; { @@ -1423,7 +1423,7 @@ T_BeginTest(undef_weak_lib) T_Ok(g_last_exit_code == LNK_Error_UnresolvedSymbol); } -T_BeginTest(undef_weak_search_alias) +TEST(undef_weak_search_alias) { Temp scratch = scratch_begin(0,0); @@ -1477,7 +1477,7 @@ T_BeginTest(undef_weak_search_alias) T_Ok(g_last_exit_code == 0); } -T_BeginTest(weak_cycle) +TEST(weak_cycle) { String8 ab_obj_name = str8_lit("ab.obj"); { @@ -1514,7 +1514,7 @@ T_BeginTest(weak_cycle) t_invoke_linker_timeoutf(timeout, "/subsystem:console /entry:my_entry %S %S %S", entry_obj_name, ab_obj_name, ba_obj_name); } -T_BeginTest(weak_tag) +TEST(weak_tag) { U32 weak_tag_expected_value = 0x12345678; String8 weak_tag_obj_name = str8_lit("weak_tag.obj"); @@ -1559,7 +1559,7 @@ T_BeginTest(weak_tag) T_Ok(str8_match(data, str8_struct(&weak_tag_expected_value), 0)); } -T_BeginTest(undef_section) +TEST(undef_section) { String8 main_obj; { @@ -1603,7 +1603,7 @@ T_BeginTest(undef_section) } } -T_BeginTest(sect_symbol) +TEST(sect_symbol) { String8 sect_payload = str8_lit("hello, world"); String8 sect_obj_name = str8_lit("sect.obj"); @@ -1657,7 +1657,7 @@ T_BeginTest(sect_symbol) T_Ok(str8_match(payload_got, sect_payload, 0)); } -T_BeginTest(undef_reloc_section) +TEST(undef_reloc_section) { String8 main_obj; { @@ -1691,7 +1691,7 @@ T_BeginTest(undef_reloc_section) } } -T_BeginTest(find_merged_pdata) +TEST(find_merged_pdata) { U8 foobar_payload[] = { 0x40, 0x57, 0x48, 0x81, 0xEC, 0x00, 0x02, 0x00, 0x00, 0x48, 0x8B, 0x05, 0x00, 0x00, 0x00, 0x00, @@ -1744,7 +1744,7 @@ T_BeginTest(find_merged_pdata) T_Ok(dim_1u64(pe.data_dir_franges[PE_DataDirectoryIndex_EXCEPTIONS]) == 0xC); } -T_BeginTest(section_sort) +TEST(section_sort) { String8 data_obj_name = str8_lit("data.obj"); { @@ -1789,7 +1789,7 @@ T_BeginTest(section_sort) T_Ok(str8_match(data, expected_data, 0)); } -T_BeginTest(flag_conf) +TEST(flag_conf) { COFF_SectionFlags my_sect0_flags = COFF_SectionFlag_CntInitializedData|COFF_SectionFlag_MemRead|COFF_SectionFlag_MemExecute; COFF_SectionFlags my_sect1_flags = COFF_SectionFlag_CntInitializedData|COFF_SectionFlag_MemRead|COFF_SectionFlag_MemWrite; @@ -1831,7 +1831,7 @@ T_BeginTest(flag_conf) T_Ok(my_sect1->flags == my_sect1_flags); } -T_BeginTest(invalid_bss) +TEST(invalid_bss) { COFF_SectionFlags bss_flags = COFF_SectionFlag_CntInitializedData|COFF_SectionFlag_MemRead; String8 bss_obj_name = str8_lit("bss.obj"); @@ -1871,7 +1871,7 @@ T_BeginTest(invalid_bss) T_Ok(str8_match(data, bss_data, 0)); } -T_BeginTest(common_block) +TEST(common_block) { String8 a_obj_name = str8_lit("a.obj"); U8 a_data[6] = {0}; @@ -1934,7 +1934,7 @@ T_BeginTest(common_block) T_Ok(*b_addr == (pe.image_base + comm_sect->voff + 0x8)); } -T_BeginTest(base_relocs) +TEST(base_relocs) { // main.obj String8 entry_name = str8_lit("my_entry"); @@ -2004,7 +2004,7 @@ T_BeginTest(base_relocs) } } -T_BeginTest(simple_lib_test) +TEST(simple_lib_test) { String8 test_payload = str8_lit("The quick brown fox jumps over the lazy dog"); String8 test_obj = {0}; @@ -2067,7 +2067,7 @@ T_BeginTest(simple_lib_test) T_Ok(*data_addr32nb == data_sect->voff); } -T_BeginTest(import_export) +TEST(import_export) { String8 export_obj; { @@ -2288,7 +2288,7 @@ T_BeginTest(import_export) // TODO: check import table } -T_BeginTest(image_base) +TEST(image_base) { String8 obj_name = str8_lit("image_base.obj"); { @@ -2330,7 +2330,7 @@ T_BeginTest(image_base) T_Ok(str8_match(text_data, str8_array_fixed(expected_text), 0)); } -T_BeginTest(comdat_any) +TEST(comdat_any) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -2393,7 +2393,7 @@ T_BeginTest(comdat_any) } } -T_BeginTest(comdat_no_duplicates) +TEST(comdat_no_duplicates) { String8 test_obj; { @@ -2441,7 +2441,7 @@ T_BeginTest(comdat_no_duplicates) T_Ok(str8_match(data, str8_lit("a"), 0)); } -T_BeginTest(comdat_same_size) +TEST(comdat_same_size) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -2507,7 +2507,7 @@ T_BeginTest(comdat_same_size) if (t_id_linker() == T_Linker_RAD) { T_Ok(g_last_exit_code == LNK_Error_MultiplyDefinedSymbol); } } -T_BeginTest(comdat_exact_match) +TEST(comdat_exact_match) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -2572,7 +2572,7 @@ T_BeginTest(comdat_exact_match) } } -T_BeginTest(comdat_largest) +TEST(comdat_largest) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -2650,7 +2650,7 @@ T_BeginTest(comdat_largest) } } -T_BeginTest(comdat_associative) +TEST(comdat_associative) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0,COFF_MachineType_X64); @@ -2719,7 +2719,7 @@ T_BeginTest(comdat_associative) T_Ok(str8_match(bbb_data, str8_lit("bbb"), 0)); } -T_BeginTest(comdat_associative_loop) +TEST(comdat_associative_loop) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -2756,7 +2756,7 @@ T_BeginTest(comdat_associative_loop) if (t_id_linker() == T_Linker_RAD) { T_Ok(g_last_exit_code == LNK_Error_AssociativeLoop); } } -T_BeginTest(comdat_associative_non_comdat) +TEST(comdat_associative_non_comdat) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -2801,7 +2801,7 @@ T_BeginTest(comdat_associative_non_comdat) T_Ok(str8_match(b_data, str8_lit("b"), 0)); } -T_BeginTest(comdat_associative_out_of_bounds) +TEST(comdat_associative_out_of_bounds) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0,COFF_MachineType_X64); @@ -2846,7 +2846,7 @@ T_BeginTest(comdat_associative_out_of_bounds) if (t_id_linker() == T_Linker_RAD) { T_Ok(g_last_exit_code == LNK_Error_IllData); } } -T_BeginTest(comdat_with_offset) +TEST(comdat_with_offset) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -2889,7 +2889,7 @@ T_BeginTest(comdat_with_offset) T_Ok(g_last_exit_code == 0); } -T_BeginTest(reloc_against_removed_comdat) +TEST(reloc_against_removed_comdat) { String8 a_obj; { @@ -2942,7 +2942,7 @@ T_BeginTest(reloc_against_removed_comdat) T_Ok(g_last_exit_code == LNK_Error_RelocationAgainstRemovedSection); } -T_BeginTest(sect_align) +TEST(sect_align) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -3018,7 +3018,7 @@ T_BeginTest(sect_align) T_Ok(str8_match(a_8192, str8_lit("z"), 0)); } -T_BeginTest(alt_name) +TEST(alt_name) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -3100,7 +3100,7 @@ T_BeginTest(alt_name) T_Ok(g_last_exit_code == 0); } -T_BeginTest(include) +TEST(include) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -3153,7 +3153,7 @@ T_BeginTest(include) if (t_id_linker() == T_Linker_RAD) { T_Ok(g_last_exit_code == LNK_Error_UnresolvedSymbol); } } -T_BeginTest(communal_var_vs_regular) +TEST(communal_var_vs_regular) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -3208,7 +3208,7 @@ T_BeginTest(communal_var_vs_regular) } } -T_BeginTest(communal_var_vs_regular_comdat) +TEST(communal_var_vs_regular_comdat) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -3264,7 +3264,7 @@ T_BeginTest(communal_var_vs_regular_comdat) } } -T_BeginTest(import_kernel32) +TEST(import_kernel32) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -3325,7 +3325,7 @@ T_BeginTest(import_kernel32) #endif } -T_BeginTest(delay_import) +TEST(delay_import) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -3472,7 +3472,7 @@ T_BeginTest(delay_import) T_Ok(return_321->u.name.hint == 1); } -T_BeginTest(delay_import_user32) +TEST(delay_import_user32) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -3511,7 +3511,7 @@ T_BeginTest(delay_import_user32) T_Ok(g_last_exit_code == 0); } -T_BeginTest(empty_section) +TEST(empty_section) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -3541,7 +3541,7 @@ T_BeginTest(empty_section) T_Ok(g_last_exit_code != 0); } -T_BeginTest(removed_section) +TEST(removed_section) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -3572,7 +3572,7 @@ T_BeginTest(removed_section) T_Ok(g_last_exit_code != 0); } -T_BeginTest(function_pad_min) +TEST(function_pad_min) { { COFF_ObjWriter *obj_writer = coff_obj_writer_alloc(0, COFF_MachineType_X64); @@ -3609,7 +3609,7 @@ T_BeginTest(function_pad_min) T_Ok(str8_match(text_data, str8_array_fixed(expected_text), 0)); } -T_BeginTest(first_member_header) +TEST(first_member_header) { String8 obj; { @@ -3642,7 +3642,7 @@ T_BeginTest(first_member_header) T_Ok(g_last_exit_code == 0); } -T_BeginTest(second_member_header) +TEST(second_member_header) { String8 obj; { @@ -3675,7 +3675,7 @@ T_BeginTest(second_member_header) T_Ok(g_last_exit_code == 0); } -T_BeginTest(defer_impl_link_to_second_search_pass) +TEST(defer_impl_link_to_second_search_pass) { String8 imp_ref_obj; { @@ -3725,7 +3725,7 @@ T_BeginTest(defer_impl_link_to_second_search_pass) T_Ok(g_last_exit_code == 0); } -T_BeginTest(opt_ref_dangling_section) +TEST(opt_ref_dangling_section) { String8 entry_obj; { @@ -3798,7 +3798,7 @@ T_BeginTest(opt_ref_dangling_section) T_Ok(sect != 0); } -T_BeginTest(fail_if_mismatch) +TEST(fail_if_mismatch) { T_Ok(t_write_entry_obj()); @@ -3840,7 +3840,7 @@ T_BeginTest(fail_if_mismatch) else T_Ok(g_last_exit_code != 0); } -T_BeginTest(long_section_name) +TEST(long_section_name) { Arch arch = Arch_x64; @@ -3871,7 +3871,7 @@ T_BeginTest(long_section_name) T_Ok(debug_abbrev); } -T_BeginTest(debug_p_sig_mismatch) +TEST(debug_p_sig_mismatch) { String8 a_obj_name = str8_lit("a.obj"); String8 b_obj_name = str8_lit("b.obj"); @@ -4068,7 +4068,7 @@ T_BeginTest(debug_p_sig_mismatch) T_Ok(found_error); } -T_BeginTest(debug_p_and_debug_t_in_obj) +TEST(debug_p_and_debug_t_in_obj) { U32 pch_sig = 0xCAFEBABE; String8 pch_obj_name = str8_lit("pch.obj"); @@ -4179,7 +4179,7 @@ T_BeginTest(debug_p_and_debug_t_in_obj) T_Ok(found_warning); } -T_BeginTest(merge_duplicate_types) +TEST(merge_duplicate_types) { { U32 pch_sig = 0xCAFEBABE; @@ -4543,7 +4543,7 @@ T_BeginTest(merge_duplicate_types) } } -T_BeginTest(cyclic_type) +TEST(cyclic_type) { String8List *debug_t = push_array(arena, String8List, 1); str8_serial_begin(arena, debug_t); @@ -4579,7 +4579,7 @@ T_BeginTest(cyclic_type) T_Ok(is_cycle_detected); } -T_BeginTest(get_msf_stream_pages) +TEST(get_msf_stream_pages) { MSF_Context *msf = msf_alloc(MSF_DEFAULT_PAGE_SIZE, MSF_DEFAULT_FPM); @@ -4630,7 +4630,7 @@ T_BeginTest(get_msf_stream_pages) msf_release(msf); } -T_BeginTest(validate_info_stream) +TEST(validate_info_stream) { COFF_TimeStamp time_stamp = 123; U32 age = 1; @@ -4681,7 +4681,7 @@ T_BeginTest(validate_info_stream) tp_release(tp); } -T_BeginTest(patch_cv_symbol_tree) +TEST(patch_cv_symbol_tree) { String8List raw_symbols = {0}; str8_list_push(arena, &raw_symbols, cv_make_symbol(arena, CV_SymKind_OBJNAME, cv_make_obj_name(arena, str8_lit("foo.obj"), 123))); @@ -4735,7 +4735,7 @@ T_BeginTest(patch_cv_symbol_tree) } } -T_BeginTest(whole_archive) +TEST(whole_archive) { String8 a_obj; { @@ -4849,7 +4849,7 @@ t_radlink_validate_asan_out(String8 obj_name) return is_ok; } -T_BeginTest(infer_asan) +TEST(infer_asan) { char *program = "#include \n" @@ -4900,7 +4900,7 @@ T_BeginTest(infer_asan) #endif #if OS_WINDOWS -T_BeginTest(determ_test) +TEST(determ_test) { // compile the test target (torture) String8 cl_line = str8f(arena, "/fsanitize=address /c /Z7 /Fo:test.obj -I%S /Zc:preprocessor %S/torture/torture_main.c", t_src_path(), t_src_path()); @@ -4944,7 +4944,7 @@ T_BeginTest(determ_test) #if 0 -T_BeginTest(fold_two_funcs) +TEST(fold_two_funcs) { String8 ident_funcs_obj; { @@ -5013,7 +5013,7 @@ T_BeginTest(fold_two_funcs) } -T_BeginTest(same_but_different) +TEST(same_but_different) { String8 obj; { @@ -5114,7 +5114,7 @@ T_BeginTest(same_but_different) } -T_BeginTest(fold_diamond) +TEST(fold_diamond) { String8 a_obj; { @@ -5204,7 +5204,7 @@ T_BeginTest(fold_diamond) } -T_BeginTest(cyclic_icf) +TEST(cyclic_icf) { String8 a_obj; { @@ -5259,7 +5259,7 @@ T_BeginTest(cyclic_icf) } -T_BeginTest(fold_with_largest_align) +TEST(fold_with_largest_align) { String8 a_obj; {