X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=test%2Ftest_comstack.c;h=0e5233d820210b5b3981fa73aa3eb2c8f1906826;hp=9ebc49101282cb390153c424432525dbc3ada46a;hb=6ee0d7c0404834a0a59547c3bd7e2686f838ce37;hpb=5242cb5a8634bfa38b9333ff7f903e718ac6e292 diff --git a/test/test_comstack.c b/test/test_comstack.c index 9ebc491..0e5233d 100644 --- a/test/test_comstack.c +++ b/test/test_comstack.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 @@ -173,6 +173,20 @@ static void tst_http_response(void) YAZ_CHECK_EQ(cs_complete_auto(http_buf, 24), 0); } { + /* no content, no headers */ + const char *http_buf = + /*123456789012345678 */ + "HTTP/1.1 204 OK\r\n" + "\r\n" + "HTTP/1.1 200 OK\r\n"; + + YAZ_CHECK_EQ(cs_complete_auto(http_buf, 1), 0); + YAZ_CHECK_EQ(cs_complete_auto(http_buf, 2), 0); + YAZ_CHECK_EQ(cs_complete_auto(http_buf, 18), 0); + YAZ_CHECK_EQ(cs_complete_auto(http_buf, 19), 19); + YAZ_CHECK_EQ(cs_complete_auto(http_buf, 24), 19); + } + { /* response, content */ const char *http_buf = /*123456789012345678 */