Index: trunk/phase3/includes/normal/UtfNormalTest.php |
— | — | @@ -87,7 +87,7 @@ |
88 | 88 | |
89 | 89 | $testedChars[$columns[1]] = true; |
90 | 90 | $total++; |
91 | | - if( testNormals( $normalizer, $columns, $comment ) ) { |
| 91 | + if( testNormals( $normalizer, $columns, $comment, $verbose ) ) { |
92 | 92 | $success++; |
93 | 93 | } else { |
94 | 94 | $failure++; |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | } |
121 | 121 | if( empty( $testedChars[$char] ) ) { |
122 | 122 | $total++; |
123 | | - if( testInvariant( $normalizer, $char, $desc ) ) { |
| 123 | + if( testInvariant( $normalizer, $char, $desc, $verbose ) ) { |
124 | 124 | $success++; |
125 | 125 | } else { |
126 | 126 | $failure++; |
— | — | @@ -154,17 +154,16 @@ |
155 | 155 | return $ok; |
156 | 156 | } |
157 | 157 | |
158 | | -function testNormals( &$u, $c, $comment, $reportFailure = false ) { |
| 158 | +function testNormals( &$u, $c, $comment, $verbose, $reportFailure = false ) { |
159 | 159 | $result = testNFC( $u, $c, $comment, $reportFailure ); |
160 | 160 | $result = testNFD( $u, $c, $comment, $reportFailure ) && $result; |
161 | 161 | $result = testNFKC( $u, $c, $comment, $reportFailure ) && $result; |
162 | 162 | $result = testNFKD( $u, $c, $comment, $reportFailure ) && $result; |
163 | 163 | $result = testCleanUp( $u, $c, $comment, $reportFailure ) && $result; |
164 | 164 | |
165 | | - global $verbose; |
166 | 165 | if( $verbose && !$result && !$reportFailure ) { |
167 | 166 | print $comment; |
168 | | - testNormals( $u, $c, $comment, true ); |
| 167 | + testNormals( $u, $c, $comment, $verbose, true ); |
169 | 168 | } |
170 | 169 | return $result; |
171 | 170 | } |
— | — | @@ -232,16 +231,16 @@ |
233 | 232 | return $result; |
234 | 233 | } |
235 | 234 | |
236 | | -function testInvariant( &$u, $char, $desc, $reportFailure = false ) { |
| 235 | +function testInvariant( &$u, $char, $desc, $verbose, $reportFailure = false ) { |
237 | 236 | $result = verbosify( $char, $u->toNFC( $char ), 1, 'NFC', $reportFailure ); |
238 | 237 | $result = verbosify( $char, $u->toNFD( $char ), 1, 'NFD', $reportFailure ) && $result; |
239 | 238 | $result = verbosify( $char, $u->toNFKC( $char ), 1, 'NFKC', $reportFailure ) && $result; |
240 | 239 | $result = verbosify( $char, $u->toNFKD( $char ), 1, 'NFKD', $reportFailure ) && $result; |
241 | 240 | $result = verbosify( $char, $u->cleanUp( $char ), 1, 'cleanUp', $reportFailure ) && $result; |
242 | | - global $verbose; |
| 241 | + |
243 | 242 | if( $verbose && !$result && !$reportFailure ) { |
244 | 243 | print $desc; |
245 | | - testInvariant( $u, $char, $desc, true ); |
| 244 | + testInvariant( $u, $char, $desc, $verbose, true ); |
246 | 245 | } |
247 | 246 | return $result; |
248 | 247 | } |