Author: rhuijben
Date: Fri Nov 20 22:25:49 2015
New Revision: 1715433

URL: http://svn.apache.org/viewvc?rev=1715433&view=rev
Log:
* test/test_buckets.c
  (test_response_no_body_expected): Combine two tests to extend 100 status
     behavior testing. Test if what is left in the bucket is as expected.

Modified:
    serf/trunk/test/test_buckets.c

Modified: serf/trunk/test/test_buckets.c
URL: 
http://svn.apache.org/viewvc/serf/trunk/test/test_buckets.c?rev=1715433&r1=1715432&r2=1715433&view=diff
==============================================================================
--- serf/trunk/test/test_buckets.c (original)
+++ serf/trunk/test/test_buckets.c Fri Nov 20 22:25:49 2015
@@ -1361,6 +1361,13 @@ static void test_response_no_body_expect
           "Content-Length: 6500000" CRLF
           CRLF
           "blablablablabla" CRLF,
+        "HTTP/1.1 100 Continue" CRLF
+          CRLF
+        "HTTP/1.1 204 No Content" CRLF
+          "Content-Type: text/plain" CRLF
+          "Content-Length: 6500000" CRLF
+          CRLF
+          "blablablablabla" CRLF,
     };
 
     alloc = test__create_bucket_allocator(tc, tb->pool);
@@ -1395,11 +1402,15 @@ static void test_response_no_body_expect
         if (i == 0) {
             /* blablablablabla is parsed as the next status line */
             CuAssertIntEquals(tc, SERF_ERROR_BAD_HTTP_RESPONSE, status);
+            DRAIN_BUCKET(tmp);
+        }
+        else {
+            CuAssertIntEquals(tc, APR_EOF, status);
+            CuAssertIntEquals(tc, 0, len);
+
+            read_and_check_bucket(tc, tmp, "blablablablabla" CRLF);
         }
-        else
-          CuAssertIntEquals(tc, 0, len);
 
-        DRAIN_BUCKET(tmp);
         serf_bucket_destroy(bkt);
     }
 }


Reply via email to