]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Maintenance: consolidate testBoilerpate header file (#1534)
authorFrancesco Chemolli <5175948+kinkie@users.noreply.github.com>
Mon, 23 Oct 2023 14:28:50 +0000 (14:28 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 24 Oct 2023 18:45:07 +0000 (18:45 +0000)
src/Makefile.am
src/tests/testBoilerplate.cc
src/tests/testBoilerplate.h [deleted file]

index d9857b6762dccb4fe4d56ff482d91d153caf6d73..8058f7760855936289eeeb6eafa7157b91ce2b8f 100644 (file)
@@ -747,8 +747,7 @@ TESTSOURCES= \
 ## involved in writing tests.
 check_PROGRAMS += tests/testBoilerplate
 tests_testBoilerplate_SOURCES = \
-       tests/testBoilerplate.cc \
-       tests/testBoilerplate.h
+       tests/testBoilerplate.cc
 nodist_tests_testBoilerplate_SOURCES = \
        $(TESTSOURCES)
 tests_testBoilerplate_LDADD= \
index 25449411e478bc0a00ef18af211c31ee6e3c0aba..a3c2efb15da9160ecd238c6ee14580dd5578fbdd 100644 (file)
@@ -7,11 +7,29 @@
  */
 
 #include "squid.h"
-#include "testBoilerplate.h"
+#include "compat/cppunit.h"
 #include "unitTestMain.h"
 
 #include <stdexcept>
 
+/*
+ * This is a rough example of a typical unit test file.
+ *
+ * If the class declaration is used in more than one source file,
+ * then place that declaration into a dedicated header file instead.
+ */
+
+class TestBoilerplate: public CPPUNIT_NS::TestFixture
+{
+    CPPUNIT_TEST_SUITE( TestBoilerplate );
+    /* note the statement here and then the actual prototype below */
+    CPPUNIT_TEST( testDemonstration );
+    CPPUNIT_TEST_SUITE_END();
+
+protected:
+    void testDemonstration();
+};
+
 CPPUNIT_TEST_SUITE_REGISTRATION( TestBoilerplate );
 
 void
diff --git a/src/tests/testBoilerplate.h b/src/tests/testBoilerplate.h
deleted file mode 100644 (file)
index e387f37..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
- *
- * Squid software is distributed under GPLv2+ license and includes
- * contributions from numerous individuals and organizations.
- * Please see the COPYING and CONTRIBUTORS files for details.
- */
-
-#ifndef SQUID_SRC_TEST_BOILDERPLATE_H
-#define SQUID_SRC_TEST_BOILDERPLATE_H
-
-#include "compat/cppunit.h"
-
-/*
- * demonstration test file, as new idioms are made they will
- * be shown in the TestBoilerplate source.
- *
- * If a class declaration is only used in one source file, then declare
- * that class where it is used instead of adding a dedicated header file.
- */
-
-class TestBoilerplate: public CPPUNIT_NS::TestFixture
-{
-    CPPUNIT_TEST_SUITE( TestBoilerplate );
-    /* note the statement here and then the actual prototype below */
-    CPPUNIT_TEST( testDemonstration );
-    CPPUNIT_TEST_SUITE_END();
-
-public:
-
-protected:
-    void testDemonstration();
-};
-
-#endif /* SQUID_SRC_TEST_BOILDERPLATE_H */
-