Index: trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
===================================================================
--- trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp	(revision 76873)
+++ trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp	(revision 76878)
@@ -150,4 +150,13 @@
 
 
+/** @def FSPERF_VERR_PATH_NOT_FOUND
+ * Hides the fact that we only get VERR_PATH_NOT_FOUND on non-unix systems.  */
+#if defined(RT_OS_WINDOWS) //|| defined(RT_OS_OS2) - using posix APIs IIRC, so lost in translation.
+# define FSPERF_VERR_PATH_NOT_FOUND     VERR_PATH_NOT_FOUND
+#else
+# define FSPERF_VERR_PATH_NOT_FOUND     VERR_FILE_NOT_FOUND
+#endif
+
+
 /*********************************************************************************************************************************
 *   Structures and Typedefs                                                                                                      *
@@ -374,4 +383,5 @@
 DECLINLINE(char *) InDir(const char *pszAppend, size_t cchAppend)
 {
+    Assert(g_szDir[g_cchDir - 1] == RTPATH_SLASH);
     memcpy(&g_szDir[g_cchDir], pszAppend, cchAppend);
     g_szDir[g_cchDir + cchAppend] = '\0';
@@ -389,4 +399,5 @@
 DECLINLINE(char *) InEmptyDir(const char *pszAppend, size_t cchAppend)
 {
+    Assert(g_szEmptyDir[g_cchEmptyDir - 1] == RTPATH_SLASH);
     memcpy(&g_szEmptyDir[g_cchEmptyDir], pszAppend, cchAppend);
     g_szEmptyDir[g_cchEmptyDir + cchAppend] = '\0';
@@ -404,4 +415,5 @@
 DECLINLINE(char *) InDeepDir(const char *pszAppend, size_t cchAppend)
 {
+    Assert(g_szDeepDir[g_cchDeepDir - 1] == RTPATH_SLASH);
     memcpy(&g_szDeepDir[g_cchDeepDir], pszAppend, cchAppend);
     g_szDeepDir[g_cchDeepDir + cchAppend] = '\0';
@@ -542,5 +554,5 @@
                                 RTFILE_O_OPEN | RTFILE_O_DENY_NONE | RTFILE_O_READ), VERR_FILE_NOT_FOUND);
     RTTESTI_CHECK_RC(RTFileOpen(&hFile, InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file")),
-                                RTFILE_O_OPEN | RTFILE_O_DENY_NONE | RTFILE_O_READ), VERR_PATH_NOT_FOUND);
+                                RTFILE_O_OPEN | RTFILE_O_DENY_NONE | RTFILE_O_READ), FSPERF_VERR_PATH_NOT_FOUND);
 
     /*
@@ -647,5 +659,5 @@
                                        &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK), VERR_FILE_NOT_FOUND);
     RTTESTI_CHECK_RC(RTPathQueryInfoEx(InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file")),
-                                       &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK), VERR_PATH_NOT_FOUND);
+                                       &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK), FSPERF_VERR_PATH_NOT_FOUND);
 
     /* Shallow: */
@@ -688,5 +700,5 @@
                      VERR_FILE_NOT_FOUND);
     RTTESTI_CHECK_RC(RTPathSetMode(InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file")), 0665),
-                     VERR_PATH_NOT_FOUND);
+                     FSPERF_VERR_PATH_NOT_FOUND);
 
     /* Shallow: */
@@ -733,5 +745,5 @@
     RTTESTI_CHECK_RC(RTPathSetTimesEx(InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file")),
                                       NULL, &Time1, NULL, NULL, RTPATH_F_ON_LINK),
-                     VERR_PATH_NOT_FOUND);
+                     FSPERF_VERR_PATH_NOT_FOUND);
 
     /* Shallow: */
@@ -800,5 +812,5 @@
     strcpy(szPath, InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "other-no-such-file")));
     RTTESTI_CHECK_RC(RTPathRename(InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file")), szPath, 0),
-                     VERR_PATH_NOT_FOUND);
+                     FSPERF_VERR_PATH_NOT_FOUND);
 
     RTFILE hFile1;
@@ -807,6 +819,6 @@
     RTTESTI_CHECK_RC(RTFileClose(hFile1), VINF_SUCCESS);
     strcat(strcpy(szPath, g_szDir), "-no-such-dir" RTPATH_SLASH_STR "file16");
-    RTTESTI_CHECK_RC(RTPathRename(szPath, g_szDir, 0), VERR_PATH_NOT_FOUND);
-    RTTESTI_CHECK_RC(RTPathRename(g_szDir, szPath, 0), VERR_PATH_NOT_FOUND);
+    RTTESTI_CHECK_RC(RTPathRename(szPath, g_szDir, 0), FSPERF_VERR_PATH_NOT_FOUND);
+    RTTESTI_CHECK_RC(RTPathRename(g_szDir, szPath, 0), FSPERF_VERR_PATH_NOT_FOUND);
 
     /* Shallow: */
@@ -969,6 +981,10 @@
     /* 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);
+    RTTESTI_CHECK_RC(RTDirRemove(InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file"))), FSPERF_VERR_PATH_NOT_FOUND);
+    RTTESTI_CHECK_RC(RTDirCreate(InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file")), 0755, 0), FSPERF_VERR_PATH_NOT_FOUND);
+
+    /** @todo check what happens if non-final path component isn't a directory. unix
+     *        should return ENOTDIR and IPRT translates that to VERR_PATH_NOT_FOUND.
+     *        Curious what happens on windows. */
 
     /* Already existing directories and files: */
@@ -977,5 +993,11 @@
 
     /* Remove directory with subdirectories: */
+#if defined(RT_OS_WINDOWS)
     RTTESTI_CHECK_RC(RTDirRemove(InDir(RT_STR_TUPLE("."))), VERR_DIR_NOT_EMPTY);
+#else
+    RTTESTI_CHECK_RC(RTDirRemove(InDir(RT_STR_TUPLE("."))), VERR_INVALID_PARAMETER); /* EINVAL for '.' */
+#endif
+    RTTESTI_CHECK_RC(RTDirRemove(InDir(RT_STR_TUPLE(".."))), VERR_DIR_NOT_EMPTY);
+    RTTESTI_CHECK_RC(RTDirRemove(InDir(RT_STR_TUPLE(""))), VERR_DIR_NOT_EMPTY);
 
     /* Create a directory and remove it: */
@@ -991,5 +1013,4 @@
     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);
-
 
     /*
@@ -1065,12 +1086,10 @@
     /* 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);
+    RTTESTI_CHECK_RC(RTFileDelete(InEmptyDir(RT_STR_TUPLE("no-such-dir" RTPATH_SLASH_STR "no-such-file"))), FSPERF_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
+    RTTESTI_CHECK_RC(RTFileDelete(InEmptyDir(RT_STR_TUPLE(".."))), VERR_ACCESS_DENIED);
+    RTTESTI_CHECK_RC(RTFileDelete(InEmptyDir(RT_STR_TUPLE(""))), VERR_ACCESS_DENIED);
 
     /* Shallow: */
@@ -1278,5 +1297,9 @@
         { VINF_SUCCESS,         RTFILE_SEEK_END,      -(int64_t)cbFile/2,       cbFile / 2 + (cbFile & 1) },
         { VINF_SUCCESS,         RTFILE_SEEK_CURRENT,  -(int64_t)cbFile/2,       0 },
+#if defined(RT_OS_WINDOWS)
         { VERR_NEGATIVE_SEEK,   RTFILE_SEEK_CURRENT,  -1,                       0 },
+#else
+        { VERR_INVALID_PARAMETER, RTFILE_SEEK_CURRENT, -1,                      0 },
+#endif
         { VINF_SUCCESS,         RTFILE_SEEK_CURRENT,  0,                        0 },
     };
@@ -1735,4 +1758,6 @@
             if (RT_SUCCESS(rc))
             {
+                g_szEmptyDir[g_cchEmptyDir++] = RTPATH_SLASH;
+                g_szEmptyDir[g_cchEmptyDir]   = '\0';
                 RTTestIPrintf(RTTESTLVL_ALWAYS, "Empty dir: %s\n", g_szEmptyDir);
 
