- ret = zebra_search_RPN(zh, odr_input, query, setname1, &hits);
- if (ret == ZEBRA_FAIL)
- {
- int code = zebra_errCode(zh);
- printf("search returned ERROR, OK was expected ret=%d "
- "code=%d\n", ret, code);
- }
-
- ret = zebra_sort(zh, odr_output, 1, &setname1, setname2, spec, &status);
- if (ret == ZEBRA_FAIL)
- {
- int code = zebra_errCode(zh);
- printf("sort A returned ERROR, OK was expected ret=%d status=%d "
- "code=%d\n", ret, status, code);
- exit(1);
- }
-
- ret = zebra_sort(zh, odr_output, 1, &setname2, setname3, spec, &status);
- if (ret == ZEBRA_FAIL)
- {
- int code = zebra_errCode(zh);
- printf("sort B returned ERROR, OK was expected ret=%d status=%d "
- "code=%d\n", ret, status, code);
- exit(1);
- }
-
- spec = yaz_sort_spec(odr_output, "1=5 <"); /* invalid sort spec */
-
- ret = zebra_sort(zh, odr_output, 1, &setname1, setname2, spec, &status);
- if (ret == ZEBRA_OK)
- {
- printf("sort C returned OK, ERROR was expected ret=%d status=%d\n",
- ret, status);
- exit(1);
- }
- zebra_end_trans(zh);
+ YAZ_CHECK(zebra_search_RPN(zh, odr_input, query, setname1, &hits) ==
+ ZEBRA_OK);
+
+ YAZ_CHECK(zebra_sort(zh, odr_output, 1, &setname1, setname2, spec,
+ &status)
+ == ZEBRA_OK);
+ YAZ_CHECK(zebra_sort(zh, odr_output, 1, &setname2, setname3, spec,
+ &status) == ZEBRA_OK);
+
+ spec = yaz_sort_spec(odr_output, "1=5 <!"); /* invalid sort spec */
+
+ YAZ_CHECK(zebra_sort(zh, odr_output, 1, &setname1, setname2, spec,
+ &status) == ZEBRA_FAIL);
+
+ YAZ_CHECK(zebra_end_trans(zh) == ZEBRA_OK);
+