X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=test%2Ftest_solr.c;h=a25765c19c19eb05cdeebb6155ae1ab04c2e4ad7;hp=5f69531dddc8bbcbc67ff78680b87b9ea0412f98;hb=266cfeafc17930bfa6fb7eed92f80b8c751f43b4;hpb=847dc126960b1bcc6ce8cef8a73e3606588770af diff --git a/test/test_solr.c b/test/test_solr.c index 5f69531..a25765c 100644 --- a/test/test_solr.c +++ b/test/test_solr.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2011 Index Data + * Copyright (C) 1995-2012 Index Data * See the file LICENSE for details. */ #if HAVE_CONFIG_H @@ -39,7 +39,7 @@ int compare_solr_req(ODR odr, Z_SRW_PDU *sr, { int len = 0; char *buf = odr_getbuf(odr, &len, 0); - + if (buf) { if (len == strlen(expect) && !memcmp(buf, expect, len)) @@ -64,7 +64,7 @@ void tst_encoding(void) { Z_SRW_PDU *sr = yaz_srw_get_pdu(odr, Z_SRW_searchRetrieve_request, "1.2"); - + YAZ_CHECK(compare_solr_req( odr, sr, 0, "GET Default/select? HTTP/1.1\r\n" @@ -87,7 +87,7 @@ void tst_encoding(void) { Z_SRW_PDU *sr = yaz_srw_get_pdu(odr, Z_SRW_searchRetrieve_request, "1.2"); - + sr->u.request->query_type = Z_SRW_query_type_cql; sr->u.request->query.cql = "title:solr"; sr->u.request->startRecord = odr_intdup(odr, 3); @@ -105,7 +105,7 @@ void tst_encoding(void) { Z_SRW_PDU *sr = yaz_srw_get_pdu(odr, Z_SRW_searchRetrieve_request, "1.2"); - + sr->u.request->query_type = Z_SRW_query_type_cql; sr->u.request->query.cql = "title:solr"; sr->u.request->startRecord = odr_intdup(odr, 3); @@ -137,7 +137,7 @@ int check_response(ODR o, const char *content, Z_SRW_searchRetrieveResponse **p) Z_SRW_PDU *sr_p; char *http_response = odr_malloc(o, strlen(content) + 300); - strcpy(http_response, + strcpy(http_response, "HTTP/1.1 200 OK\r\n" "Last-Modified: Wed, 13 Apr 2011 08:30:59 GMT\r\n" "ETag: \"MjcyMWE5M2JiNDgwMDAwMFNvbHI=\"\r\n" @@ -167,7 +167,7 @@ void tst_decoding(void) Z_SRW_searchRetrieveResponse *response; YAZ_CHECK(check_response( - odr, + odr, "\n" "\n" "0" @@ -188,7 +188,7 @@ void tst_decoding(void) YAZ_CHECK( check_response( - odr, + odr, "" "" "02" @@ -269,7 +269,7 @@ void tst_decoding(void) ""; Z_SRW_record *record = response->records; - + YAZ_CHECK(record->recordData_len == strlen(doc) && !memcmp(record->recordData_buf, doc, record->recordData_len)); }