Changeset 13295 in vbox for trunk/src/VBox/Devices/Storage/testcase
- Timestamp:
- Oct 15, 2008 6:07:59 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/testcase/tstVD.cpp
r13268 r13295 32 32 #include "stdlib.h" 33 33 34 #define VHD_TEST 35 #define VDI_TEST 36 #define VMDK_TEST 37 34 38 /******************************************************************************* 35 39 * Global Variables * … … 67 71 if (VBOX_FAILURE(rc)) \ 68 72 { \ 69 VD CloseAll(pVD); \73 VDDestroy(pVD); \ 70 74 return rc; \ 71 75 } \ … … 103 107 } 104 108 109 VDDestroy(pVD); 105 110 #undef CHECK 106 111 return 0; … … 123 128 if (VBOX_FAILURE(rc)) \ 124 129 { \ 125 VD CloseAll(pVD); \130 VDDestroy(pVD); \ 126 131 return rc; \ 127 132 } \ … … 154 159 } 155 160 161 VDDestroy(pVD); 156 162 #undef CHECK 157 163 return 0; … … 505 511 if (VBOX_FAILURE(rc)) \ 506 512 { \ 507 VDCloseAll(pVD); \ 513 if (pvBuf) \ 514 RTMemFree(pvBuf); \ 515 VDDestroy(pVD); \ 508 516 return rc; \ 509 517 } \ 510 518 } while (0) 519 520 void *pvBuf = RTMemAlloc(_1M); 511 521 512 522 /* Create error interface. */ … … 558 568 PSEGMENT paMergeSegments = (PSEGMENT)RTMemAllocZ(sizeof(struct Segment) * (nSegments + 1) * 3); 559 569 560 void *pvBuf = RTMemAlloc(_1M);561 562 570 RNDCTX ctx; 563 571 initializeRandomGenerator(&ctx, u32Seed); … … 600 608 VDDumpImages(pVD); 601 609 602 VDCloseAll(pVD); 610 VDDestroy(pVD); 611 if (pvBuf) 612 RTMemFree(pvBuf); 603 613 #undef CHECK 604 614 return 0; … … 625 635 if (VBOX_FAILURE(rc)) \ 626 636 { \ 627 VD CloseAll(pVD); \637 VDDestroy(pVD); \ 628 638 return rc; \ 629 639 } \ … … 681 691 RTMemFree(paSegments); 682 692 683 VD CloseAll(pVD);693 VDDestroy(pVD); 684 694 #undef CHECK 685 695 return 0; … … 700 710 if (VBOX_FAILURE(rc)) \ 701 711 { \ 702 VD CloseAll(pVD); \712 VDDestroy(pVD); \ 703 713 return rc; \ 704 714 } \ … … 722 732 CHECK("VDCopy()"); 723 733 724 VD CloseAll(pVD);734 VDDestroy(pVD); 725 735 #undef CHECK 726 736 return 0; … … 884 894 } 885 895 896 #ifdef VMDK_TEST 886 897 rc = tstVDCreateDelete("VMDK", "tmpVDCreate.vmdk", 2 * _4G, 887 898 VD_IMAGE_TYPE_NORMAL, VD_IMAGE_FLAGS_NONE, … … 906 917 g_cErrors++; 907 918 } 908 #if 1 919 909 920 tstVmdk(); 910 #endif 911 #if 1921 #endif /* VMDK_TEST */ 922 #ifdef VDI_TEST 912 923 rc = tstVDCreateDelete("VDI", "tmpVDCreate.vdi", 2 * _4G, 913 924 VD_IMAGE_TYPE_NORMAL, VD_IMAGE_FLAGS_NONE, … … 926 937 g_cErrors++; 927 938 } 928 #endif 939 #endif /* VDI_TEST */ 940 #ifdef VMDK_TEST 929 941 rc = tstVDCreateDelete("VMDK", "tmpVDCreate.vmdk", 2 * _4G, 930 942 VD_IMAGE_TYPE_NORMAL, VD_IMAGE_FLAGS_NONE, … … 959 971 g_cErrors++; 960 972 } 961 #if 1 973 #endif /* VMDK_TEST */ 974 #ifdef VHD_TEST 962 975 rc = tstVDCreateDelete("VHD", "tmpVDCreate.vhd", 2 * _4G, 963 976 VD_IMAGE_TYPE_NORMAL, VD_IMAGE_FLAGS_NONE, … … 976 989 g_cErrors++; 977 990 } 978 991 #endif /* VHD_TEST */ 992 #ifdef VDI_TEST 979 993 rc = tstVDOpenCreateWriteMerge("VDI", "tmpVDBase.vdi", "tmpVDDiff.vdi", u32Seed); 980 994 if (VBOX_FAILURE(rc)) … … 989 1003 g_cErrors++; 990 1004 } 1005 #endif /* VDI_TEST */ 1006 #ifdef VMDK_TEST 991 1007 rc = tstVDOpenCreateWriteMerge("VMDK", "tmpVDBase.vmdk", "tmpVDDiff.vmdk", u32Seed); 992 1008 if (VBOX_FAILURE(rc)) … … 1001 1017 g_cErrors++; 1002 1018 } 1003 1019 #endif /* VMDK_TEST */ 1020 #ifdef VHD_TEST 1004 1021 rc = tstVDCreateWriteOpenRead("VHD", "tmpVDCreate.vhd", u32Seed); 1005 1022 if (VBOX_FAILURE(rc)) … … 1015 1032 g_cErrors++; 1016 1033 } 1017 #endif 1034 #endif /* VHD_TEST */ 1018 1035 1019 1036 /*
Note:
See TracChangeset
for help on using the changeset viewer.