tests: report error when cs_open() failure

This commit is contained in:
Nguyen Anh Quynh 2014-01-19 16:04:23 +08:00
parent c272e9d000
commit ceae16d5a9
6 changed files with 24 additions and 6 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);