diff --git a/tests/test_arm.c b/tests/test_arm.c index 1c2fdf368..f368a8806 100644 --- a/tests/test_arm.c +++ b/tests/test_arm.c @@ -302,7 +302,7 @@ static void test() cs_err err = cs_open(platforms[i].arch, platforms[i].mode, &handle); if (err) { printf("Failed on cs_open() with error returned: %u\n", err); - continue; + abort(); } cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON); @@ -331,6 +331,7 @@ static void test() printf("Platform: %s\n", platforms[i].comment); print_string_hex("Code:", platforms[i].code, platforms[i].size); printf("ERROR: Failed to disasm given code!\n"); + abort(); } printf("\n"); diff --git a/tests/test_arm64.c b/tests/test_arm64.c index a4bcc18e6..e28d1f253 100644 --- a/tests/test_arm64.c +++ b/tests/test_arm64.c @@ -196,7 +196,7 @@ static void test() cs_err err = cs_open(platforms[i].arch, platforms[i].mode, &handle); if (err) { printf("Failed on cs_open() with error returned: %u\n", err); - continue; + abort(); } cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON); @@ -223,6 +223,7 @@ static void test() printf("Platform: %s\n", platforms[i].comment); print_string_hex("Code: ", platforms[i].code, platforms[i].size); printf("ERROR: Failed to disasm given code!\n"); + abort(); } printf("\n"); diff --git a/tests/test_basic.c b/tests/test_basic.c index 92eb28c57..39ae1cd96 100644 --- a/tests/test_basic.c +++ b/tests/test_basic.c @@ -239,7 +239,7 @@ static void test() err = cs_open(platforms[i].arch, platforms[i].mode, &handle); if (err) { printf("Failed on cs_open() with error returned: %u\n", err); - continue; + abort(); } if (platforms[i].opt_type) @@ -267,6 +267,7 @@ static void test() printf("Platform: %s\n", platforms[i].comment); print_string_hex(platforms[i].code, platforms[i].size); printf("ERROR: Failed to disasm given code!\n"); + abort(); } printf("\n"); diff --git a/tests/test_customized_mnem.c b/tests/test_customized_mnem.c index 6ad820080..4a56bf1a9 100644 --- a/tests/test_customized_mnem.c +++ b/tests/test_customized_mnem.c @@ -35,8 +35,10 @@ static void print_insn(csh handle) printf("\t%s\t%s\n", insn[0].mnemonic, insn[0].op_str); // Free memory allocated by cs_disasm() cs_free(insn, count); - } else + } else { printf("ERROR: Failed to disasm given code!\n"); + abort(); + } } static void test() @@ -51,7 +53,7 @@ static void test() err = cs_open(CS_ARCH_X86, CS_MODE_32, &handle); if (err) { printf("Failed on cs_open() with error returned: %u\n", err); - return; + abort(); } // 1. Print out the instruction in default setup. diff --git a/tests/test_detail.c b/tests/test_detail.c index 577da9719..9e085ad80 100644 --- a/tests/test_detail.c +++ b/tests/test_detail.c @@ -231,7 +231,7 @@ static void test() err = cs_open(platforms[i].arch, platforms[i].mode, &handle); if (err) { printf("Failed on cs_open() with error returned: %u\n", err); - continue; + abort(); } if (platforms[i].opt_type) @@ -293,6 +293,7 @@ static void test() printf("Platform: %s\n", platforms[i].comment); print_string_hex(platforms[i].code, platforms[i].size); printf("ERROR: Failed to disasm given code!\n"); + abort(); } printf("\n"); diff --git a/tests/test_iter.c b/tests/test_iter.c index 53b86b294..fb1695a48 100644 --- a/tests/test_iter.c +++ b/tests/test_iter.c @@ -193,7 +193,7 @@ static void test() err = cs_open(platforms[i].arch, platforms[i].mode, &handle); if (err) { printf("Failed on cs_open() with error returned: %u\n", err); - continue; + abort(); } if (platforms[i].opt_type) diff --git a/tests/test_mips.c b/tests/test_mips.c index 923d81097..6cb751f69 100644 --- a/tests/test_mips.c +++ b/tests/test_mips.c @@ -123,7 +123,7 @@ static void test() cs_err err = cs_open(platforms[i].arch, platforms[i].mode, &handle); if (err) { printf("Failed on cs_open() with error returned: %u\n", err); - continue; + abort(); } cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON); @@ -150,6 +150,7 @@ static void test() printf("Platform: %s\n", platforms[i].comment); print_string_hex("Code:", platforms[i].code, platforms[i].size); printf("ERROR: Failed to disasm given code!\n"); + abort(); } printf("\n"); diff --git a/tests/test_ppc.c b/tests/test_ppc.c index b84188141..a1c8800ba 100644 --- a/tests/test_ppc.c +++ b/tests/test_ppc.c @@ -142,7 +142,7 @@ static void test() cs_err err = cs_open(platforms[i].arch, platforms[i].mode, &handle); if (err) { printf("Failed on cs_open() with error returned: %u\n", err); - continue; + abort(); } cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON); @@ -169,6 +169,7 @@ static void test() printf("Platform: %s\n", platforms[i].comment); print_string_hex("Code:", platforms[i].code, platforms[i].size); printf("ERROR: Failed to disasm given code!\n"); + abort(); } printf("\n"); diff --git a/tests/test_skipdata.c b/tests/test_skipdata.c index 41ad60c98..26cf29458 100644 --- a/tests/test_skipdata.c +++ b/tests/test_skipdata.c @@ -101,7 +101,7 @@ static void test() err = cs_open(platforms[i].arch, platforms[i].mode, &handle); if (err) { printf("Failed on cs_open() with error returned: %u\n", err); - continue; + abort(); } if (platforms[i].opt_type) @@ -133,6 +133,7 @@ static void test() printf("Platform: %s\n", platforms[i].comment); print_string_hex(platforms[i].code, platforms[i].size); printf("ERROR: Failed to disasm given code!\n"); + abort(); } printf("\n"); diff --git a/tests/test_sparc.c b/tests/test_sparc.c index b0107345d..8417cb96d 100644 --- a/tests/test_sparc.c +++ b/tests/test_sparc.c @@ -108,7 +108,7 @@ static void test() cs_err err = cs_open(platforms[i].arch, platforms[i].mode, &handle); if (err) { printf("Failed on cs_open() with error returned: %u\n", err); - continue; + abort(); } cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON); @@ -135,6 +135,7 @@ static void test() printf("Platform: %s\n", platforms[i].comment); print_string_hex("Code:", platforms[i].code, platforms[i].size); printf("ERROR: Failed to disasm given code!\n"); + abort(); } printf("\n"); diff --git a/tests/test_systemz.c b/tests/test_systemz.c index b69cee9b6..2b8ea3bee 100644 --- a/tests/test_systemz.c +++ b/tests/test_systemz.c @@ -101,7 +101,7 @@ static void test() cs_err err = cs_open(platforms[i].arch, platforms[i].mode, &handle); if (err) { printf("Failed on cs_open() with error returned: %u\n", err); - continue; + abort(); } cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON); @@ -128,6 +128,7 @@ static void test() printf("Platform: %s\n", platforms[i].comment); print_string_hex("Code:", platforms[i].code, platforms[i].size); printf("ERROR: Failed to disasm given code!\n"); + abort(); } printf("\n"); diff --git a/tests/test_x86.c b/tests/test_x86.c index ae713347b..a1e1f0235 100644 --- a/tests/test_x86.c +++ b/tests/test_x86.c @@ -363,7 +363,7 @@ static void test() cs_err err = cs_open(platforms[i].arch, platforms[i].mode, &handle); if (err) { printf("Failed on cs_open() with error returned: %u\n", err); - continue; + abort(); } if (platforms[i].opt_type) @@ -393,6 +393,7 @@ static void test() printf("Platform: %s\n", platforms[i].comment); print_string_hex("Code:", platforms[i].code, platforms[i].size); printf("ERROR: Failed to disasm given code!\n"); + abort(); } printf("\n"); diff --git a/tests/test_xcore.c b/tests/test_xcore.c index 460a10542..778e1525c 100644 --- a/tests/test_xcore.c +++ b/tests/test_xcore.c @@ -96,7 +96,7 @@ static void test() cs_err err = cs_open(platforms[i].arch, platforms[i].mode, &handle); if (err) { printf("Failed on cs_open() with error returned: %u\n", err); - continue; + abort(); } cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON); @@ -123,6 +123,7 @@ static void test() printf("Platform: %s\n", platforms[i].comment); print_string_hex("Code:", platforms[i].code, platforms[i].size); printf("ERROR: Failed to disasm given code!\n"); + abort(); } printf("\n");