mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-12-02 18:47:30 +00:00
Make tests fail loudly
This commit is contained in:
parent
2c073468d8
commit
50c352c9d6
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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.
|
||||
|
@ -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");
|
||||
|
@ -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)
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user