Blob Blame History Raw
diff -up http-parser-2.7.1/test.c.tests-simple-type http-parser-2.7.1/test.c
--- http-parser-2.7.1/test.c.tests-simple-type	2019-04-01 11:47:35.658031500 +0200
+++ http-parser-2.7.1/test.c	2019-04-01 11:48:20.275113054 +0200
@@ -3313,18 +3313,18 @@ test_message_count_body (const struct me
 }
 
 void
-test_simple (const char *buf, enum http_errno err_expected)
+test_simple_type (const char *buf,
+                  enum http_errno err_expected,
+                  enum http_parser_type type)
 {
-  parser_init(HTTP_REQUEST);
+  parser_init(type);
 
   enum http_errno err;
 
   parse(buf, strlen(buf));
-  err = HTTP_PARSER_ERRNO(parser);
+  err = HTTP_PARSER_ERRNO(parser);
   parse(NULL, 0);
 
-  parser_free();
-
   /* In strict mode, allow us to pass with an unexpected HPE_STRICT as
    * long as the caller isn't expecting success.
    */
@@ -3340,6 +3340,12 @@ test_simple (const char *buf, enum http_
 }
 
 void
+test_simple (const char *buf, enum http_errno err_expected)
+{
+  test_simple_type(buf, err_expected, HTTP_REQUEST);
+}
+
+void
 test_invalid_header_content (int req, const char* str)
 {
   http_parser parser;