+static void sort(ZebraHandle zh, const char *query, zint hits, zint *exp)
+{
+ ZebraMetaRecord *recs;
+ zint i;
+ int errs = 0;
+
+ assert(query);
+ do_query(__LINE__, zh, query, hits);
+
+ recs = zebra_meta_records_create_range (zh, "rsetname", 1, 4);
+ if (!recs)
+ {
+ fprintf(stderr, "recs==0\n");
+ exit(1);
+ }
+ for (i = 0; i<hits; i++)
+ if (recs[i].sysno != exp[i])
+ errs++;
+ if (errs)
+ {
+ printf("Sequence not in right order for query\n%s\ngot exp\n",
+ query);
+ for (i = 0; i<hits; i++)
+ printf(" " ZINT_FORMAT " " ZINT_FORMAT "\n",
+ recs[i].sysno, exp[i]);
+ }
+ zebra_meta_records_destroy (zh, recs, 4);
+
+ if (errs)
+ exit(1);
+}
+