Index: trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
===================================================================
--- trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp	(revision 76796)
+++ trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp	(revision 76801)
@@ -87,5 +87,5 @@
  * Always does an even number of tree iterations.
  */
-#define PROFILE_MANYTREE_FN(a_szPath, a_fnCall, a_cEstimationIterations, a_cNsTarget, a_szDesc1, a_szDesc2) \
+#define PROFILE_MANYTREE_FN(a_szPath, a_fnCall, a_cEstimationIterations, a_cNsTarget, a_szDesc) \
     do { \
         /* Estimate how many iterations we need to fill up the given timeslot: */ \
@@ -124,7 +124,5 @@
         } \
         uint64_t const cNsElapsed = RTTimeNanoTS() - nsStart; \
-        if (a_szDesc1 != NULL) \
-            RTTestIValueF(cNsElapsed, RTTESTUNIT_NS, a_szDesc1, cCalls); \
-        RTTestIValueF(cNsElapsed / cCalls, RTTESTUNIT_NS_PER_OCCURRENCE, a_szDesc2); \
+        RTTestIValueF(cNsElapsed / cCalls, RTTESTUNIT_NS_PER_OCCURRENCE, a_szDesc); \
     } while (0)
 
@@ -428,5 +426,5 @@
     /* Manytree: */
     char szPath[RTPATH_MAX];
-    PROFILE_MANYTREE_FN(szPath, fsPerfOpenExistingOnceReadonly(szPath), 1, g_nsTestRun, NULL, "RTFileOpen/Close/manytree/readonly");
+    PROFILE_MANYTREE_FN(szPath, fsPerfOpenExistingOnceReadonly(szPath), 1, g_nsTestRun, "RTFileOpen/Close/manytree/readonly");
 }
 
@@ -534,7 +532,7 @@
     char szPath[RTPATH_MAX];
     PROFILE_MANYTREE_FN(szPath, RTPathQueryInfoEx(szPath, &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK),
-                        1, g_nsTestRun, NULL, "RTPathQueryInfoEx/manytree/NOTHING");
+                        1, g_nsTestRun, "RTPathQueryInfoEx/manytree/NOTHING");
     PROFILE_MANYTREE_FN(szPath, RTPathQueryInfoEx(szPath, &ObjInfo, RTFSOBJATTRADD_UNIX, RTPATH_F_ON_LINK),
-                        1, g_nsTestRun, NULL, "RTPathQueryInfoEx/manytree/UNIX");
+                        1, g_nsTestRun, "RTPathQueryInfoEx/manytree/UNIX");
 }
 
@@ -574,5 +572,5 @@
     char szPath[RTPATH_MAX];
     PROFILE_MANYTREE_FN(szPath, RTPathSetMode(szPath, iIteration & 1 ? fOddMode : fEvenMode), 1, g_nsTestRun,
-                        NULL, "RTPathSetMode/manytree");
+                        "RTPathSetMode/manytree");
     DO_MANYTREE_FN(szPath, RTPathSetMode(szPath, ObjInfo.Attr.fMode));
 }
@@ -636,5 +634,5 @@
     PROFILE_MANYTREE_FN(szPath, RTPathSetTimesEx(szPath, iIteration & 1 ? &Time1 : &Time2, iIteration & 1 ? &Time2 : &Time1,
                                                  NULL, NULL, RTPATH_F_ON_LINK),
-                        1, g_nsTestRun, NULL, "RTPathSetTimesEx/manytree");
+                        1, g_nsTestRun, "RTPathSetTimesEx/manytree");
 }
 
@@ -684,5 +682,5 @@
 
     /* Manytree: */
-    PROFILE_MANYTREE_FN(szPath, fsPerfRenameMany(szPath, iIteration), 2, g_nsTestRun, NULL, "RTPathRename/manytree");
+    PROFILE_MANYTREE_FN(szPath, fsPerfRenameMany(szPath, iIteration), 2, g_nsTestRun, "RTPathRename/manytree");
 }
 
@@ -814,15 +812,68 @@
      * Profile.
      */
-    PROFILE_FN(fsPerfEnumEmpty(), g_nsTestRun, "RTDirOpen/Read/Close empty");
+    PROFILE_FN(fsPerfEnumEmpty(),     g_nsTestRun, "RTDirOpen/Read/Close empty");
     PROFILE_FN(fsPerfEnumManyFiles(), g_nsTestRun, "RTDirOpen/Read/Close manyfiles");
 }
 
 
+void fsPerfMkDirRmDir(void)
+{
+    RTTestISub("mkdir/rmdir");
+
+    /* Non-existing directories: */
+    RTTESTI_CHECK_RC(RTDirRemove(InEmptyDir(RT_STR_TUPLE("no-such-dir"))), VERR_FILE_NOT_FOUND);
+    RTTESTI_CHECK_RC(RTDirRemove(InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file"))), VERR_PATH_NOT_FOUND);
+    RTTESTI_CHECK_RC(RTDirCreate(InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file")), 0755, 0), VERR_PATH_NOT_FOUND);
+
+    /* Already existing directories and files: */
+    RTTESTI_CHECK_RC(RTDirCreate(InEmptyDir(RT_STR_TUPLE(".")), 0755, 0), VERR_ALREADY_EXISTS);
+    RTTESTI_CHECK_RC(RTDirCreate(InEmptyDir(RT_STR_TUPLE("..")), 0755, 0), VERR_ALREADY_EXISTS);
+
+    /* Remove directory with subdirectories: */
+    RTTESTI_CHECK_RC(RTDirRemove(InDir(RT_STR_TUPLE("."))), VERR_DIR_NOT_EMPTY);
+
+    /* Create a directory and remove it: */
+    RTTESTI_CHECK_RC(RTDirCreate(InDir(RT_STR_TUPLE("subdir-1")), 0755, 0), VINF_SUCCESS);
+    RTTESTI_CHECK_RC(RTDirRemove(g_szDir), VINF_SUCCESS);
+
+    /* Create a file and try remove it or create a directory with the same name: */
+    RTFILE hFile1;
+    RTTESTI_CHECK_RC_RETV(RTFileOpen(&hFile1, InDir(RT_STR_TUPLE("file18")),
+                                     RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_NONE | RTFILE_O_WRITE), VINF_SUCCESS);
+    RTTESTI_CHECK_RC(RTFileClose(hFile1), VINF_SUCCESS);
+    RTTESTI_CHECK_RC(RTDirRemove(g_szDir), VERR_NOT_A_DIRECTORY);
+    RTTESTI_CHECK_RC(RTDirCreate(g_szDir, 0755, 0), VERR_ALREADY_EXISTS);
+    RTTESTI_CHECK_RC(RTDirCreate(InDir(RT_STR_TUPLE("file18" RTPATH_SLASH_STR "subdir")), 0755, 0), VERR_PATH_NOT_FOUND);
+
+
+    /*
+     * Profile alternately creating and removing a bunch of directories.
+     */
+    for (;;)
+    {
+        /* Create a bunch: */
+
+        /* Remove the bunch: */
+
+        /* Check if we got time for another round: */
+        break;
+    }
+}
+
+
 void fsPerfRm(void)
 {
     RTTestISub("rm");
 
+    /* Non-existing files. */
     RTTESTI_CHECK_RC(RTFileDelete(InEmptyDir(RT_STR_TUPLE("no-such-file"))), VERR_FILE_NOT_FOUND);
     RTTESTI_CHECK_RC(RTFileDelete(InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file"))), VERR_PATH_NOT_FOUND);
+
+    /* Directories: */
+#ifdef RT_OS_WINDOWS
+    RTTESTI_CHECK_RC(RTFileDelete(InEmptyDir(RT_STR_TUPLE("."))), VERR_ACCESS_DENIED);
+#else
+    RTTESTI_CHECK_RC(RTFileDelete(InEmptyDir(RT_STR_TUPLE("."))), VERR_IS_A_DIRECTORY);
+#endif
 
     /* Shallow: */
@@ -1010,4 +1061,6 @@
                 if (RT_SUCCESS(rc))
                 {
+                    //g_fManyFiles = false;
+
                     /* Do tests: */
                     if (g_fManyFiles)
@@ -1023,11 +1076,10 @@
                     fsPerfRename();
                     vsPerfDirEnum();
-                    /// @todo fsPerfMkDir
-                    /// @todo fsPerfRmDir
+#endif
+                    fsPerfMkDirRmDir();
                     /// @todo fsPerfRead
                     /// @todo fsPerfWrite
                     /// @todo fsPerfSeek
                     /// @todo fsPerfChSize
-#endif
                     fsPerfRm(); /* must come last as it deletes manyfiles and manytree */
                 }
