testBoilerplate.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 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 #include "squid.h"
10 #include "compat/cppunit.h"
11 #include "unitTestMain.h"
12 
13 #include <stdexcept>
14 
15 /*
16  * This is a rough example of a typical unit test file.
17  *
18  * If the class declaration is used in more than one source file,
19  * then place that declaration into a dedicated header file instead.
20  */
21 
22 class TestBoilerplate: public CPPUNIT_NS::TestFixture
23 {
25  /* note the statement here and then the actual prototype below */
28 
29 protected:
30  void testDemonstration();
31 };
32 
34 
35 void
37 {
38  CPPUNIT_ASSERT_EQUAL(0, 0);
39 }
40 
41 int
42 main(int argc, char *argv[])
43 {
44  return TestProgram().run(argc, argv);
45 }
46 
CPPUNIT_TEST_SUITE_REGISTRATION(TestBoilerplate)
implements test program's main() function while enabling customization
Definition: unitTestMain.h:25
CPPUNIT_TEST(testDemonstration)
int run(int argc, char *argv[])
Definition: unitTestMain.h:44
CPPUNIT_TEST_SUITE(TestBoilerplate)
int main(int argc, char *argv[])

 

Introduction

Documentation

Support

Miscellaneous