Fix encoding of 0x00a4 (unicode to danmarc) YAZ-713
[yaz-moved-to-github.git] / test / test_comstack.c
index 9ebc491..0e5233d 100644 (file)
@@ -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 */