~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to compat/testPreCompiler.cc

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2011-01-21 18:43:56 UTC
  • mfrom: (1.4.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: james.westby@ubuntu.com-20110121184356-4zn7gwuzws6lpnuc
Tags: 3.1.10-1
* New upstream release (Closes: #609881)
  - Removed patches integrated upstream
    + 16-CVE-2010-3072
    + 17-CVE-2010-2951
  - Fixes TCP DNS lookups failure on IPv6-disabled systems (Closes: #607379)
  - Fixes HTTPS not working if IPv6 is disabled (Closes: #594713)

* debian/rules
  - Enable ZPH feature (Closes: #597687)

* debian/squid3.ufw.profile
  - Added UFW profile, thanks to Alessio Treglia (Closes: #605088)

* debian/control
  - Added versioned dependency on squid-langpack

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
    CPPUNIT_ASSERT(undefinedFalse);
64
64
    CPPUNIT_ASSERT(!undefinedTrue);
65
65
}
 
66
 
 
67
/**
 
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
 
72
 */
 
73
void
 
74
testPreCompiler::testIfDefAnd()
 
75
{
 
76
    /* Not Defined to exist at all == false - when used in a compound if */
 
77
#undef UNDEFINED_FOO
 
78
#define ONE_FOO 1
 
79
 
 
80
#if UNDEFINED_FOO && ONE_FOO
 
81
    bool undefinedAndTrueA = true;
 
82
#else
 
83
    bool undefinedAndTrueA = false;
 
84
#endif
 
85
#if !UNDEFINED_FOO && ONE_FOO
 
86
    bool undefinedAndFalseA = true;
 
87
#else
 
88
    bool undefinedAndFalseA = false;
 
89
#endif
 
90
    CPPUNIT_ASSERT(undefinedAndFalseA);
 
91
    CPPUNIT_ASSERT(!undefinedAndTrueA);
 
92
 
 
93
#if ONE_FOO && UNDEFINED_FOO
 
94
    bool undefinedAndTrueB = true;
 
95
#else
 
96
    bool undefinedAndTrueB = false;
 
97
#endif
 
98
#if ONE_FOO && !UNDEFINED_FOO
 
99
    bool undefinedAndFalseB = true;
 
100
#else
 
101
    bool undefinedAndFalseB = false;
 
102
#endif
 
103
    CPPUNIT_ASSERT(undefinedAndFalseB);
 
104
    CPPUNIT_ASSERT(!undefinedAndTrueB);
 
105
}
 
106
 
 
107
/**
 
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
 
112
 */
 
113
void
 
114
testPreCompiler::testIfDefOr()
 
115
{
 
116
    /* Not Defined to exist at all == false - when used in a compound if */
 
117
#undef UNDEFINED_FOO
 
118
#define ZERO_FOO 0
 
119
 
 
120
#if UNDEFINED_FOO || ZERO_FOO
 
121
    bool undefinedOrTrueA = true;
 
122
#else
 
123
    bool undefinedOrTrueA = false;
 
124
#endif
 
125
#if !UNDEFINED_FOO || ZERO_FOO
 
126
    bool undefinedOrFalseA = true;
 
127
#else
 
128
    bool undefinedOrFalseA = false;
 
129
#endif
 
130
    CPPUNIT_ASSERT(undefinedOrFalseA);
 
131
    CPPUNIT_ASSERT(!undefinedOrTrueA);
 
132
 
 
133
#if ZERO_FOO || UNDEFINED_FOO
 
134
    bool undefinedOrTrueB = true;
 
135
#else
 
136
    bool undefinedOrTrueB = false;
 
137
#endif
 
138
#if ZERO_FOO || !UNDEFINED_FOO
 
139
    bool undefinedOrFalseB = true;
 
140
#else
 
141
    bool undefinedOrFalseB = false;
 
142
#endif
 
143
    CPPUNIT_ASSERT(undefinedOrFalseB);
 
144
    CPPUNIT_ASSERT(!undefinedOrTrueB);
 
145
 
 
146
}
 
147