odr_setbuf(o, http_response, strlen(http_response), 0);
odr_setbuf(o, http_response, strlen(http_response), 0);
r = z_GDU(o, &gdu, 0, 0);
if (!r || gdu->which != Z_GDU_HTTP_Response)
return 0;
r = z_GDU(o, &gdu, 0, 0);
if (!r || gdu->which != Z_GDU_HTTP_Response)
return 0;
"<str name=\"rows\">0</str></lst>"
"</lst><result name=\"response\" numFound=\"91\" start=\"0\"/>\n"
"</response>\n", &response));
"<str name=\"rows\">0</str></lst>"
"</lst><result name=\"response\" numFound=\"91\" start=\"0\"/>\n"
"</response>\n", &response));
- YAZ_CHECK_EQ(*response->numberOfRecords, 91);
- YAZ_CHECK_EQ(response->num_records, 0);
- YAZ_CHECK(response->records == 0);
- YAZ_CHECK_EQ(response->num_diagnostics, 0);
- YAZ_CHECK(response->diagnostics == 0);
- YAZ_CHECK(response->nextRecordPosition == 0);
- YAZ_CHECK(response->facetList == 0);
-
+ if (response)
+ {
+ YAZ_CHECK_EQ(*response->numberOfRecords, 91);
+ YAZ_CHECK_EQ(response->num_records, 0);
+ YAZ_CHECK(response->records == 0);
+ YAZ_CHECK_EQ(response->num_diagnostics, 0);
+ YAZ_CHECK(response->diagnostics == 0);
+ YAZ_CHECK(response->nextRecordPosition == 0);
+ YAZ_CHECK(response->facetList == 0);
+ }
"<int name=\"1987\">4</int><int name=\"1988\">4</int>"
"<int name=\"2003\">3</int></lst></lst><lst name=\"facet_dates\"/>"
"</lst></response>", &response));
"<int name=\"1987\">4</int><int name=\"1988\">4</int>"
"<int name=\"2003\">3</int></lst></lst><lst name=\"facet_dates\"/>"
"</lst></response>", &response));
- YAZ_CHECK_EQ(response->num_records, 1);
- YAZ_CHECK(response->records);
- if (response->records)
+ YAZ_CHECK_EQ(response->num_records, 1);
+ YAZ_CHECK(response->records);
+ }
+ if (response && response->records)
YAZ_CHECK(record->recordData_len == strlen(doc) &&
!memcmp(record->recordData_buf, doc, record->recordData_len));
}
YAZ_CHECK(record->recordData_len == strlen(doc) &&
!memcmp(record->recordData_buf, doc, record->recordData_len));
}
- YAZ_CHECK_EQ(response->num_diagnostics, 0);
- YAZ_CHECK(response->diagnostics == 0);
- YAZ_CHECK(response->nextRecordPosition == 0);
-
- YAZ_CHECK(response->facetList);
- if (response->facetList)
+ if (response)
+ {
+ YAZ_CHECK_EQ(response->num_diagnostics, 0);
+ YAZ_CHECK(response->diagnostics == 0);
+ YAZ_CHECK(response->nextRecordPosition == 0);
+ YAZ_CHECK(response->facetList);
+ }
+ if (response && response->facetList)