X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=test%2Ftest_solr.c;h=6b156a288a17c68ac6f867f9b369dc9d72f2b4f4;hp=27eafc8ff3876cc19606b564f337ff7db5371056;hb=6a1e51ab0313c7008e257e6c3644146d60f571ec;hpb=77c5a4fca8b516fd39b8ba213daed17a465a6b2a diff --git a/test/test_solr.c b/test/test_solr.c index 27eafc8..6b156a2 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-2012 Index Data + * Copyright (C) 1995-2013 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)); }