Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: third_party/libxml/src/testdict.c

Issue 1752223002: Roll libxml to 2.9.3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-cherry-pick fprintf formatting fix. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include <string.h> 1 #include <string.h>
2 #include <libxml/parser.h> 2 #include <libxml/parser.h>
3 #include <libxml/dict.h> 3 #include <libxml/dict.h>
4 4
5 /* #define WITH_PRINT */ 5 /* #define WITH_PRINT */
6 6
7 static const char *seeds1[] = { 7 static const char *seeds1[] = {
8 "a", "b", "c", 8 "a", "b", "c",
9 "d", "e", "f", 9 "d", "e", "f",
10 "g", "h", "i", 10 "g", "h", "i",
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 /* 270 /*
271 * check the QName lookups 271 * check the QName lookups
272 */ 272 */
273 for (i = NB_STRINGS_MAX - NB_STRINGS_NS;i < NB_STRINGS_MAX;i++) { 273 for (i = NB_STRINGS_MAX - NB_STRINGS_NS;i < NB_STRINGS_MAX;i++) {
274 cur = strings2[i]; 274 cur = strings2[i];
275 pref = &prefix[0]; 275 pref = &prefix[0];
276 while (*cur != ':') *pref++ = *cur++; 276 while (*cur != ':') *pref++ = *cur++;
277 cur++; 277 cur++;
278 *pref = 0; 278 *pref = 0;
279 tmp = xmlDictQLookup(dict, &prefix[0], cur); 279 tmp = xmlDictQLookup(dict, &prefix[0], cur);
280 » if (xmlDictQLookup(dict, &prefix[0], cur) != test2[i]) { 280 » if (tmp != test2[i]) {
281 fprintf(stderr, "Failed lookup check for '%s':'%s'\n", 281 fprintf(stderr, "Failed lookup check for '%s':'%s'\n",
282 &prefix[0], cur); 282 &prefix[0], cur);
283 ret = 1; 283 ret = 1;
284 nbErrors++; 284 nbErrors++;
285 } 285 }
286 } 286 }
287 /* 287 /*
288 * check the QName lookups for strings from the parent 288 * check the QName lookups for strings from the parent
289 */ 289 */
290 for (i = NB_STRINGS_MAX - NB_STRINGS_NS;i < NB_STRINGS_MAX;i++) { 290 for (i = NB_STRINGS_MAX - NB_STRINGS_NS;i < NB_STRINGS_MAX;i++) {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 /* 401 /*
402 * More complex, check the QName lookups 402 * More complex, check the QName lookups
403 */ 403 */
404 for (i = NB_STRINGS_MAX - NB_STRINGS_NS;i < NB_STRINGS_MAX;i++) { 404 for (i = NB_STRINGS_MAX - NB_STRINGS_NS;i < NB_STRINGS_MAX;i++) {
405 cur = strings1[i]; 405 cur = strings1[i];
406 pref = &prefix[0]; 406 pref = &prefix[0];
407 while (*cur != ':') *pref++ = *cur++; 407 while (*cur != ':') *pref++ = *cur++;
408 cur++; 408 cur++;
409 *pref = 0; 409 *pref = 0;
410 tmp = xmlDictQLookup(dict, &prefix[0], cur); 410 tmp = xmlDictQLookup(dict, &prefix[0], cur);
411 » if (xmlDictQLookup(dict, &prefix[0], cur) != test1[i]) { 411 » if (tmp != test1[i]) {
412 fprintf(stderr, "Failed lookup check for '%s':'%s'\n", 412 fprintf(stderr, "Failed lookup check for '%s':'%s'\n",
413 &prefix[0], cur); 413 &prefix[0], cur);
414 ret = 1; 414 ret = 1;
415 nbErrors++; 415 nbErrors++;
416 } 416 }
417 } 417 }
418 418
419 run_test2(dict); 419 run_test2(dict);
420 420
421 xmlDictFree(dict); 421 xmlDictFree(dict);
(...skipping 13 matching lines...) Expand all
435 if (ret == 0) { 435 if (ret == 0) {
436 printf("dictionary tests succeeded %d strings\n", 2 * NB_STRINGS_MAX); 436 printf("dictionary tests succeeded %d strings\n", 2 * NB_STRINGS_MAX);
437 } else { 437 } else {
438 printf("dictionary tests failed with %d errors\n", nbErrors); 438 printf("dictionary tests failed with %d errors\n", nbErrors);
439 } 439 }
440 clean_strings(); 440 clean_strings();
441 xmlCleanupParser(); 441 xmlCleanupParser();
442 xmlMemoryDump(); 442 xmlMemoryDump();
443 return(ret); 443 return(ret);
444 } 444 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698