Changeset 13835 in vbox for trunk/src/VBox/Devices/Storage/testcase
- Timestamp:
- Nov 5, 2008 2:34:43 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Storage/testcase
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/testcase/tstVD-2.cpp
r11484 r13835 49 49 { \ 50 50 RTPrintf("%s rc=%Vrc\n", str, rc); \ 51 if ( VBOX_FAILURE(rc)) \51 if (RT_FAILURE(rc)) \ 52 52 return rc; \ 53 53 } while (0) … … 155 155 156 156 rc = tstVDBackendInfo(); 157 if ( VBOX_FAILURE(rc))157 if (RT_FAILURE(rc)) 158 158 { 159 159 RTPrintf("tstVD-2: getting backend info test failed! rc=%Vrc\n", rc); -
trunk/src/VBox/Devices/Storage/testcase/tstVD.cpp
r13340 r13835 69 69 { \ 70 70 RTPrintf("%s rc=%Vrc\n", str, rc); \ 71 if ( VBOX_FAILURE(rc)) \71 if (RT_FAILURE(rc)) \ 72 72 { \ 73 73 VDDestroy(pVD); \ … … 100 100 RTFILE File; 101 101 rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ); 102 if ( VBOX_SUCCESS(rc))102 if (RT_SUCCESS(rc)) 103 103 { 104 104 RTFileClose(File); … … 126 126 { \ 127 127 RTPrintf("%s rc=%Vrc\n", str, rc); \ 128 if ( VBOX_FAILURE(rc)) \128 if (RT_FAILURE(rc)) \ 129 129 { \ 130 130 VDDestroy(pVD); \ … … 153 153 RTFILE File; 154 154 rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ); 155 if ( VBOX_SUCCESS(rc))155 if (RT_SUCCESS(rc)) 156 156 { 157 157 RTFileClose(File); … … 349 349 { 350 350 int rc = RTPRandInit(pCtx, u32Seed); 351 if ( VBOX_FAILURE(rc))351 if (RT_FAILURE(rc)) 352 352 RTPrintf("ERROR: Failed to initialize random generator. RC=%Vrc\n", rc); 353 353 else … … 464 464 { 465 465 int rc = VDRead(pVD, pSegment->u64Offset, pvBuf, pSegment->u32Length); 466 if ( VBOX_FAILURE(rc))466 if (RT_FAILURE(rc)) 467 467 { 468 468 RTPrintf("ERROR: Failed to read from virtual disk\n"); … … 509 509 { \ 510 510 RTPrintf("%s rc=%Vrc\n", str, rc); \ 511 if ( VBOX_FAILURE(rc)) \511 if (RT_FAILURE(rc)) \ 512 512 { \ 513 513 if (pvBuf) \ … … 535 535 RTFILE File; 536 536 rc = RTFileOpen(&File, pszBaseFilename, RTFILE_O_READ); 537 if ( VBOX_SUCCESS(rc))537 if (RT_SUCCESS(rc)) 538 538 { 539 539 RTFileClose(File); 540 540 rc = VDGetFormat(pszBaseFilename, &pszFormat); 541 541 RTPrintf("VDGetFormat() pszFormat=%s rc=%Vrc\n", pszFormat, rc); 542 if ( VBOX_SUCCESS(rc) && strcmp(pszFormat, pszBackend))542 if (RT_SUCCESS(rc) && strcmp(pszFormat, pszBackend)) 543 543 { 544 544 rc = VERR_GENERAL_FAILURE; … … 633 633 { \ 634 634 RTPrintf("%s rc=%Vrc\n", str, rc); \ 635 if ( VBOX_FAILURE(rc)) \635 if (RT_FAILURE(rc)) \ 636 636 { \ 637 637 if (pvBuf) \ … … 659 659 RTFILE File; 660 660 rc = RTFileOpen(&File, pszFilename, RTFILE_O_READ); 661 if ( VBOX_SUCCESS(rc))661 if (RT_SUCCESS(rc)) 662 662 { 663 663 RTFileClose(File); … … 712 712 { \ 713 713 RTPrintf("%s rc=%Vrc\n", str, rc); \ 714 if ( VBOX_FAILURE(rc)) \714 if (RT_FAILURE(rc)) \ 715 715 { \ 716 716 VDDestroy(pVD); \ … … 746 746 { 747 747 int rc = tstVDCreateDelete("VMDK", src, cbSize, enmType, uFlags, false); 748 if ( VBOX_FAILURE(rc))748 if (RT_FAILURE(rc)) 749 749 return rc; 750 750 751 751 rc = tstVmdkRename(src, dst); 752 if ( VBOX_FAILURE(rc))752 if (RT_FAILURE(rc)) 753 753 return rc; 754 754 … … 762 762 { \ 763 763 RTPrintf("%s rc=%Vrc\n", str, rc); \ 764 if ( VBOX_FAILURE(rc)) \764 if (RT_FAILURE(rc)) \ 765 765 { \ 766 766 VDCloseAll(pVD); \ … … 801 801 int rc = tstVmdkCreateRenameOpen("tmpVDCreate.vmdk", "tmpVDRename.vmdk", _4G, 802 802 VD_IMAGE_TYPE_NORMAL, VD_IMAGE_FLAGS_NONE); 803 if ( VBOX_FAILURE(rc))803 if (RT_FAILURE(rc)) 804 804 { 805 805 RTPrintf("tstVD: VMDK rename (single extent, embedded descriptor, same dir) test failed! rc=%Vrc\n", rc); … … 808 808 rc = tstVmdkCreateRenameOpen("tmpVDCreate.vmdk", "tmpVDRename.vmdk", _4G, 809 809 VD_IMAGE_TYPE_NORMAL, VD_VMDK_IMAGE_FLAGS_SPLIT_2G); 810 if ( VBOX_FAILURE(rc))810 if (RT_FAILURE(rc)) 811 811 { 812 812 RTPrintf("tstVD: VMDK rename (multiple extent, separate descriptor, same dir) test failed! rc=%Vrc\n", rc); … … 815 815 rc = tstVmdkCreateRenameOpen("tmpVDCreate.vmdk", DST_PATH, _4G, 816 816 VD_IMAGE_TYPE_NORMAL, VD_IMAGE_FLAGS_NONE); 817 if ( VBOX_FAILURE(rc))817 if (RT_FAILURE(rc)) 818 818 { 819 819 RTPrintf("tstVD: VMDK rename (single extent, embedded descriptor, another dir) test failed! rc=%Vrc\n", rc); … … 822 822 rc = tstVmdkCreateRenameOpen("tmpVDCreate.vmdk", DST_PATH, _4G, 823 823 VD_IMAGE_TYPE_NORMAL, VD_VMDK_IMAGE_FLAGS_SPLIT_2G); 824 if ( VBOX_FAILURE(rc))824 if (RT_FAILURE(rc)) 825 825 { 826 826 RTPrintf("tstVD: VMDK rename (multiple extent, separate descriptor, another dir) test failed! rc=%Vrc\n", rc); … … 830 830 RTFILE File; 831 831 rc = RTFileOpen(&File, DST_PATH, RTFILE_O_CREATE | RTFILE_O_WRITE); 832 if ( VBOX_SUCCESS(rc))832 if (RT_SUCCESS(rc)) 833 833 RTFileClose(File); 834 834 835 835 rc = tstVmdkCreateRenameOpen("tmpVDCreate.vmdk", DST_PATH, _4G, 836 836 VD_IMAGE_TYPE_NORMAL, VD_VMDK_IMAGE_FLAGS_SPLIT_2G); 837 if ( VBOX_SUCCESS(rc))837 if (RT_SUCCESS(rc)) 838 838 { 839 839 RTPrintf("tstVD: VMDK rename (multiple extent, separate descriptor, another dir, already exists) test failed!\n"); … … 891 891 { 892 892 rc = RTDirCreate("tmp", RTFS_UNIX_IRWXU); 893 if ( VBOX_FAILURE(rc))893 if (RT_FAILURE(rc)) 894 894 { 895 895 RTPrintf("tstVD: Failed to create 'tmp' directory! rc=%Vrc\n", rc); … … 902 902 VD_IMAGE_TYPE_NORMAL, VD_IMAGE_FLAGS_NONE, 903 903 true); 904 if ( VBOX_FAILURE(rc))904 if (RT_FAILURE(rc)) 905 905 { 906 906 RTPrintf("tstVD: dynamic VMDK create test failed! rc=%Vrc\n", rc); … … 910 910 VD_IMAGE_TYPE_NORMAL, VD_IMAGE_FLAGS_NONE, 911 911 false); 912 if ( VBOX_FAILURE(rc))912 if (RT_FAILURE(rc)) 913 913 { 914 914 RTPrintf("tstVD: dynamic VMDK create test failed! rc=%Vrc\n", rc); … … 916 916 } 917 917 rc = tstVDOpenDelete("VMDK", "tmpVDCreate.vmdk"); 918 if ( VBOX_FAILURE(rc))918 if (RT_FAILURE(rc)) 919 919 { 920 920 RTPrintf("tstVD: VMDK delete test failed! rc=%Vrc\n", rc); … … 928 928 VD_IMAGE_TYPE_NORMAL, VD_IMAGE_FLAGS_NONE, 929 929 true); 930 if ( VBOX_FAILURE(rc))930 if (RT_FAILURE(rc)) 931 931 { 932 932 RTPrintf("tstVD: dynamic VDI create test failed! rc=%Vrc\n", rc); … … 936 936 VD_IMAGE_TYPE_FIXED, VD_IMAGE_FLAGS_NONE, 937 937 true); 938 if ( VBOX_FAILURE(rc))938 if (RT_FAILURE(rc)) 939 939 { 940 940 RTPrintf("tstVD: fixed VDI create test failed! rc=%Vrc\n", rc); … … 946 946 VD_IMAGE_TYPE_NORMAL, VD_IMAGE_FLAGS_NONE, 947 947 true); 948 if ( VBOX_FAILURE(rc))948 if (RT_FAILURE(rc)) 949 949 { 950 950 RTPrintf("tstVD: dynamic VMDK create test failed! rc=%Vrc\n", rc); … … 954 954 VD_IMAGE_TYPE_NORMAL, VD_VMDK_IMAGE_FLAGS_SPLIT_2G, 955 955 true); 956 if ( VBOX_FAILURE(rc))956 if (RT_FAILURE(rc)) 957 957 { 958 958 RTPrintf("tstVD: dynamic split VMDK create test failed! rc=%Vrc\n", rc); … … 962 962 VD_IMAGE_TYPE_FIXED, VD_IMAGE_FLAGS_NONE, 963 963 true); 964 if ( VBOX_FAILURE(rc))964 if (RT_FAILURE(rc)) 965 965 { 966 966 RTPrintf("tstVD: fixed VMDK create test failed! rc=%Vrc\n", rc); … … 970 970 VD_IMAGE_TYPE_FIXED, VD_VMDK_IMAGE_FLAGS_SPLIT_2G, 971 971 true); 972 if ( VBOX_FAILURE(rc))972 if (RT_FAILURE(rc)) 973 973 { 974 974 RTPrintf("tstVD: fixed split VMDK create test failed! rc=%Vrc\n", rc); … … 980 980 VD_IMAGE_TYPE_NORMAL, VD_IMAGE_FLAGS_NONE, 981 981 true); 982 if ( VBOX_FAILURE(rc))982 if (RT_FAILURE(rc)) 983 983 { 984 984 RTPrintf("tstVD: dynamic VHD create test failed! rc=%Vrc\n", rc); … … 988 988 VD_IMAGE_TYPE_FIXED, VD_IMAGE_FLAGS_NONE, 989 989 true); 990 if ( VBOX_FAILURE(rc))990 if (RT_FAILURE(rc)) 991 991 { 992 992 RTPrintf("tstVD: fixed VHD create test failed! rc=%Vrc\n", rc); … … 996 996 #ifdef VDI_TEST 997 997 rc = tstVDOpenCreateWriteMerge("VDI", "tmpVDBase.vdi", "tmpVDDiff.vdi", u32Seed); 998 if ( VBOX_FAILURE(rc))998 if (RT_FAILURE(rc)) 999 999 { 1000 1000 RTPrintf("tstVD: VDI test failed (new image)! rc=%Vrc\n", rc); … … 1002 1002 } 1003 1003 rc = tstVDOpenCreateWriteMerge("VDI", "tmpVDBase.vdi", "tmpVDDiff.vdi", u32Seed); 1004 if ( VBOX_FAILURE(rc))1004 if (RT_FAILURE(rc)) 1005 1005 { 1006 1006 RTPrintf("tstVD: VDI test failed (existing image)! rc=%Vrc\n", rc); … … 1010 1010 #ifdef VMDK_TEST 1011 1011 rc = tstVDOpenCreateWriteMerge("VMDK", "tmpVDBase.vmdk", "tmpVDDiff.vmdk", u32Seed); 1012 if ( VBOX_FAILURE(rc))1012 if (RT_FAILURE(rc)) 1013 1013 { 1014 1014 RTPrintf("tstVD: VMDK test failed (new image)! rc=%Vrc\n", rc); … … 1016 1016 } 1017 1017 rc = tstVDOpenCreateWriteMerge("VMDK", "tmpVDBase.vmdk", "tmpVDDiff.vmdk", u32Seed); 1018 if ( VBOX_FAILURE(rc))1018 if (RT_FAILURE(rc)) 1019 1019 { 1020 1020 RTPrintf("tstVD: VMDK test failed (existing image)! rc=%Vrc\n", rc); … … 1024 1024 #ifdef VHD_TEST 1025 1025 rc = tstVDCreateWriteOpenRead("VHD", "tmpVDCreate.vhd", u32Seed); 1026 if ( VBOX_FAILURE(rc))1026 if (RT_FAILURE(rc)) 1027 1027 { 1028 1028 RTPrintf("tstVD: VHD test failed (creating image)! rc=%Vrc\n", rc); … … 1031 1031 1032 1032 rc = tstVDOpenCreateWriteMerge("VHD", "tmpVDBase.vhd", "tmpVDDiff.vhd", u32Seed); 1033 if ( VBOX_FAILURE(rc))1033 if (RT_FAILURE(rc)) 1034 1034 { 1035 1035 RTPrintf("tstVD: VHD test failed (existing image)! rc=%Vrc\n", rc); -
trunk/src/VBox/Devices/Storage/testcase/tstVDI.cpp
r8155 r13835 36 36 { \ 37 37 RTPrintf("%s rc=%Vrc\n", str, rc); \ 38 if ( VBOX_FAILURE(rc)) \38 if (RT_FAILURE(rc)) \ 39 39 { \ 40 40 VDIDiskCloseAllImages(pVdi); \ … … 46 46 int rc = VDIDiskOpenImage(pVdi, pszBaseFilename, VDI_OPEN_FLAGS_NORMAL); 47 47 RTPrintf("openImage() rc=%Vrc\n", rc); 48 if ( VBOX_FAILURE(rc))48 if (RT_FAILURE(rc)) 49 49 { 50 50 rc = VDICreateBaseImage(pszBaseFilename, VDI_IMAGE_TYPE_NORMAL, -
trunk/src/VBox/Devices/Storage/testcase/vditool.cpp
r8155 r13835 71 71 { 72 72 int rc = RTStrCurrentCPToUtf8(pszUtf8Filename, pszFilename); 73 if ( VBOX_FAILURE(rc))73 if (RT_FAILURE(rc)) 74 74 RTPrintf("Error converting filename '%s' to UTF8! (rc=%Rrc)\n", 75 75 pszFilename, rc); … … 86 86 if (rc == VINF_SUCCESS) 87 87 RTPrintf("The operation completed successfully!\n"); 88 else if ( VBOX_SUCCESS(rc))88 else if (RT_SUCCESS(rc)) 89 89 RTPrintf("The operation completed successfully! (rc=%Rrc)\n", rc); 90 90 else … … 101 101 char *pszUtf8Filename; 102 102 int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename); 103 if ( VBOX_FAILURE(rc))103 if (RT_FAILURE(rc)) 104 104 return rc; 105 105 … … 119 119 char *pszUtf8Filename, *pszUtf8DDFilename; 120 120 int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename); 121 if ( VBOX_FAILURE(rc))121 if (RT_FAILURE(rc)) 122 122 return rc; 123 123 rc = FilenameToUtf8(&pszUtf8DDFilename, pszDDFilename); 124 if ( VBOX_FAILURE(rc))124 if (RT_FAILURE(rc)) 125 125 return rc; 126 126 … … 128 128 RTFILE File; 129 129 rc = RTFileOpen(&File, pszUtf8DDFilename, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE); 130 if ( VBOX_FAILURE(rc))130 if (RT_FAILURE(rc)) 131 131 { 132 132 RTPrintf("File=\"%s\" open error: %Rrf\n", pszDDFilename, rc); … … 137 137 uint64_t cbFile; 138 138 rc = RTFileGetSize(File, &cbFile); 139 if ( VBOX_SUCCESS(rc))139 if (RT_SUCCESS(rc)) 140 140 { 141 141 RTPrintf("Creating fixed image with size %u Bytes...\n", (unsigned)cbFile); … … 145 145 "Converted from DD test image", NULL, NULL); 146 146 PrintDone(rc); 147 if ( VBOX_SUCCESS(rc))147 if (RT_SUCCESS(rc)) 148 148 { 149 149 RTPrintf("Writing data...\n"); 150 150 PVDIDISK pVdi = VDIDiskCreate(); 151 151 rc = VDIDiskOpenImage(pVdi, pszUtf8Filename, VDI_OPEN_FLAGS_NORMAL); 152 if ( VBOX_SUCCESS(rc))152 if (RT_SUCCESS(rc)) 153 153 { 154 154 /* alloc work buffer. */ … … 161 161 size_t cbRead = 0; 162 162 rc = RTFileRead(File, pvBuf, VDIDiskGetBufferSize(pVdi), &cbRead); 163 if ( VBOX_FAILURE(rc) || !cbRead)163 if (RT_FAILURE(rc) || !cbRead) 164 164 break; 165 165 rc = VDIDiskWrite(pVdi, off, pvBuf, cbRead); 166 if ( VBOX_FAILURE(rc))166 if (RT_FAILURE(rc)) 167 167 break; 168 168 off += cbRead; … … 177 177 } 178 178 179 if ( VBOX_FAILURE(rc))179 if (RT_FAILURE(rc)) 180 180 { 181 181 /* delete image on error */ … … 215 215 char *pszUtf8Filename; 216 216 int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename); 217 if ( VBOX_FAILURE(rc))217 if (RT_FAILURE(rc)) 218 218 return rc; 219 219 … … 232 232 char *pszUtf8Filename; 233 233 int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename); 234 if ( VBOX_FAILURE(rc))234 if (RT_FAILURE(rc)) 235 235 return rc; 236 236 rc = VDIDiskOpenImage(pVdi, pszUtf8Filename, VDI_OPEN_FLAGS_READONLY); 237 if ( VBOX_SUCCESS(rc))237 if (RT_SUCCESS(rc)) 238 238 { 239 239 VDIDiskDumpImages(pVdi); … … 251 251 char *pszUtf8Filename; 252 252 int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename); 253 if ( VBOX_FAILURE(rc))253 if (RT_FAILURE(rc)) 254 254 return rc; 255 255 256 256 rc = VDIDiskOpenImage(pVdi, pszUtf8Filename, VDI_OPEN_FLAGS_NORMAL); 257 if ( VBOX_SUCCESS(rc))257 if (RT_SUCCESS(rc)) 258 258 { 259 259 PDMMEDIAGEOMETRY LCHSGeometry = {0, 0, 0}; … … 273 273 char *pszUtf8SrcFile, *pszUtf8DstFile; 274 274 int rc = FilenameToUtf8(&pszUtf8SrcFile, pszSrcFile); 275 if ( VBOX_FAILURE(rc))275 if (RT_FAILURE(rc)) 276 276 return rc; 277 277 rc = FilenameToUtf8(&pszUtf8DstFile, pszDstFile); 278 if ( VBOX_FAILURE(rc))278 if (RT_FAILURE(rc)) 279 279 return rc; 280 280 … … 294 294 char *pszUtf8SrcFile, *pszUtf8DstFile; 295 295 int rc = FilenameToUtf8(&pszUtf8SrcFile, pszSrcFile); 296 if ( VBOX_FAILURE(rc))296 if (RT_FAILURE(rc)) 297 297 return rc; 298 298 rc = FilenameToUtf8(&pszUtf8DstFile, pszDstFile); 299 if ( VBOX_FAILURE(rc))299 if (RT_FAILURE(rc)) 300 300 return rc; 301 301 302 302 rc = VDIDiskOpenImage(pVdi, pszUtf8SrcFile, VDI_OPEN_FLAGS_NORMAL); 303 if ( VBOX_SUCCESS(rc))303 if (RT_SUCCESS(rc)) 304 304 { 305 305 RTFILE FileDst; 306 306 rc = RTFileOpen(&FileDst, pszUtf8DstFile, RTFILE_O_CREATE | RTFILE_O_READWRITE | RTFILE_O_DENY_WRITE); 307 if ( VBOX_SUCCESS(rc))307 if (RT_SUCCESS(rc)) 308 308 { 309 309 uint64_t cbSrc = VDIDiskGetSize(pVdi); … … 316 316 { 317 317 rc = VDIDiskRead(pVdi, off, pvBuf, cbBuf); 318 if ( VBOX_FAILURE(rc))318 if (RT_FAILURE(rc)) 319 319 break; 320 320 rc = RTFileWrite(FileDst, pvBuf, cbBuf, NULL); 321 if ( VBOX_FAILURE(rc))321 if (RT_FAILURE(rc)) 322 322 break; 323 323 off += cbBuf; … … 341 341 char *pszUtf8Filename; 342 342 int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename); 343 if ( VBOX_FAILURE(rc))343 if (RT_FAILURE(rc)) 344 344 return rc; 345 345 … … 384 384 uint32_t cMBs; 385 385 rc = RTStrToUInt32Ex(argv[3], NULL, 10, &cMBs); 386 if ( VBOX_FAILURE(rc))386 if (RT_FAILURE(rc)) 387 387 return SyntaxError("Invalid number!"); 388 388 if ( cMBs < 2 … … 442 442 443 443 RTLogFlush(NULL); 444 return ! VBOX_SUCCESS(rc);445 } 444 return !RT_SUCCESS(rc); 445 }
Note:
See TracChangeset
for help on using the changeset viewer.