Changeset 58065 in vbox for trunk/src/VBox/Runtime/testcase
- Timestamp:
- Oct 6, 2015 6:49:19 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstRTUri.cpp
r58063 r58065 314 314 /* .pszUri =*/ "file:///C:%5Cover%5C%20%3C%3E%23%25%22%7B%7D%7C%5E%5B%5D%60%5Cthere", 315 315 /* .uFormat =*/ URI_FILE_FORMAT_WIN, 316 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */317 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */316 /* .pszCreatedPath =*/ "C:\\over\\ <>#%\"{}|^[]`\\there", 317 /* .pszCreatedUri =*/ "file:///C:%5Cover%5C%20%3C%3E%23%25%22%7B%7D%7C%5E%5B%5D%60%5Cthere", 318 318 /* PathCreateFromUrl = "C:\\over\\ <>#%\"{}|^[]`\\there" - same */ 319 319 /* UrlCreateFromPath = "file:///C:/over/%20%3C%3E%23%25%22%7B%7D%7C%5E%5B%5D%60/there" - differs */ … … 323 323 /* .pszUri =*/ "file:///over/%20%3C%3E%23%25%22%7B%7D%7C%5E%5B%5D%60/there", 324 324 /* .uFormat =*/ URI_FILE_FORMAT_UNIX, 325 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */326 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */325 /* .pszCreatedPath =*/ "/over/ <>#%\"{}|^[]`/there", 326 /* .pszCreatedUri =*/ "file:///over/%20%3C%3E%23%25%22%7B%7D%7C%5E%5B%5D%60/there", 327 327 /* PathCreateFromUrl = "\\over\\ <>#%\"{}|^[]`\\there" - differs */ 328 328 /* UrlCreateFromPath = "file:///over/%20%3C%3E%23%25%22%7B%7D%7C%5E%5B%5D%60/there" - same */ … … 332 332 /* .pszUri =*/ "file://", 333 333 /* .uFormat =*/ URI_FILE_FORMAT_UNIX, 334 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */335 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */334 /* .pszCreatedPath =*/ NULL, 335 /* .pszCreatedUri =*/ "file://", 336 336 /* PathCreateFromUrl = "" - differs */ 337 337 /* UrlCreateFromPath => 0x80070057 (E_INVALIDARG) */ … … 341 341 /* .pszUri =*/ "file://", 342 342 /* .uFormat =*/ URI_FILE_FORMAT_WIN, 343 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */344 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */343 /* .pszCreatedPath =*/ NULL, 344 /* .pszCreatedUri =*/ "file://", 345 345 /* PathCreateFromUrl = "" - differs */ 346 346 /* UrlCreateFromPath => 0x80070057 (E_INVALIDARG) */ … … 350 350 /* .pszUri =*/ "file:///", 351 351 /* .uFormat =*/ URI_FILE_FORMAT_UNIX, 352 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */353 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */352 /* .pszCreatedPath =*/ "/", 353 /* .pszCreatedUri =*/ "file:///", 354 354 /* PathCreateFromUrl = "" - differs */ 355 355 /* UrlCreateFromPath = "file:///" - same */ … … 359 359 /* .pszUri =*/ "file:///", 360 360 /* .uFormat =*/ URI_FILE_FORMAT_WIN, 361 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */362 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */361 /* .pszCreatedPath =*/ "\\", 362 /* .pszCreatedUri =*/ "file:///", 363 363 /* PathCreateFromUrl = "" - differs */ 364 364 /* UrlCreateFromPath = "file:///" - same */ … … 368 368 /* .pszUri =*/ "file:///foo/bar", 369 369 /* .uFormat =*/ URI_FILE_FORMAT_UNIX, 370 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */371 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */370 /* .pszCreatedPath =*/ "/foo/bar", 371 /* .pszCreatedUri =*/ "file:///foo/bar", 372 372 /* PathCreateFromUrl = "\\foo\\bar" - differs */ 373 373 /* UrlCreateFromPath = "file:///foo/bar" - same */ … … 377 377 /* .pszUri =*/ "file:///foo%5Cbar", 378 378 /* .uFormat =*/ URI_FILE_FORMAT_WIN, 379 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */380 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */379 /* .pszCreatedPath =*/ "\\foo\\bar", 380 /* .pszCreatedUri =*/ "file:///foo%5Cbar", 381 381 /* PathCreateFromUrl = "\\foo\\bar" - same */ 382 382 /* UrlCreateFromPath = "file:///foo/bar" - differs */ … … 386 386 /* .pszUri =*/ "file:///C:/over/%20%3C%3E%23%25%22%7B%7D%7C%5E%5B%5D%60/there", 387 387 /* .uFormat =*/ URI_FILE_FORMAT_UNIX, 388 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */389 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */388 /* .pszCreatedPath =*/ "C:/over/ <>#%\"{}|^[]`/there", 389 /* .pszCreatedUri =*/ "file:///C:/over/%20%3C%3E%23%25%22%7B%7D%7C%5E%5B%5D%60/there", 390 390 /* PathCreateFromUrl = "C:\\over\\ <>#%\"{}|^[]`\\there" - differs */ 391 391 /* UrlCreateFromPath = "file:///C:/over/%20%3C%3E%23%25%22%7B%7D%7C%5E%5B%5D%60/there" - same */ … … 395 395 /* .pszUri =*/ "file:///over%5C%20%3C%3E%23%25%22%7B%7D%7C%5E%5B%5D%60%5Cthere", 396 396 /* .uFormat =*/ URI_FILE_FORMAT_WIN, 397 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */398 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */397 /* .pszCreatedPath =*/ "\\over\\ <>#%\"{}|^[]`\\there", 398 /* .pszCreatedUri =*/ "file:///over%5C%20%3C%3E%23%25%22%7B%7D%7C%5E%5B%5D%60%5Cthere", 399 399 /* PathCreateFromUrl = "\\over\\ <>#%\"{}|^[]`\\there" - same */ 400 400 /* UrlCreateFromPath = "file:///over/%20%3C%3E%23%25%22%7B%7D%7C%5E%5B%5D%60/there" - differs */ … … 404 404 /* .pszUri =*/ "file:///usr/bin/grep", 405 405 /* .uFormat =*/ URI_FILE_FORMAT_UNIX, 406 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */407 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */406 /* .pszCreatedPath =*/ "/usr/bin/grep", 407 /* .pszCreatedUri =*/ "file:///usr/bin/grep", 408 408 /* PathCreateFromUrl = "\\usr\\bin\\grep" - differs */ 409 409 /* UrlCreateFromPath = "file:///usr/bin/grep" - same */ … … 413 413 /* .pszUri =*/ "file:///usr%5Cbin%5Cgrep", 414 414 /* .uFormat =*/ URI_FILE_FORMAT_WIN, 415 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */416 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */415 /* .pszCreatedPath =*/ "\\usr\\bin\\grep", 416 /* .pszCreatedUri =*/ "file:///usr%5Cbin%5Cgrep", 417 417 /* PathCreateFromUrl = "\\usr\\bin\\grep" - same */ 418 418 /* UrlCreateFromPath = "file:///usr/bin/grep" - differs */ … … 422 422 /* .pszUri =*/ "file:///somerootsubdir/isos/files.lst", 423 423 /* .uFormat =*/ URI_FILE_FORMAT_UNIX, 424 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */425 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */424 /* .pszCreatedPath =*/ "/somerootsubdir/isos/files.lst", 425 /* .pszCreatedUri =*/ "file:///somerootsubdir/isos/files.lst", 426 426 /* PathCreateFromUrl = "\\somerootsubdir\\isos\\files.lst" - differs */ 427 427 /* UrlCreateFromPath = "file:///somerootsubdir/isos/files.lst" - same */ … … 431 431 /* .pszUri =*/ "file:///not-a-cifsserver%5Cisos%5Cfiles.lst", 432 432 /* .uFormat =*/ URI_FILE_FORMAT_WIN, 433 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */434 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */433 /* .pszCreatedPath =*/ "\\not-a-cifsserver\\isos\\files.lst", 434 /* .pszCreatedUri =*/ "file:///not-a-cifsserver%5Cisos%5Cfiles.lst", 435 435 /* PathCreateFromUrl = "\\not-a-cifsserver\\isos\\files.lst" - same */ 436 436 /* UrlCreateFromPath = "file:///not-a-cifsserver/isos/files.lst" - differs */ … … 440 440 /* .pszUri =*/ "file:///rootsubdir/isos/files.lst", 441 441 /* .uFormat =*/ URI_FILE_FORMAT_UNIX, 442 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */443 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */442 /* .pszCreatedPath =*/ "/rootsubdir/isos/files.lst", 443 /* .pszCreatedUri =*/ "file:///rootsubdir/isos/files.lst", 444 444 /* PathCreateFromUrl = "\\rootsubdir\\isos\\files.lst" - differs */ 445 445 /* UrlCreateFromPath = "file:///rootsubdir/isos/files.lst" - same */ … … 449 449 /* .pszUri =*/ "file:///not-a-cifsserver-either%5Cisos%5Cfiles.lst", 450 450 /* .uFormat =*/ URI_FILE_FORMAT_WIN, 451 /* .pszCreatedPath =*/ NULL, /* Same as pszPath. */452 /* .pszCreatedUri =*/ NULL, /* Same as pszUri. */451 /* .pszCreatedPath =*/ "\\not-a-cifsserver-either\\isos\\files.lst", 452 /* .pszCreatedUri =*/ "file:///not-a-cifsserver-either%5Cisos%5Cfiles.lst", 453 453 /* PathCreateFromUrl = "\\not-a-cifsserver-either\\isos\\files.lst" - same */ 454 454 /* UrlCreateFromPath = "file:///not-a-cifsserver-either/isos/files.lst" - differs */ … … 537 537 : g_aCreateFileURIs[i].uFormat == URI_FILE_FORMAT_AUTO ? "URI_FILE_FORMAT_AUTO" : "URI_FILE_FORMAT_INVALID"); 538 538 RTPrintf(" /* .pszCreatedPath =*/ "); 539 if (g_aCreateFileURIs[i].pszCreatedPath == NULL) 540 RTPrintf("NULL, /* Same as pszPath. */\n"); 541 else 542 { 543 tstPrintCString(g_aCreateFileURIs[i].pszCreatedPath); 544 RTPrintf(",\n"); 545 } 539 tstPrintCString(g_aCreateFileURIs[i].pszCreatedPath); 540 RTPrintf(",\n"); 546 541 RTPrintf(" /* .pszCreatedUri =*/ "); 547 if (g_aCreateFileURIs[i].pszCreatedUri == NULL) 548 RTPrintf("NULL, /* Same as pszUri. */\n"); 549 else 550 { 551 tstPrintCString(g_aCreateFileURIs[i].pszCreatedUri); 552 RTPrintf(",\n"); 553 } 542 tstPrintCString(g_aCreateFileURIs[i].pszCreatedUri); 543 RTPrintf(",\n"); 554 544 555 545 /* … … 572 562 tstPrintCString(pszResult); 573 563 if ( g_aCreateFileURIs[i].pszPath 574 && strcmp(pszResult, g_aCreateFileURIs[i].pszCreatedPath 575 ? g_aCreateFileURIs[i].pszCreatedPath : g_aCreateFileURIs[i].pszPath) == 0) 564 && strcmp(pszResult, g_aCreateFileURIs[i].pszCreatedPath) == 0) 576 565 RTPrintf(" - same */\n"); 577 566 else … … 605 594 tstPrintCString(pszResult); 606 595 if ( g_aCreateFileURIs[i].pszUri 607 && strcmp(pszResult, g_aCreateFileURIs[i].pszCreatedUri 608 ? g_aCreateFileURIs[i].pszCreatedUri : g_aCreateFileURIs[i].pszUri) == 0) 596 && strcmp(pszResult, g_aCreateFileURIs[i].pszCreatedUri) == 0) 609 597 RTPrintf(" - same */\n"); 610 598 else … … 679 667 #endif 680 668 669 bool fSavedMayPanic = RTAssertSetMayPanic(false); 670 bool fSavedQuiet = RTAssertSetQuiet(true); 671 681 672 /* File Uri path */ 682 673 RTTestISub("RTUriFilePath"); 683 674 for (size_t i = 0; i < RT_ELEMENTS(g_aCreateFileURIs); ++i) 684 675 CHECK_STR_API(RTUriFilePath(g_aCreateFileURIs[i].pszUri, g_aCreateFileURIs[i].uFormat), 685 g_aCreateFileURIs[i].pszCreatedPath ? g_aCreateFileURIs[i].pszCreatedPath : g_aCreateFileURIs[i].pszPath);676 g_aCreateFileURIs[i].pszCreatedPath); 686 677 687 678 /* File Uri creation */ 688 679 RTTestISub("RTUriFileCreate"); 689 680 for (size_t i = 0; i < RT_ELEMENTS(g_aCreateFileURIs); ++i) 690 CHECK_STR_API(RTUriFileCreate(g_aCreateFileURIs[i].pszPath), 691 g_aCreateFileURIs[i].pszCreatedUri ? g_aCreateFileURIs[i].pszCreatedUri : g_aCreateFileURIs[i].pszUri); 681 CHECK_STR_API(RTUriFileCreate(g_aCreateFileURIs[i].pszPath), g_aCreateFileURIs[i].pszCreatedUri); 682 683 RTAssertSetMayPanic(fSavedMayPanic); 684 RTAssertSetQuiet(fSavedQuiet); 692 685 693 686 return RTTestSummaryAndDestroy(hTest);
Note:
See TracChangeset
for help on using the changeset viewer.