Changeset 78186 in vbox for trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
- Timestamp:
- Apr 17, 2019 9:36:59 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
r78180 r78186 1221 1221 1222 1222 1223 /** 1224 * Wrapper around RTDirOpen/RTDirOpenFiltered which takes g_fRelativeDir into 1225 * account. 1226 */ 1227 DECL_FORCE_INLINE(int) fsPerfOpenDirWrap(PRTDIR phDir, const char *pszPath) 1228 { 1229 if (!g_fRelativeDir) 1230 return RTDirOpen(phDir, pszPath); 1231 return RTDirOpenFiltered(phDir, pszPath, RTDIRFILTER_NONE, RTDIR_F_NO_ABS_PATH); 1232 } 1233 1234 1223 1235 DECL_FORCE_INLINE(int) fsPerfOpenClose(const char *pszDir) 1224 1236 { 1225 1237 RTDIR hDir; 1226 RTTESTI_CHECK_RC_RET( RTDirOpen(&hDir, pszDir), VINF_SUCCESS, rcCheck);1238 RTTESTI_CHECK_RC_RET(fsPerfOpenDirWrap(&hDir, pszDir), VINF_SUCCESS, rcCheck); 1227 1239 RTTESTI_CHECK_RC(RTDirClose(hDir), VINF_SUCCESS); 1228 1240 return VINF_SUCCESS; … … 1238 1250 * Non-existing files. 1239 1251 */ 1240 RTTESTI_CHECK_RC( RTDirOpen(&hDir, InEmptyDir(RT_STR_TUPLE("no-such-file"))), VERR_FILE_NOT_FOUND);1241 RTTESTI_CHECK_RC( RTDirOpen(&hDir, InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file"))), FSPERF_VERR_PATH_NOT_FOUND);1242 RTTESTI_CHECK_RC( RTDirOpen(&hDir, InDir(RT_STR_TUPLE("known-file" RTPATH_SLASH_STR "no-such-file"))), VERR_PATH_NOT_FOUND);1252 RTTESTI_CHECK_RC(fsPerfOpenDirWrap(&hDir, InEmptyDir(RT_STR_TUPLE("no-such-file"))), VERR_FILE_NOT_FOUND); 1253 RTTESTI_CHECK_RC(fsPerfOpenDirWrap(&hDir, InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file"))), FSPERF_VERR_PATH_NOT_FOUND); 1254 RTTESTI_CHECK_RC(fsPerfOpenDirWrap(&hDir, InDir(RT_STR_TUPLE("known-file" RTPATH_SLASH_STR "no-such-file"))), VERR_PATH_NOT_FOUND); 1243 1255 1244 1256 /* … … 1246 1258 */ 1247 1259 g_szEmptyDir[g_cchEmptyDir] = '\0'; 1248 RTTESTI_CHECK_RC_RETV( RTDirOpen(&hDir, g_szEmptyDir), VINF_SUCCESS);1260 RTTESTI_CHECK_RC_RETV(fsPerfOpenDirWrap(&hDir, g_szEmptyDir), VINF_SUCCESS); 1249 1261 RTTESTI_CHECK_RC(RTDirClose(hDir), VINF_SUCCESS); 1250 1262 … … 1267 1279 RTDIR hDir; 1268 1280 g_szEmptyDir[g_cchEmptyDir] = '\0'; 1269 RTTESTI_CHECK_RC_RET( RTDirOpen(&hDir, g_szEmptyDir), VINF_SUCCESS, rcCheck);1281 RTTESTI_CHECK_RC_RET(fsPerfOpenDirWrap(&hDir, g_szEmptyDir), VINF_SUCCESS, rcCheck); 1270 1282 1271 1283 RTDIRENTRY Entry; … … 1282 1294 { 1283 1295 RTDIR hDir; 1284 RTTESTI_CHECK_RC_RET( RTDirOpen(&hDir, InDir(RT_STR_TUPLE("manyfiles"))), VINF_SUCCESS, rcCheck);1296 RTTESTI_CHECK_RC_RET(fsPerfOpenDirWrap(&hDir, InDir(RT_STR_TUPLE("manyfiles"))), VINF_SUCCESS, rcCheck); 1285 1297 uint32_t cLeft = g_cManyFiles + 2; 1286 1298 for (;;) … … 1310 1322 */ 1311 1323 g_szEmptyDir[g_cchEmptyDir] = '\0'; 1312 RTTESTI_CHECK_RC_RETV( RTDirOpen(&hDir, g_szEmptyDir), VINF_SUCCESS);1324 RTTESTI_CHECK_RC_RETV(fsPerfOpenDirWrap(&hDir, g_szEmptyDir), VINF_SUCCESS); 1313 1325 1314 1326 uint32_t fDots = 0; … … 1340 1352 1341 1353 uint32_t cFiles = 0; 1342 RTTESTI_CHECK_RC_RETV( RTDirOpen(&hDir, InDir(RT_STR_TUPLE("manyfiles"))), VINF_SUCCESS);1354 RTTESTI_CHECK_RC_RETV(fsPerfOpenDirWrap(&hDir, InDir(RT_STR_TUPLE("manyfiles"))), VINF_SUCCESS); 1343 1355 for (;;) 1344 1356 { … … 4689 4701 /* Cleanup: */ 4690 4702 g_szDir[g_cchDir] = '\0'; 4691 rc = RTDirRemoveRecursive(g_szDir, RTDIRRMREC_F_CONTENT_AND_DIR );4703 rc = RTDirRemoveRecursive(g_szDir, RTDIRRMREC_F_CONTENT_AND_DIR | (g_fRelativeDir ? RTDIRRMREC_F_NO_ABS_PATH : 0)); 4692 4704 if (RT_FAILURE(rc)) 4693 4705 RTTestFailed(g_hTest, "RTDirRemoveRecursive(%s,) -> %Rrc\n", g_szDir, rc);
Note:
See TracChangeset
for help on using the changeset viewer.