mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-27 23:40:25 +00:00
tests: report error when cs_open() failure
This commit is contained in:
parent
c272e9d000
commit
ceae16d5a9
@ -193,8 +193,11 @@ static void test()
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof(platforms)/sizeof(platforms[0]); i++) {
|
||||
if (cs_open(platforms[i].arch, platforms[i].mode, &handle))
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON);
|
||||
|
||||
|
@ -151,8 +151,11 @@ static void test()
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof(platforms)/sizeof(platforms[0]); i++) {
|
||||
if (cs_open(platforms[i].arch, platforms[i].mode, &handle))
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON);
|
||||
|
||||
|
@ -149,8 +149,11 @@ static void test()
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof(platforms)/sizeof(platforms[0]); i++) {
|
||||
if (cs_open(platforms[i].arch, platforms[i].mode, &handle))
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
if (platforms[i].opt_type)
|
||||
cs_option(handle, platforms[i].opt_type, platforms[i].opt_value);
|
||||
|
@ -98,8 +98,11 @@ static void test()
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof(platforms)/sizeof(platforms[0]); i++) {
|
||||
if (cs_open(platforms[i].arch, platforms[i].mode, &handle))
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON);
|
||||
|
||||
|
@ -90,8 +90,11 @@ static void test()
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof(platforms)/sizeof(platforms[0]); i++) {
|
||||
if (cs_open(platforms[i].arch, platforms[i].mode, &handle))
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON);
|
||||
|
||||
|
@ -165,8 +165,11 @@ static void test()
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof(platforms)/sizeof(platforms[0]); i++) {
|
||||
if (cs_open(platforms[i].arch, platforms[i].mode, &handle))
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
if (platforms[i].opt_type)
|
||||
cs_option(handle, platforms[i].opt_type, platforms[i].opt_value);
|
||||
|
Loading…
Reference in New Issue
Block a user