Changeset 77540 in vbox for trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
- Timestamp:
- Mar 2, 2019 8:48:24 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
r77448 r77540 247 247 kCmdOpt_Rename, 248 248 kCmdOpt_NoRename, 249 kCmdOpt_DirOpen, 250 kCmdOpt_NoDirOpen, 249 251 kCmdOpt_DirEnum, 250 252 kCmdOpt_NoDirEnum, … … 325 327 { "--rename", kCmdOpt_Rename, RTGETOPT_REQ_NOTHING }, 326 328 { "--no-rename", kCmdOpt_NoRename, RTGETOPT_REQ_NOTHING }, 329 { "--dir-open", kCmdOpt_DirOpen, RTGETOPT_REQ_NOTHING }, 330 { "--no-dir-open", kCmdOpt_NoDirOpen, RTGETOPT_REQ_NOTHING }, 327 331 { "--dir-enum", kCmdOpt_DirEnum, RTGETOPT_REQ_NOTHING }, 328 332 { "--no-dir-enum", kCmdOpt_NoDirEnum, RTGETOPT_REQ_NOTHING }, … … 391 395 static bool g_fUtimes = true; 392 396 static bool g_fRename = true; 397 static bool g_fDirOpen = true; 393 398 static bool g_fDirEnum = true; 394 399 static bool g_fMkRmDir = true; … … 1006 1011 1007 1012 1013 DECL_FORCE_INLINE(int) fsPerfOpenClose(const char *pszDir) 1014 { 1015 RTDIR hDir; 1016 RTTESTI_CHECK_RC_RET(RTDirOpen(&hDir, pszDir), VINF_SUCCESS, rcCheck); 1017 RTTESTI_CHECK_RC(RTDirClose(hDir), VINF_SUCCESS); 1018 return VINF_SUCCESS; 1019 } 1020 1021 1022 void vsPerfDirOpen(void) 1023 { 1024 RTTestISub("dir open"); 1025 RTDIR hDir; 1026 1027 /* 1028 * Non-existing files. 1029 */ 1030 RTTESTI_CHECK_RC(RTDirOpen(&hDir, InEmptyDir(RT_STR_TUPLE("no-such-file"))), VERR_FILE_NOT_FOUND); 1031 RTTESTI_CHECK_RC(RTDirOpen(&hDir, InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file"))), FSPERF_VERR_PATH_NOT_FOUND); 1032 RTTESTI_CHECK_RC(RTDirOpen(&hDir, InDir(RT_STR_TUPLE("known-file" RTPATH_SLASH_STR "no-such-file"))), VERR_PATH_NOT_FOUND); 1033 1034 /* 1035 * Check that open + close works. 1036 */ 1037 g_szEmptyDir[g_cchEmptyDir] = '\0'; 1038 RTTESTI_CHECK_RC_RETV(RTDirOpen(&hDir, g_szEmptyDir), VINF_SUCCESS); 1039 RTTESTI_CHECK_RC(RTDirClose(hDir), VINF_SUCCESS); 1040 1041 1042 /* 1043 * Profile empty dir and dir with many files. 1044 */ 1045 g_szEmptyDir[g_cchEmptyDir] = '\0'; 1046 PROFILE_FN(fsPerfOpenClose(g_szEmptyDir), g_nsTestRun, "RTDirOpen/Close empty"); 1047 if (g_fManyFiles) 1048 { 1049 InDir(RT_STR_TUPLE("manyfiles")); 1050 PROFILE_FN(fsPerfOpenClose(g_szDir), g_nsTestRun, "RTDirOpen/Close manyfiles"); 1051 } 1052 } 1053 1054 1008 1055 DECL_FORCE_INLINE(int) fsPerfEnumEmpty(void) 1009 1056 { … … 1048 1095 RTTestISub("dir enum"); 1049 1096 RTDIR hDir; 1050 1051 /* Non-existing files. */1052 RTTESTI_CHECK_RC(RTDirOpen(&hDir, InEmptyDir(RT_STR_TUPLE("no-such-file"))), VERR_FILE_NOT_FOUND);1053 RTTESTI_CHECK_RC(RTDirOpen(&hDir, InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file"))), FSPERF_VERR_PATH_NOT_FOUND);1054 RTTESTI_CHECK_RC(RTDirOpen(&hDir, InDir(RT_STR_TUPLE("known-file" RTPATH_SLASH_STR "no-such-file"))), VERR_PATH_NOT_FOUND);1055 1097 1056 1098 /* … … 2809 2851 g_fUtimes = true; 2810 2852 g_fRename = true; 2853 g_fDirOpen = true; 2811 2854 g_fDirEnum = true; 2812 2855 g_fMkRmDir = true; … … 2833 2876 g_fUtimes = false; 2834 2877 g_fRename = false; 2878 g_fDirOpen = false; 2835 2879 g_fDirEnum = false; 2836 2880 g_fMkRmDir = false; … … 2858 2902 CASE_OPT(Utimes); 2859 2903 CASE_OPT(Rename); 2904 CASE_OPT(DirOpen); 2860 2905 CASE_OPT(DirEnum); 2861 2906 CASE_OPT(MkRmDir); … … 3010 3055 if (g_fRename) 3011 3056 fsPerfRename(); 3057 if (g_fDirOpen) 3058 vsPerfDirOpen(); 3012 3059 if (g_fDirEnum) 3013 3060 vsPerfDirEnum();
Note:
See TracChangeset
for help on using the changeset viewer.