Changeset 103285 in vbox
- Timestamp:
- Feb 8, 2024 3:27:12 PM (13 months ago)
- svn:sync-xref-src-repo-rev:
- 161579
- Location:
- trunk/src/VBox
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/DBGPlugInDarwin.cpp
r103275 r103285 716 716 { 717 717 char szTmp[RTDBG_SEGMENT_NAME_LENGTH + sizeof("_start")]; 718 strcat(strcpy(szTmp, aSegs[iSeg].szName), "_start"); 719 rc = RTDbgModSymbolAdd(hMod, szTmp, iSeg, 0 /*uRva*/, 0 /*cb*/, 0 /*fFlags*/, NULL); 718 rc = RTStrCat(RTStrCopy2(szTmp, sizeof(szTmp), aSegs[iSeg].szName), sizeof(szTmp), "_start"); 719 if (RT_SUCCESS(rc)) 720 rc = RTDbgModSymbolAdd(hMod, szTmp, iSeg, 0 /*uRva*/, 0 /*cb*/, 0 /*fFlags*/, NULL); 720 721 } 721 722 uRvaNext += aSegs[iSeg].cb; -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r103275 r103285 4842 4842 #define QUERY_VAL_RET(a_Width, a_szName, a_pValue, a_uDefault, a_ExprValid, a_szValidRange) \ 4843 4843 do { \ 4844 rc = RT_CONCAT(pHlp->pfnCFGMQueryU,a_Width)(pDirNode, strcpy(szNm, a_szName), a_pValue); \ 4844 AssertCompile(sizeof(szNm) - 1 >= (sizeof(a_szName) - 1) + (sizeof("Out") - 1)); \ 4845 rc = RT_CONCAT(pHlp->pfnCFGMQueryU,a_Width)(pDirNode, RTStrCopy2(szNm, sizeof(szNm), a_szName), a_pValue); \ 4845 4846 if (rc == VERR_CFGM_VALUE_NOT_FOUND || rc == VERR_CFGM_NO_PARENT) \ 4846 4847 { \ 4847 rc = RT_CONCAT(pHlp->pfnCFGMQueryU,a_Width)(pCfg, strcat(szNm, pszDir), a_pValue); \4848 rc = RT_CONCAT(pHlp->pfnCFGMQueryU,a_Width)(pCfg, RTStrCat2(szNm, sizeof(szNm), pszDir), a_pValue); \ 4848 4849 if (rc == VERR_CFGM_VALUE_NOT_FOUND || rc == VERR_CFGM_NO_PARENT) \ 4849 4850 { \ -
trunk/src/VBox/Devices/Network/testcase/tstIntNet-1.cpp
r103275 r103285 847 847 } 848 848 849 strcat(szPath, "/../VMMR0.r0"); 849 rc = RTStrCat(szPath, sizeof(szPath), "/../VMMR0.r0"); 850 if (RT_FAILURE(rc)) 851 { 852 RTPrintf("tstIntNet-1: RTStrCat -> %Rrc\n", rc); 853 return 1; 854 } 850 855 851 856 char szAbsPath[RTPATH_MAX]; -
trunk/src/VBox/HostDrivers/Support/testcase/tstInt.cpp
r103275 r103285 62 62 int rcRet = 0; 63 63 int i; 64 int rc;65 64 int cIterations = argc > 1 ? RTStrToUInt32(argv[1]) : 32; 66 65 if (cIterations == 0) … … 72 71 RTR3InitExe(argc, &argv, 0); 73 72 PSUPDRVSESSION pSession; 74 rc = SUPR3Init(&pSession);73 int rc = SUPR3Init(&pSession); 75 74 rcRet += rc != 0; 76 75 RTPrintf("tstInt: SUPR3Init -> rc=%Rrc\n", rc); 77 76 char szFile[RTPATH_MAX]; 78 if (!rc) 79 { 80 rc = RTPathExecDir(szFile, sizeof(szFile) - sizeof("/VMMR0.r0")); 81 } 77 if (RT_SUCCESS(rc)) 78 rc = RTPathExecDir(szFile, sizeof(szFile)); 79 82 80 char szAbsFile[RTPATH_MAX]; 83 81 if (RT_SUCCESS(rc)) 84 82 { 85 strcat(szFile, "/VMMR0.r0"); 86 rc = RTPathAbs(szFile, szAbsFile, sizeof(szAbsFile)); 83 rc = RTPathAppend(szFile, sizeof(szFile), "VMMR0.r0"); 84 if (RT_SUCCESS(rc)) 85 rc = RTPathAbs(szFile, szAbsFile, sizeof(szAbsFile)); 87 86 } 88 87 if (RT_SUCCESS(rc)) … … 236 235 } 237 236 237 if (RT_FAILURE(rc)) 238 RTPrintf("Failed with rc=%Rrc\n", rc); 239 238 240 return !!rc; 239 241 } -
trunk/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp
r103275 r103285 1 1 /** @file 2 2 * Testcase for shared folder case conversion code. 3 * 4 * @todo r=andy Testcase needs to be rewritten using the test framework. 5 * Otherwise it's almost pointless to run this on the testboxes. 3 6 */ 4 7 … … 42 45 #include <iprt/path.h> 43 46 #include <iprt/string.h> 47 #include <iprt/test.h> 44 48 #include <iprt/uni.h> 45 49 #include <stdio.h> … … 205 209 } 206 210 207 static int vbsfCorrectCasing(char *pszFullPath, char *pszStartComponent )211 static int vbsfCorrectCasing(char *pszFullPath, char *pszStartComponent, size_t cbStartComponent) 208 212 { 209 213 PRTDIRENTRYEX pDirEntry = NULL; … … 230 234 Assert(*(pszStartComponent-1) == RTPATH_DELIMITER); 231 235 *(pszStartComponent-1) = 0; 232 strcpy(pDirEntry->szName, pszFullPath); 236 rc = RTStrCopy(pDirEntry->szName, sizeof(pDirEntry->szName), pszFullPath); 237 if (RT_FAILURE(rc)) 238 goto end; 233 239 szWildCard[0] = RTPATH_DELIMITER; 234 240 szWildCard[1] = '*'; 235 241 szWildCard[2] = 0; 236 strcat(pDirEntry->szName, szWildCard); 237 242 rc = RTStrCat(pDirEntry->szName, sizeof(pDirEntry->szName), szWildCard); 243 if (RT_FAILURE(rc)) 244 goto end; 238 245 rc = RTDirOpenFiltered(&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT, 0 /*fFlags*/); 239 246 *(pszStartComponent-1) = RTPATH_DELIMITER; … … 263 270 { 264 271 Log(("Found original name %s (%s)\n", &pDirEntry->szName[0], pszStartComponent)); 265 strcpy(pszStartComponent, &pDirEntry->szName[0]); 266 rc = VINF_SUCCESS; 272 rc = RTStrCopy(pszStartComponent, cbStartComponent, &pDirEntry->szName[0]); 267 273 break; 268 274 } … … 282 288 283 289 284 static int testCase(char *pszFullPath, bool fWildCard = false)290 static int testCase(char *pszFullPath, size_t cbFullPath, bool fWildCard = false) 285 291 { 286 292 int rc; … … 291 297 { 292 298 /* strip off the last path component, that contains the wildcard(s) */ 293 size_t 294 char *src = pszFullPath +len - 1;295 296 while( src > pszFullPath)297 { 298 if (* src == RTPATH_DELIMITER)299 size_t cchLlen = strlen(pszFullPath); 300 char *pszSrc = pszFullPath + cchLlen - 1; 301 302 while(pszSrc > pszFullPath) 303 { 304 if (*pszSrc == RTPATH_DELIMITER) 299 305 break; 300 src--;301 } 302 if (* src == RTPATH_DELIMITER)306 pszSrc--; 307 } 308 if (*pszSrc == RTPATH_DELIMITER) 303 309 { 304 310 bool fHaveWildcards = false; 305 char *temp = src;311 char *temp = pszSrc; 306 312 307 313 while(*temp) … … 319 325 if (fHaveWildcards) 320 326 { 321 pszWildCardComponent = src;327 pszWildCardComponent = pszSrc; 322 328 *pszWildCardComponent = 0; 323 329 } … … 328 334 if (rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND) 329 335 { 330 size_t len = strlen(pszFullPath);331 char *src = pszFullPath + len - 1;336 size_t cchLen = strlen(pszFullPath); 337 char *pszSrc = pszFullPath + cchLen - 1; 332 338 333 339 Log(("Handle case insensitive guest fs on top of host case sensitive fs for %s\n", pszFullPath)); 334 340 335 341 /* Find partial path that's valid */ 336 while( src > pszFullPath)337 { 338 if (* src == RTPATH_DELIMITER)342 while(pszSrc > pszFullPath) 343 { 344 if (*pszSrc == RTPATH_DELIMITER) 339 345 { 340 * src = 0;346 *pszSrc = 0; 341 347 rc = RTPathQueryInfo (pszFullPath, &info, RTFSOBJATTRADD_NOTHING); 342 * src = RTPATH_DELIMITER;348 *pszSrc = RTPATH_DELIMITER; 343 349 if (rc == VINF_SUCCESS) 344 350 { 345 351 #ifdef DEBUG 346 * src = 0;352 *pszSrc = 0; 347 353 Log(("Found valid partial path %s\n", pszFullPath)); 348 * src = RTPATH_DELIMITER;354 *pszSrc = RTPATH_DELIMITER; 349 355 #endif 350 356 break; … … 352 358 } 353 359 354 src--;355 } 356 Assert(* src == RTPATH_DELIMITER && RT_SUCCESS(rc));357 if ( * src == RTPATH_DELIMITER360 pszSrc--; 361 } 362 Assert(*pszSrc == RTPATH_DELIMITER && RT_SUCCESS(rc)); 363 if ( *pszSrc == RTPATH_DELIMITER 358 364 && RT_SUCCESS(rc)) 359 365 { 360 src++;366 pszSrc++; 361 367 for(;;) 362 368 { 363 char *end = src;369 char *end = pszSrc; 364 370 bool fEndOfString = true; 365 371 … … 375 381 fEndOfString = false; 376 382 *end = 0; 377 rc = RTPathQueryInfo( src, &info, RTFSOBJATTRADD_NOTHING);383 rc = RTPathQueryInfo(pszSrc, &info, RTFSOBJATTRADD_NOTHING); 378 384 Assert(rc == VINF_SUCCESS || rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND); 379 385 } 380 386 else 381 if (end == src)387 if (end == pszSrc) 382 388 rc = VINF_SUCCESS; /* trailing delimiter */ 383 389 else … … 387 393 { 388 394 /* path component is invalid; try to correct the casing */ 389 rc = vbsfCorrectCasing(pszFullPath, src);395 rc = vbsfCorrectCasing(pszFullPath, pszSrc, cbFullPath - (pszFullPath - pszSrc)); 390 396 if (RT_FAILURE(rc)) 391 397 { … … 400 406 401 407 *end = RTPATH_DELIMITER; 402 src = end + 1;408 pszSrc = end + 1; 403 409 } 404 410 if (RT_FAILURE(rc)) … … 430 436 RTLogFlags(NULL, "unbuffered"); 431 437 432 strcpy(szTest, "c:\\test Dir\\z.bAt");433 testCase(szTest );434 strcpy(szTest, "c:\\test dir\\z.bAt");435 testCase(szTest );436 strcpy(szTest, "c:\\test dir\\SUBDIR\\z.bAt");437 testCase(szTest );438 strcpy(szTest, "c:\\test dir\\SUBDiR\\atestje.bat");439 testCase(szTest );440 strcpy(szTest, "c:\\TEST dir\\subDiR\\aTestje.baT");441 testCase(szTest );442 strcpy(szTest, "c:\\TEST dir\\subDiR\\*");443 testCase(szTest, true);444 strcpy(szTest, "c:\\TEST dir\\subDiR\\");445 testCase(szTest , true);446 strcpy(szTest, "c:\\test dir\\SUBDIR\\");447 testCase(szTest );448 strcpy(szTest, "c:\\test dir\\invalid\\SUBDIR\\test.bat");449 testCase(szTest );438 RTTESTI_CHECK_RC_OK(RTStrCopy(szTest, sizeof(szTest), "c:\\test Dir\\z.bAt")); 439 testCase(szTest, sizeof(szTest)); 440 RTTESTI_CHECK_RC_OK(RTStrCopy(szTest, sizeof(szTest), "c:\\test dir\\z.bAt")); 441 testCase(szTest, sizeof(szTest)); 442 RTTESTI_CHECK_RC_OK(RTStrCopy(szTest, sizeof(szTest), "c:\\test dir\\SUBDIR\\z.bAt")); 443 testCase(szTest, sizeof(szTest)); 444 RTTESTI_CHECK_RC_OK(RTStrCopy(szTest, sizeof(szTest), "c:\\test dir\\SUBDiR\\atestje.bat")); 445 testCase(szTest, sizeof(szTest)); 446 RTTESTI_CHECK_RC_OK(RTStrCopy(szTest, sizeof(szTest), "c:\\TEST dir\\subDiR\\aTestje.baT")); 447 testCase(szTest, sizeof(szTest)); 448 RTTESTI_CHECK_RC_OK(RTStrCopy(szTest, sizeof(szTest), "c:\\TEST dir\\subDiR\\*")); 449 testCase(szTest, sizeof(szTest), true); 450 RTTESTI_CHECK_RC_OK(RTStrCopy(szTest, sizeof(szTest), "c:\\TEST dir\\subDiR\\")); 451 testCase(szTest ,sizeof(szTest), true); 452 RTTESTI_CHECK_RC_OK(RTStrCopy(szTest, sizeof(szTest), "c:\\test dir\\SUBDIR\\")); 453 testCase(szTest, sizeof(szTest)); 454 RTTESTI_CHECK_RC_OK(RTStrCopy(szTest, sizeof(szTest), "c:\\test dir\\invalid\\SUBDIR\\test.bat")); 455 testCase(szTest, sizeof(szTest)); 450 456 return 0; 451 457 } -
trunk/src/VBox/Main/src-server/linux/PerformanceLinux.cpp
r103275 r103285 531 531 return; 532 532 } 533 strcat(szVolInfo, "/" VBOXVOLINFO_NAME " "); 534 strcat(szVolInfo, pcszVolume); 533 vrc = RTStrCat(szVolInfo, sizeof(szVolInfo), "/" VBOXVOLINFO_NAME " "); 534 AssertRCReturnVoid(vrc); 535 vrc = RTStrCat(szVolInfo, sizeof(szVolInfo), pcszVolume); 536 AssertRCReturnVoid(vrc); 535 537 536 538 FILE *fp = popen(szVolInfo, "r"); -
trunk/src/VBox/Main/src-server/xpcom/server_module.cpp
r103275 r103285 75 75 76 76 /** Name of the server executable. */ 77 const char VBoxSVC_exe[] = RTPATH_SLASH_STR "VBoxSVC" HOSTSUFF_EXE;77 const char g_szVBoxSVC_exe[] = RTPATH_SLASH_STR "VBoxSVC" HOSTSUFF_EXE; 78 78 79 79 enum … … 88 88 * Full path to the VBoxSVC executable. 89 89 */ 90 static char VBoxSVCPath[RTPATH_MAX];91 static bool IsVBoxSVCPathSet = false;90 static char g_szVBoxSVCPath[RTPATH_MAX]; 91 static bool g_fIsVBoxSVCPathSet = false; 92 92 93 93 /* … … 116 116 const char *apszArgs[] = 117 117 { 118 VBoxSVCPath,118 g_szVBoxSVCPath, 119 119 "--auto-shutdown", 120 120 "--inherit-startup-pipe", … … 132 132 hStdNil.u.hFile = NIL_RTFILE; 133 133 134 vrc = RTProcCreateEx( VBoxSVCPath, apszArgs, RTENV_DEFAULT,134 vrc = RTProcCreateEx(g_szVBoxSVCPath, apszArgs, RTENV_DEFAULT, 135 135 RTPROC_FLAGS_DETACHED, &hStdNil, &hStdNil, &hStdNil, 136 136 NULL /* pszAsUser */, NULL /* pszPassword */, NULL /* pExtraData */, … … 187 187 } 188 188 189 if (! IsVBoxSVCPathSet)189 if (!g_fIsVBoxSVCPathSet) 190 190 { 191 191 /* Get the directory containing XPCOM components -- the VBoxSVC … … 204 204 205 205 LogFlowFunc(("component directory = \"%s\"\n", path.get())); 206 AssertBreakStmt(path.Length() + strlen( VBoxSVC_exe) < RTPATH_MAX,206 AssertBreakStmt(path.Length() + strlen(g_szVBoxSVC_exe) < RTPATH_MAX, 207 207 rc = NS_ERROR_FAILURE); 208 208 … … 212 212 if (cbKernArch > 0) 213 213 { 214 sprintf( VBoxSVCPath, "/opt/VirtualBox/%s%s", achKernArch,VBoxSVC_exe);215 IsVBoxSVCPathSet = true;214 sprintf(g_szVBoxSVCPath, "/opt/VirtualBox/%s%s", achKernArch, g_szVBoxSVC_exe); 215 g_fIsVBoxSVCPathSet = true; 216 216 } 217 217 else 218 218 rc = NS_ERROR_UNEXPECTED; 219 219 #else 220 strcpy(VBoxSVCPath, path.get()); 221 RTPathStripFilename(VBoxSVCPath); 222 strcat(VBoxSVCPath, VBoxSVC_exe); 223 224 IsVBoxSVCPathSet = true; 220 int vrc = RTStrCopy(g_szVBoxSVCPath, sizeof(g_szVBoxSVCPath), path.get()); 221 AssertRCBreakStmt(vrc, rc = NS_ERROR_FAILURE); 222 RTPathStripFilename(g_szVBoxSVCPath); 223 vrc = RTStrCat(g_szVBoxSVCPath, sizeof(g_szVBoxSVCPath), g_szVBoxSVC_exe); 224 AssertRCBreakStmt(vrc, rc = NS_ERROR_FAILURE); 225 226 g_fIsVBoxSVCPathSet = true; 225 227 #endif 226 228 } … … 247 249 if (NS_FAILED(rc)) 248 250 { 249 LogFlowFunc(("Starting server \"%s\"...\n", VBoxSVCPath));251 LogFlowFunc(("Starting server \"%s\"...\n", g_szVBoxSVCPath)); 250 252 251 253 startedOnce = true; -
trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp
r103275 r103285 610 610 if (pszName) 611 611 { 612 size_t cchName = strlen(pszName); 613 char *pszExtFileBuf = (char *)alloca(cchName + strlen(pszExt) + 1); 614 if (pszExtFileBuf) 615 { 616 memcpy(pszExtFileBuf, pszName, cchName + 1); 617 RTPathStripSuffix(pszExtFileBuf); 618 pszExtFile = strcat(pszExtFileBuf, pszExt); 619 } 612 size_t const cchName = strlen(pszName); 613 size_t const cchExtFileBuf = cchName + strlen(pszExt) + 1; 614 615 char *pszExtFileBuf = (char *)alloca(cchExtFileBuf); 616 AssertPtrReturn(pszExtFileBuf, VERR_NO_MEMORY); 617 618 memcpy(pszExtFileBuf, pszName, cchName + 1); 619 RTPathStripSuffix(pszExtFileBuf); 620 int rc2 = RTStrCat(pszExtFileBuf, cchExtFileBuf, pszExt); 621 AssertRCReturn(rc2, rc2); 622 623 pszExtFile = pszExtFileBuf; 620 624 } 621 625 } -
trunk/src/VBox/Runtime/r3/xml.cpp
r103275 r103285 2310 2310 if (RT_FAILURE(rc)) 2311 2311 throw EIPRTFailure(rc, "RTStrCopy"); 2312 strcat(szTmpFilename, s_pszTmpSuff); 2312 rc = RTStrCat(szTmpFilename, sizeof(szTmpFilename), s_pszTmpSuff); 2313 if (RT_FAILURE(rc)) 2314 throw EIPRTFailure(rc, "RTStrCat"); 2313 2315 2314 2316 char szPrevFilename[RTPATH_MAX]; -
trunk/src/VBox/Runtime/testcase/tstRTR0CommonDriver.h
r103275 r103285 121 121 rc = RTPathAppend(szPath, RTPATH_MAX, pszTestServiceName); 122 122 if (RT_SUCCESS(rc)) 123 strcat(szPath, ".r0");123 rc = RTStrCat(szPath, sizeof(szPath), ".r0"); 124 124 if (RT_FAILURE(rc)) 125 125 { … … 129 129 130 130 char szSrvReqHandler[sizeof(g_szSrvName) + sizeof("SrvReqHandler")]; 131 strcpy(szSrvReqHandler, pszTestServiceName); 132 strcat(szSrvReqHandler, "SrvReqHandler"); 131 rc = RTStrCopy(szSrvReqHandler, sizeof(szSrvReqHandler), pszTestServiceName); 132 if (RT_SUCCESS(rc)) 133 rc = RTStrCat(szSrvReqHandler, sizeof(szSrvReqHandler), "SrvReqHandler"); 134 if (RT_FAILURE(rc)) 135 { 136 RTTestFailed(g_hTest, "RTStrCat failed with rc=%Rrc\n", rc); 137 return RTTestSummaryAndDestroy(g_hTest); 138 } 139 133 140 for (size_t off = 0; RT_C_IS_LOWER(szSrvReqHandler[off]); off++) 134 141 szSrvReqHandler[off] = RT_C_TO_UPPER(szSrvReqHandler[off]); -
trunk/src/VBox/VMM/VMMR3/DBGFR3PlugIn.cpp
r103275 r103285 280 280 int rc = RTPathAppend(pszModule, cchModule, DBGF_PLUG_IN_PREFIX); 281 281 AssertRCReturn(rc, VERR_TRY_AGAIN); 282 strcat(&pszModule[cchPath], pPlugIn->szName); 283 strcat(&pszModule[cchPath + sizeof(DBGF_PLUG_IN_PREFIX) - 1 + pPlugIn->cchName], pszSuff); 282 rc = RTStrCat(pszModule, cchModule, pPlugIn->szName); 283 AssertRCReturn(rc, VERR_TRY_AGAIN); 284 rc = RTStrCat(pszModule, cchModule, pszSuff); 285 AssertRCReturn(rc, VERR_TRY_AGAIN); 284 286 Assert(strlen(pszModule) < cchModule - 4); 285 287 … … 480 482 rc = RTPathAppend(szPath, sizeof(szPath) - cchSuff, DBGF_PLUG_IN_PREFIX "*"); 481 483 AssertRCReturnVoid(rc); 482 strcat(szPath, pszSuff); 484 rc = RTStrCat(szPath, sizeof(szPath), pszSuff); 485 AssertRCReturnVoid(rc); 483 486 484 487 RTDIR hDir; -
trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
r103275 r103285 2954 2954 { 2955 2955 char szRenamed[FSPERF_MAX_PATH]; 2956 strcat(strcpy(szRenamed, pszFile), "-renamed");2956 RTTESTI_CHECK_RC_OK(RTStrCat(RTStrCopy2(szRenamed, sizeof(szRenamed), pszFile), sizeof(szRenamed), "-renamed")); 2957 2957 if (!(iIteration & 1)) 2958 2958 return RTPathRename(pszFile, szRenamed, 0); … … 2971 2971 2972 2972 /* Non-existing files. */ 2973 strcpy(szPath, InEmptyDir(RT_STR_TUPLE("other-no-such-file")));2973 RTTESTI_CHECK_RC_OK(RTStrCopy(szPath, sizeof(szPath), InEmptyDir(RT_STR_TUPLE("other-no-such-file")))); 2974 2974 RTTESTI_CHECK_RC(RTPathRename(InEmptyDir(RT_STR_TUPLE("no-such-file")), szPath, 0), VERR_FILE_NOT_FOUND); 2975 strcpy(szPath, InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "other-no-such-file"))); 2975 2976 RTTESTI_CHECK_RC_OK(RTStrCopy(szPath, sizeof(szPath), InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "other-no-such-file")))); 2976 2977 RTTESTI_CHECK_RC(RTPathRename(InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file")), szPath, 0), 2977 2978 FSPERF_VERR_PATH_NOT_FOUND); 2978 strcpy(szPath, InEmptyDir(RT_STR_TUPLE("other-no-such-file"))); 2979 2980 RTTESTI_CHECK_RC_OK(RTStrCopy(szPath, sizeof(szPath), InEmptyDir(RT_STR_TUPLE("other-no-such-file")))); 2979 2981 RTTESTI_CHECK_RC(RTPathRename(InDir(RT_STR_TUPLE("known-file" RTPATH_SLASH_STR "no-such-file")), szPath, 0), VERR_PATH_NOT_FOUND); 2980 2982 … … 2983 2985 RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_NONE | RTFILE_O_WRITE), VINF_SUCCESS); 2984 2986 RTTESTI_CHECK_RC(RTFileClose(hFile1), VINF_SUCCESS); 2985 strcat(strcpy(szPath, g_szDir), "-no-such-dir" RTPATH_SLASH_STR "file16");2987 RTTESTI_CHECK_RC_OK(RTStrCat(RTStrCopy2(szPath, sizeof(szPath), g_szDir), sizeof(szPath), "-no-such-dir" RTPATH_SLASH_STR "file16")); 2986 2988 RTTESTI_CHECK_RC(RTPathRename(szPath, g_szDir, 0), FSPERF_VERR_PATH_NOT_FOUND); 2987 2989 RTTESTI_CHECK_RC(RTPathRename(g_szDir, szPath, 0), FSPERF_VERR_PATH_NOT_FOUND); 2988 2990 2989 2991 /* Shallow: */ 2990 strcat(strcpy(szPath, g_szDir), "-other");2992 RTTESTI_CHECK_RC_OK(RTStrCat(RTStrCopy2(szPath, sizeof(szPath), g_szDir), sizeof(szPath), "-other")); 2991 2993 PROFILE_FN(RTPathRename(iIteration & 1 ? szPath : g_szDir, iIteration & 1 ? g_szDir : szPath, 0), g_nsTestRun, "RTPathRename"); 2992 2994 … … 2996 2998 RTTESTI_CHECK_RC(RTFileClose(hFile1), VINF_SUCCESS); 2997 2999 2998 strcat(strcpy(szPath, g_szDeepDir), "-other");3000 RTTESTI_CHECK_RC_OK(RTStrCat(RTStrCopy2(szPath, sizeof(szPath), g_szDeepDir), sizeof(szPath), "-other")); 2999 3001 PROFILE_FN(RTPathRename(iIteration & 1 ? szPath : g_szDeepDir, iIteration & 1 ? g_szDeepDir : szPath, 0), 3000 3002 g_nsTestRun, "RTPathRename/deep");
Note:
See TracChangeset
for help on using the changeset viewer.