]> git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/testHttp1Parser.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / tests / testHttp1Parser.h
1 /*
2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #ifndef SQUID_SRC_TESTS_TESTHTTP1PARSER_H
10 #define SQUID_SRC_TESTS_TESTHTTP1PARSER_H
11
12 #include <cppunit/extensions/HelperMacros.h>
13
14 class testHttp1Parser : public CPPUNIT_NS::TestFixture
15 {
16 CPPUNIT_TEST_SUITE( testHttp1Parser );
17 // object basics are working, just in case.
18 CPPUNIT_TEST( testParserConstruct );
19
20 #if __cplusplus >= 201103L
21 CPPUNIT_TEST( testDripFeed );
22 CPPUNIT_TEST( testParseRequestLineMethods );
23 CPPUNIT_TEST( testParseRequestLineProtocols );
24 CPPUNIT_TEST( testParseRequestLineTerminators );
25 CPPUNIT_TEST( testParseRequestLineStrange );
26 CPPUNIT_TEST( testParseRequestLineInvalid );
27 #endif
28 CPPUNIT_TEST_SUITE_END();
29
30 protected:
31 void globalSetup(); // MemPools init etc.
32
33 void testParserConstruct(); // whether the constructor works
34
35 #if __cplusplus >= 201103L
36 // request-line unit tests
37 void testParseRequestLineTerminators(); // terminator detection correct
38 void testParseRequestLineMethods(); // methoid detection correct
39 void testParseRequestLineProtocols(); // protocol tokens handled correctly
40 void testParseRequestLineStrange(); // strange but valid lines accepted
41 void testParseRequestLineInvalid(); // rejection of invalid lines happens
42
43 void testDripFeed(); // test incremental parse works
44 #endif
45 };
46
47 #endif
48