Changeset 38469 in vbox for trunk/src/VBox/Storage/testcase/tstVD.cpp
- Timestamp:
- Aug 16, 2011 10:34:32 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/testcase/tstVD.cpp
r33567 r38469 68 68 VDGEOMETRY LCHS = { 0, 0, 0 }; 69 69 PVDINTERFACE pVDIfs = NULL; 70 VDINTERFACE VDIError; 71 VDINTERFACEERROR VDIErrorCallbacks; 70 VDINTERFACEERROR VDIfError; 72 71 73 72 #define CHECK(str) \ … … 83 82 84 83 /* Create error interface. */ 85 VDIErrorCallbacks.cbSize = sizeof(VDINTERFACEERROR); 86 VDIErrorCallbacks.enmInterface = VDINTERFACETYPE_ERROR; 87 VDIErrorCallbacks.pfnError = tstVDError; 88 VDIErrorCallbacks.pfnMessage = tstVDMessage; 89 90 rc = VDInterfaceAdd(&VDIError, "tstVD_Error", VDINTERFACETYPE_ERROR, &VDIErrorCallbacks, 91 NULL, &pVDIfs); 84 VDIfError.pfnError = tstVDError; 85 VDIfError.pfnMessage = tstVDMessage; 86 87 rc = VDInterfaceAdd(&VDIfError.Core, "tstVD_Error", VDINTERFACETYPE_ERROR, 88 NULL, sizeof(VDINTERFACEERROR), &pVDIfs); 92 89 AssertRC(rc); 93 90 94 rc = VDCreate( &VDIError, VDTYPE_HDD, &pVD);91 rc = VDCreate(pVDIfs, VDTYPE_HDD, &pVD); 95 92 CHECK("VDCreate()"); 96 93 … … 126 123 VDGEOMETRY LCHS = { 0, 0, 0 }; 127 124 PVDINTERFACE pVDIfs = NULL; 128 VDINTERFACE VDIError; 129 VDINTERFACEERROR VDIErrorCallbacks; 125 VDINTERFACEERROR VDIfError; 130 126 131 127 #define CHECK(str) \ … … 141 137 142 138 /* Create error interface. */ 143 VDIErrorCallbacks.cbSize = sizeof(VDINTERFACEERROR); 144 VDIErrorCallbacks.enmInterface = VDINTERFACETYPE_ERROR; 145 VDIErrorCallbacks.pfnError = tstVDError; 146 VDIErrorCallbacks.pfnMessage = tstVDMessage; 147 148 rc = VDInterfaceAdd(&VDIError, "tstVD_Error", VDINTERFACETYPE_ERROR, &VDIErrorCallbacks, 149 NULL, &pVDIfs); 139 VDIfError.pfnError = tstVDError; 140 VDIfError.pfnMessage = tstVDMessage; 141 142 rc = VDInterfaceAdd(&VDIfError.Core, "tstVD_Error", VDINTERFACETYPE_ERROR, 143 NULL, sizeof(VDINTERFACEERROR), &pVDIfs); 150 144 AssertRC(rc); 151 145 152 rc = VDCreate(&VDIError, VDTYPE_HDD, &pVD); 146 147 rc = VDCreate(pVDIfs, VDTYPE_HDD, &pVD); 153 148 CHECK("VDCreate()"); 154 149 … … 511 506 uint32_t u32SectorSize = 512; 512 507 PVDINTERFACE pVDIfs = NULL; 513 VDINTERFACE VDIError; 514 VDINTERFACEERROR VDIErrorCallbacks; 508 VDINTERFACEERROR VDIfError; 515 509 516 510 #define CHECK(str) \ … … 530 524 531 525 /* Create error interface. */ 532 VDIErrorCallbacks.cbSize = sizeof(VDINTERFACEERROR); 533 VDIErrorCallbacks.enmInterface = VDINTERFACETYPE_ERROR; 534 VDIErrorCallbacks.pfnError = tstVDError; 535 VDIErrorCallbacks.pfnMessage = tstVDMessage; 536 537 rc = VDInterfaceAdd(&VDIError, "tstVD_Error", VDINTERFACETYPE_ERROR, &VDIErrorCallbacks, 538 NULL, &pVDIfs); 526 VDIfError.pfnError = tstVDError; 527 VDIfError.pfnMessage = tstVDMessage; 528 529 rc = VDInterfaceAdd(&VDIfError.Core, "tstVD_Error", VDINTERFACETYPE_ERROR, 530 NULL, sizeof(VDINTERFACEERROR), &pVDIfs); 539 531 AssertRC(rc); 540 532 541 533 542 rc = VDCreate( &VDIError, VDTYPE_HDD, &pVD);534 rc = VDCreate(pVDIfs, VDTYPE_HDD, &pVD); 543 535 CHECK("VDCreate()"); 544 536 … … 636 628 uint32_t u32SectorSize = 512; 637 629 PVDINTERFACE pVDIfs = NULL; 638 VDINTERFACE VDIError; 639 VDINTERFACEERROR VDIErrorCallbacks; 630 VDINTERFACEERROR VDIfError; 640 631 641 632 #define CHECK(str) \ … … 655 646 656 647 /* Create error interface. */ 657 VDIErrorCallbacks.cbSize = sizeof(VDINTERFACEERROR); 658 VDIErrorCallbacks.enmInterface = VDINTERFACETYPE_ERROR; 659 VDIErrorCallbacks.pfnError = tstVDError; 660 VDIErrorCallbacks.pfnMessage = tstVDMessage; 661 662 rc = VDInterfaceAdd(&VDIError, "tstVD_Error", VDINTERFACETYPE_ERROR, &VDIErrorCallbacks, 663 NULL, &pVDIfs); 648 VDIfError.pfnError = tstVDError; 649 VDIfError.pfnMessage = tstVDMessage; 650 651 rc = VDInterfaceAdd(&VDIfError.Core, "tstVD_Error", VDINTERFACETYPE_ERROR, 652 NULL, sizeof(VDINTERFACEERROR), &pVDIfs); 664 653 AssertRC(rc); 665 654 666 667 rc = VDCreate(&VDIError, VDTYPE_HDD, &pVD); 655 rc = VDCreate(pVDIfs, VDTYPE_HDD, &pVD); 668 656 CHECK("VDCreate()"); 669 657 … … 715 703 PVBOXHDD pVD = NULL; 716 704 PVDINTERFACE pVDIfs = NULL; 717 VDINTERFACE VDIError; 718 VDINTERFACEERROR VDIErrorCallbacks; 705 VDINTERFACEERROR VDIfError; 719 706 720 707 #define CHECK(str) \ … … 730 717 731 718 /* Create error interface. */ 732 VDIErrorCallbacks.cbSize = sizeof(VDINTERFACEERROR); 733 VDIErrorCallbacks.enmInterface = VDINTERFACETYPE_ERROR; 734 VDIErrorCallbacks.pfnError = tstVDError; 735 VDIErrorCallbacks.pfnMessage = tstVDMessage; 736 737 rc = VDInterfaceAdd(&VDIError, "tstVD_Error", VDINTERFACETYPE_ERROR, &VDIErrorCallbacks, 738 NULL, &pVDIfs); 719 VDIfError.pfnError = tstVDError; 720 VDIfError.pfnMessage = tstVDMessage; 721 722 rc = VDInterfaceAdd(&VDIfError.Core, "tstVD_Error", VDINTERFACETYPE_ERROR, 723 NULL, sizeof(VDINTERFACEERROR), &pVDIfs); 739 724 AssertRC(rc); 740 725 741 rc = VDCreate( &VDIError, VDTYPE_HDD, &pVD);726 rc = VDCreate(pVDIfs, VDTYPE_HDD, &pVD); 742 727 CHECK("VDCreate()"); 743 728 … … 766 751 PVBOXHDD pVD = NULL; 767 752 PVDINTERFACE pVDIfs = NULL; 768 VDINTERFACE VDIError; 769 VDINTERFACEERROR VDIErrorCallbacks; 753 VDINTERFACEERROR VDIfError; 770 754 771 755 #define CHECK(str) \ … … 781 765 782 766 /* Create error interface. */ 783 VDIErrorCallbacks.cbSize = sizeof(VDINTERFACEERROR); 784 VDIErrorCallbacks.enmInterface = VDINTERFACETYPE_ERROR; 785 VDIErrorCallbacks.pfnError = tstVDError; 786 VDIErrorCallbacks.pfnMessage = tstVDMessage; 787 788 rc = VDInterfaceAdd(&VDIError, "tstVD_Error", VDINTERFACETYPE_ERROR, &VDIErrorCallbacks, 789 NULL, &pVDIfs); 767 VDIfError.pfnError = tstVDError; 768 VDIfError.pfnMessage = tstVDMessage; 769 770 rc = VDInterfaceAdd(&VDIfError.Core, "tstVD_Error", VDINTERFACETYPE_ERROR, 771 NULL, sizeof(VDINTERFACEERROR), &pVDIfs); 790 772 AssertRC(rc); 791 773 792 rc = VDCreate( &VDIError, VDTYPE_HDD, &pVD);774 rc = VDCreate(pVDIfs, VDTYPE_HDD, &pVD); 793 775 CHECK("VDCreate()"); 794 776
Note:
See TracChangeset
for help on using the changeset viewer.