]> git.ipfire.org Git - thirdparty/squid.git/blame - src/tests/testHttp1Parser.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / tests / testHttp1Parser.h
CommitLineData
4e0938ef 1/*
4ac4a490 2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
4e0938ef
AJ
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
bb86dcd4
AJ
9#ifndef SQUID_SRC_TESTS_TESTHTTP1PARSER_H
10#define SQUID_SRC_TESTS_TESTHTTP1PARSER_H
4c14658e
AJ
11
12#include <cppunit/extensions/HelperMacros.h>
13
bb86dcd4 14class testHttp1Parser : public CPPUNIT_NS::TestFixture
4c14658e 15{
bb86dcd4 16 CPPUNIT_TEST_SUITE( testHttp1Parser );
947ca0c6 17 // object basics are working, just in case.
10c0d360 18 CPPUNIT_TEST( testParserConstruct );
9da95dba
AJ
19
20#if __cplusplus >= 201103L
947ca0c6 21 CPPUNIT_TEST( testDripFeed );
8c730cae
AJ
22 CPPUNIT_TEST( testParseRequestLineMethods );
23 CPPUNIT_TEST( testParseRequestLineProtocols );
947ca0c6 24 CPPUNIT_TEST( testParseRequestLineTerminators );
8c730cae
AJ
25 CPPUNIT_TEST( testParseRequestLineStrange );
26 CPPUNIT_TEST( testParseRequestLineInvalid );
9da95dba 27#endif
4c14658e
AJ
28 CPPUNIT_TEST_SUITE_END();
29
30protected:
31 void globalSetup(); // MemPools init etc.
8c730cae 32
10c0d360
AJ
33 void testParserConstruct(); // whether the constructor works
34
9da95dba 35#if __cplusplus >= 201103L
8c730cae
AJ
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
b6a7fc85
AJ
42
43 void testDripFeed(); // test incremental parse works
9da95dba 44#endif
4c14658e
AJ
45};
46
47#endif
f53969cc 48