]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - compat/testPreCompiler.cc
Source Format Enforcement (#1234)
[thirdparty/squid.git] / compat / testPreCompiler.cc
index 35aa00ebd5ca9234c4949b315a3021e133b633ba..a5b807bd50c3dbe861ee936da5b407b2580b6ab9 100644 (file)
@@ -1,10 +1,17 @@
-#define SQUID_UNIT_TEST 1
+/*
+ * 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.
+ */
+
 #include "squid.h"
+#include "testPreCompiler.h"
+#include "unitTestMain.h"
 
 #include <cassert>
 
-#include "testPreCompiler.h"
-
 CPPUNIT_TEST_SUITE_REGISTRATION( testPreCompiler );
 
 /**
@@ -101,6 +108,19 @@ testPreCompiler::testIfDefAnd()
 #endif
     CPPUNIT_ASSERT(undefinedAndFalseB);
     CPPUNIT_ASSERT(!undefinedAndTrueB);
+
+#if UNDEFINED_FOO && UNDEFINED_FOO
+    bool undefinedAndUndefinedC = true;
+#else
+    bool undefinedAndUndefinedC = false;
+#endif
+#if !UNDEFINED_FOO && !UNDEFINED_FOO
+    bool notUndefinedAndNotUndefinedC = true;
+#else
+    bool notUndefinedAndNotUndefinedC = false;
+#endif
+    CPPUNIT_ASSERT(!undefinedAndUndefinedC);
+    CPPUNIT_ASSERT(notUndefinedAndNotUndefinedC);
 }
 
 /**
@@ -142,5 +162,17 @@ testPreCompiler::testIfDefOr()
     CPPUNIT_ASSERT(undefinedOrFalseB);
     CPPUNIT_ASSERT(!undefinedOrTrueB);
 
+#if UNDEFINED_FOO || UNDEFINED_FOO
+    bool undefinedOrUndefinedC = true;
+#else
+    bool undefinedOrUndefinedC = false;
+#endif
+#if !UNDEFINED_FOO || !UNDEFINED_FOO
+    bool notUndefinedOrNotUndefinedC = true;
+#else
+    bool notUndefinedOrNotUndefinedC = false;
+#endif
+    CPPUNIT_ASSERT(notUndefinedOrNotUndefinedC);
+    CPPUNIT_ASSERT(!undefinedOrUndefinedC);
 }