tests: report error when cs_open() failure
diff --git a/tests/test_arm.c b/tests/test_arm.c
index 71ccbb9..fe5bbd8 100644
--- a/tests/test_arm.c
+++ b/tests/test_arm.c
@@ -193,8 +193,11 @@
 	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);
 
diff --git a/tests/test_arm64.c b/tests/test_arm64.c
index 3fd3d22..d99579a 100644
--- a/tests/test_arm64.c
+++ b/tests/test_arm64.c
@@ -151,8 +151,11 @@
 	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);
 
diff --git a/tests/test_detail.c b/tests/test_detail.c
index 2174b8d..18738ad 100644
--- a/tests/test_detail.c
+++ b/tests/test_detail.c
@@ -149,8 +149,11 @@
 	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);
diff --git a/tests/test_mips.c b/tests/test_mips.c
index a18f100..02f8d88 100644
--- a/tests/test_mips.c
+++ b/tests/test_mips.c
@@ -98,8 +98,11 @@
 	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);
 
diff --git a/tests/test_ppc.c b/tests/test_ppc.c
index 30d1d2d..5784153 100644
--- a/tests/test_ppc.c
+++ b/tests/test_ppc.c
@@ -90,8 +90,11 @@
 	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);
 
diff --git a/tests/test_x86.c b/tests/test_x86.c
index 7be66ad..444a4e5 100644
--- a/tests/test_x86.c
+++ b/tests/test_x86.c
@@ -165,8 +165,11 @@
 	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);