63
63
CPPUNIT_ASSERT(undefinedFalse);
64
64
CPPUNIT_ASSERT(!undefinedTrue);
68
* Test several ways of defining pre-compiler directives.
69
* Squid-3 uses #if FOO syntax for precompiler directives.
70
* These tests ensure that the inputs will work as expected
71
* when undefined macros are used in && conditions
74
testPreCompiler::testIfDefAnd()
76
/* Not Defined to exist at all == false - when used in a compound if */
80
#if UNDEFINED_FOO && ONE_FOO
81
bool undefinedAndTrueA = true;
83
bool undefinedAndTrueA = false;
85
#if !UNDEFINED_FOO && ONE_FOO
86
bool undefinedAndFalseA = true;
88
bool undefinedAndFalseA = false;
90
CPPUNIT_ASSERT(undefinedAndFalseA);
91
CPPUNIT_ASSERT(!undefinedAndTrueA);
93
#if ONE_FOO && UNDEFINED_FOO
94
bool undefinedAndTrueB = true;
96
bool undefinedAndTrueB = false;
98
#if ONE_FOO && !UNDEFINED_FOO
99
bool undefinedAndFalseB = true;
101
bool undefinedAndFalseB = false;
103
CPPUNIT_ASSERT(undefinedAndFalseB);
104
CPPUNIT_ASSERT(!undefinedAndTrueB);
108
* Test several ways of defining pre-compiler directives.
109
* Squid-3 uses #if FOO syntax for precompiler directives.
110
* These tests ensure that the inputs will work as expected
111
* when undefined macros are used in || conditions
114
testPreCompiler::testIfDefOr()
116
/* Not Defined to exist at all == false - when used in a compound if */
120
#if UNDEFINED_FOO || ZERO_FOO
121
bool undefinedOrTrueA = true;
123
bool undefinedOrTrueA = false;
125
#if !UNDEFINED_FOO || ZERO_FOO
126
bool undefinedOrFalseA = true;
128
bool undefinedOrFalseA = false;
130
CPPUNIT_ASSERT(undefinedOrFalseA);
131
CPPUNIT_ASSERT(!undefinedOrTrueA);
133
#if ZERO_FOO || UNDEFINED_FOO
134
bool undefinedOrTrueB = true;
136
bool undefinedOrTrueB = false;
138
#if ZERO_FOO || !UNDEFINED_FOO
139
bool undefinedOrFalseB = true;
141
bool undefinedOrFalseB = false;
143
CPPUNIT_ASSERT(undefinedOrFalseB);
144
CPPUNIT_ASSERT(!undefinedOrTrueB);