Differences From Artifact [b4df7e9977]:
- File tests/OFXMLParserTests.m — part of check-in [4c8d02cc0d] at 2017-01-18 03:45:05 on branch trunk — Move parsing of encoding names to a single place (user: js, size: 11821) [annotate] [blame] [check-ins using]
To Artifact [278894d6bc]:
- File
tests/OFXMLParserTests.m
— part of check-in
[4af49a13c3]
at
2017-05-07 20:10:13
on branch trunk
— Small code style change
Casts are now written like types in variable declarations. (user: js, size: 11851) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
40 41 42 43 44 45 46 | STRING, CDATA, COMMENT }; @implementation TestsAppDelegate (OFXMLParser) - (void)parserCallbackWithEventType: (enum event_type)et | | | | | | | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | STRING, CDATA, COMMENT }; @implementation TestsAppDelegate (OFXMLParser) - (void)parserCallbackWithEventType: (enum event_type)et name: (OFString *)name prefix: (OFString *)prefix namespace: (OFString *)ns attributes: (OFArray *)attrs string: (OFString *)string { OFString *msg; i++; msg = [OFString stringWithFormat: @"Parsing part #%d", i]; switch (i) { |
︙ | ︙ | |||
237 238 239 240 241 242 243 | case 32: TEST(msg, et == TAG_END && [name isEqual: @"root"] && prefix == nil && ns == nil); break; } } | | | | | | | | | | | | | | | | | | | | | 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | case 32: TEST(msg, et == TAG_END && [name isEqual: @"root"] && prefix == nil && ns == nil); break; } } - (void)parser: (OFXMLParser *)parser foundProcessingInstructions: (OFString *)pi { [self parserCallbackWithEventType: PROCESSING_INSTRUCTIONS name: nil prefix: nil namespace: nil attributes: nil string: pi]; } - (void)parser: (OFXMLParser *)parser didStartElement: (OFString *)name prefix: (OFString *)prefix namespace: (OFString *)ns attributes: (OFArray *)attrs { [self parserCallbackWithEventType: TAG_START name: name prefix: prefix namespace: ns attributes: attrs string: nil]; } - (void)parser: (OFXMLParser *)parser didEndElement: (OFString *)name prefix: (OFString *)prefix namespace: (OFString *)ns { [self parserCallbackWithEventType: TAG_END name: name prefix: prefix namespace: ns attributes: nil string: nil]; } - (void)parser: (OFXMLParser *)parser foundCharacters: (OFString *)string { [self parserCallbackWithEventType: STRING name: nil prefix: nil namespace: nil attributes: nil string: string]; } - (void)parser: (OFXMLParser *)parser foundCDATA: (OFString *)cdata { [self parserCallbackWithEventType: CDATA name: nil prefix: nil namespace: nil attributes: nil string: cdata]; } - (void)parser: (OFXMLParser *)parser foundComment: (OFString *)comment { [self parserCallbackWithEventType: COMMENT name: nil prefix: nil namespace: nil attributes: nil string: comment]; } - (OFString *)parser: (OFXMLParser *)parser foundUnknownEntityNamed: (OFString *)entity { if ([entity isEqual: @"foo"]) return @"foobar"; return nil; } |
︙ | ︙ |