Changeset 63123 in vbox for trunk/src/VBox/HostServices/SharedFolders/testcase
- Timestamp:
- Aug 7, 2016 3:39:54 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp
r62876 r63123 116 116 *********************************************************************************************************************************/ 117 117 118 static PRTDIR testRTDirClosepDir;118 static PRTDIR g_testRTDirClosepDir; 119 119 120 120 extern int testRTDirClose(PRTDIR pDir) 121 121 { 122 122 /* RTPrintf("%s: pDir=%p\n", __PRETTY_FUNCTION__, pDir); */ 123 testRTDirClosepDir = pDir;123 g_testRTDirClosepDir = pDir; 124 124 return VINF_SUCCESS; 125 125 } … … 159 159 } 160 160 161 static PRTDIR testRTDirQueryInfoDir;161 static PRTDIR g_testRTDirQueryInfoDir; 162 162 static RTTIMESPEC testRTDirQueryInfoATime; 163 163 … … 167 167 /* RTPrintf("%s: pDir=%p, enmAdditionalAttribs=0x%llx\n", __PRETTY_FUNCTION__, 168 168 pDir, LLUIFY(enmAdditionalAttribs)); */ 169 testRTDirQueryInfoDir = pDir;169 g_testRTDirQueryInfoDir = pDir; 170 170 RT_ZERO(*pObjInfo); 171 171 pObjInfo->AccessTime = testRTDirQueryInfoATime; … … 181 181 } 182 182 183 static PRTDIR testRTDirReadExDir;183 static PRTDIR g_testRTDirReadExDir; 184 184 185 185 extern int testRTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, … … 190 190 __PRETTY_FUNCTION__, pDir, pcbDirEntry ? (int) *pcbDirEntry : -1, 191 191 LLUIFY(enmAdditionalAttribs), LLUIFY(fFlags)); */ 192 testRTDirReadExDir = pDir;192 g_testRTDirReadExDir = pDir; 193 193 return VERR_NO_MORE_FILES; 194 194 } … … 214 214 } 215 215 216 static RTFILE testRTFileCloseFile;216 static RTFILE g_testRTFileCloseFile; 217 217 218 218 extern int testRTFileClose(RTFILE File) 219 219 { 220 220 /* RTPrintf("%s: File=%p\n", __PRETTY_FUNCTION__, File); */ 221 testRTFileCloseFile = File;221 g_testRTFileCloseFile = File; 222 222 return 0; 223 223 } … … 230 230 } 231 231 232 static RTFILE testRTFileFlushFile;232 static RTFILE g_testRTFileFlushFile; 233 233 234 234 extern int testRTFileFlush(RTFILE File) 235 235 { 236 236 /* RTPrintf("%s: File=%p\n", __PRETTY_FUNCTION__, File); */ 237 testRTFileFlushFile = File;238 return VINF_SUCCESS; 239 } 240 241 static RTFILE testRTFileLockFile;237 g_testRTFileFlushFile = File; 238 return VINF_SUCCESS; 239 } 240 241 static RTFILE g_testRTFileLockFile; 242 242 static unsigned testRTFileLockfLock; 243 243 static int64_t testRTFileLockOffset; … … 249 249 __PRETTY_FUNCTION__, hFile, fLock, (long long) offLock, 250 250 LLUIFY(cbLock)); */ 251 testRTFileLockFile = hFile;251 g_testRTFileLockFile = hFile; 252 252 testRTFileLockfLock = fLock; 253 253 testRTFileLockOffset = offLock; … … 271 271 } 272 272 273 static RTFILE testRTFileQueryInfoFile;273 static RTFILE g_testRTFileQueryInfoFile; 274 274 static RTTIMESPEC testRTFileQueryInfoATime; 275 275 static uint32_t testRTFileQueryInfoFMode; … … 280 280 /* RTPrintf("%s, hFile=%p, enmAdditionalAttribs=0x%llx\n", 281 281 __PRETTY_FUNCTION__, hFile, LLUIFY(enmAdditionalAttribs)); */ 282 testRTFileQueryInfoFile = hFile;282 g_testRTFileQueryInfoFile = hFile; 283 283 RT_ZERO(*pObjInfo); 284 284 pObjInfo->AccessTime = testRTFileQueryInfoATime; … … 323 323 } 324 324 325 static RTFILE testRTFileSetSizeFile;325 static RTFILE g_testRTFileSetSizeFile; 326 326 static RTFOFF testRTFileSetSizeSize; 327 327 … … 330 330 /* RTPrintf("%s: File=%llu, cbSize=%llu\n", __PRETTY_FUNCTION__, LLUIFY(File), 331 331 LLUIFY(cbSize)); */ 332 testRTFileSetSizeFile = File;332 g_testRTFileSetSizeFile = File; 333 333 testRTFileSetSizeSize = (RTFOFF) cbSize; /* Why was this signed before? */ 334 334 return VINF_SUCCESS; … … 355 355 } 356 356 357 static RTFILE testRTFileUnlockFile;357 static RTFILE g_testRTFileUnlockFile; 358 358 static int64_t testRTFileUnlockOffset; 359 359 static uint64_t testRTFileUnlockSize; … … 363 363 /* RTPrintf("%s: hFile=%p, ofLock=%lli, cbLock=%llu\n", __PRETTY_FUNCTION__, 364 364 File, (long long) offLock, LLUIFY(cbLock)); */ 365 testRTFileUnlockFile = File;365 g_testRTFileUnlockFile = File; 366 366 testRTFileUnlockOffset = offLock; 367 367 testRTFileUnlockSize = cbLock; … … 759 759 AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService)); 760 760 RTTestGuardedFree(hTest, svcTable.pvService); 761 RTTEST_CHECK_MSG(hTest, testRTFileCloseFile == hcFile,762 (hTest, "File=% llu\n", LLUIFY(testRTFileCloseFile)));761 RTTEST_CHECK_MSG(hTest, g_testRTFileCloseFile == hcFile, 762 (hTest, "File=%u\n", (uintptr_t)g_testRTFileCloseFile)); 763 763 } 764 764 … … 790 790 AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService)); 791 791 RTTestGuardedFree(hTest, svcTable.pvService); 792 RTTEST_CHECK_MSG(hTest, 793 testRTDirClosepDir == pcDir, 794 (hTest, "pDir=%llu\n", LLUIFY(testRTDirClosepDir))); 792 RTTEST_CHECK_MSG(hTest, g_testRTDirClosepDir == pcDir, (hTest, "pDir=%p\n", g_testRTDirClosepDir)); 795 793 } 796 794 … … 824 822 (hTest, "cbRead=%llu\n", LLUIFY(cbRead))); 825 823 unmapAndRemoveMapping(hTest, &svcTable, Root, "testname"); 826 RTTEST_CHECK_MSG(hTest, testRTFileCloseFile == hcFile, 827 (hTest, "File=%llu\n", LLUIFY(testRTFileCloseFile))); 824 RTTEST_CHECK_MSG(hTest, g_testRTFileCloseFile == hcFile, (hTest, "File=%u\n", g_testRTFileCloseFile)); 828 825 AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService)); 829 826 RTTestGuardedFree(hTest, svcTable.pvService); … … 858 855 (hTest, "cbWritten=%llu\n", LLUIFY(cbWritten))); 859 856 unmapAndRemoveMapping(hTest, &svcTable, Root, "testname"); 860 RTTEST_CHECK_MSG(hTest, testRTFileCloseFile == hcFile, 861 (hTest, "File=%llu\n", LLUIFY(testRTFileCloseFile))); 857 RTTEST_CHECK_MSG(hTest, g_testRTFileCloseFile == hcFile, (hTest, "File=%u\n", g_testRTFileCloseFile)); 862 858 AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService)); 863 859 RTTestGuardedFree(hTest, svcTable.pvService); … … 882 878 rc = flushFile(&svcTable, Root, Handle); 883 879 RTTEST_CHECK_RC_OK(hTest, rc); 884 RTTEST_CHECK_MSG(hTest, testRTFileFlushFile == hcFile, 885 (hTest, "File=%llu\n", LLUIFY(testRTFileFlushFile))); 880 RTTEST_CHECK_MSG(hTest, g_testRTFileFlushFile == hcFile, (hTest, "File=%u\n", g_testRTFileFlushFile)); 886 881 unmapAndRemoveMapping(hTest, &svcTable, Root, "testname"); 887 882 AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService)); 888 883 RTTestGuardedFree(hTest, svcTable.pvService); 889 RTTEST_CHECK_MSG(hTest, testRTFileCloseFile == hcFile, 890 (hTest, "File=%llu\n", LLUIFY(testRTFileCloseFile))); 884 RTTEST_CHECK_MSG(hTest, g_testRTFileCloseFile == hcFile, (hTest, "File=%u\n", g_testRTFileCloseFile)); 891 885 } 892 886 … … 912 906 &DirInfo, sizeof(DirInfo), 0, &cFiles); 913 907 RTTEST_CHECK_RC(hTest, rc, VERR_NO_MORE_FILES); 914 RTTEST_CHECK_MSG(hTest, testRTDirReadExDir == pcDir, 915 (hTest, "Dir=%llu\n", LLUIFY(testRTDirReadExDir))); 908 RTTEST_CHECK_MSG(hTest, g_testRTDirReadExDir == pcDir, (hTest, "Dir=%p\n", g_testRTDirReadExDir)); 916 909 RTTEST_CHECK_MSG(hTest, cFiles == 0, 917 910 (hTest, "cFiles=%llu\n", LLUIFY(cFiles))); … … 919 912 AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService)); 920 913 RTTestGuardedFree(hTest, svcTable.pvService); 921 RTTEST_CHECK_MSG(hTest, 922 testRTDirClosepDir == pcDir, 923 (hTest, "pDir=%llu\n", LLUIFY(testRTDirClosepDir))); 914 RTTEST_CHECK_MSG(hTest, g_testRTDirClosepDir == pcDir, (hTest, "pDir=%p\n", g_testRTDirClosepDir)); 924 915 } 925 916 … … 947 938 &Info); 948 939 RTTEST_CHECK_RC_OK(hTest, rc); 949 RTTEST_CHECK_MSG(hTest, testRTFileQueryInfoFile == hcFile, 950 (hTest, "File=%llu\n", LLUIFY(testRTFileQueryInfoFile))); 940 RTTEST_CHECK_MSG(hTest, g_testRTFileQueryInfoFile == hcFile, (hTest, "File=%u\n", g_testRTFileQueryInfoFile)); 951 941 RTTEST_CHECK_MSG(hTest, Info.Attr.fMode == fMode, 952 942 (hTest, "cbObject=%llu\n", LLUIFY(Info.cbObject))); … … 961 951 AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService)); 962 952 RTTestGuardedFree(hTest, svcTable.pvService); 963 RTTEST_CHECK_MSG(hTest, testRTFileCloseFile == hcFile, 964 (hTest, "File=%llu\n", LLUIFY(testRTFileCloseFile))); 953 RTTEST_CHECK_MSG(hTest, g_testRTFileCloseFile == hcFile, (hTest, "File=%u\n", g_testRTFileCloseFile)); 965 954 } 966 955 … … 988 977 &Info); 989 978 RTTEST_CHECK_RC_OK(hTest, rc); 990 RTTEST_CHECK_MSG(hTest, testRTDirQueryInfoDir == pcDir, 991 (hTest, "Dir=%llu\n", LLUIFY(testRTDirQueryInfoDir))); 979 RTTEST_CHECK_MSG(hTest, g_testRTDirQueryInfoDir == pcDir, (hTest, "Dir=%p\n", g_testRTDirQueryInfoDir)); 992 980 RTTEST_CHECK_MSG(hTest, RTTimeSpecGetNano(&Info.AccessTime) == ccAtimeNano, 993 981 (hTest, "ATime=%llu\n", … … 1005 993 AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService)); 1006 994 RTTestGuardedFree(hTest, svcTable.pvService); 1007 RTTEST_CHECK_MSG(hTest, testRTDirClosepDir == pcDir, 1008 (hTest, "File=%llu\n", LLUIFY(testRTDirClosepDir))); 995 RTTEST_CHECK_MSG(hTest, g_testRTDirClosepDir == pcDir, (hTest, "pDir=%p\n", g_testRTDirClosepDir)); 1009 996 } 1010 997 … … 1032 1019 &Info); 1033 1020 RTTEST_CHECK_RC_OK(hTest, rc); 1034 RTTEST_CHECK_MSG(hTest, testRTFileQueryInfoFile == hcFile, 1035 (hTest, "File=%llu\n", LLUIFY(testRTFileQueryInfoFile))); 1021 RTTEST_CHECK_MSG(hTest, g_testRTFileQueryInfoFile == hcFile, (hTest, "File=%u\n", g_testRTFileQueryInfoFile)); 1036 1022 RTTEST_CHECK_MSG(hTest, RTTimeSpecGetNano(&Info.AccessTime) == ccAtimeNano, 1037 1023 (hTest, "ATime=%llu\n", … … 1049 1035 AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService)); 1050 1036 RTTestGuardedFree(hTest, svcTable.pvService); 1051 RTTEST_CHECK_MSG(hTest, testRTFileCloseFile == hcFile, 1052 (hTest, "File=%llu\n", LLUIFY(testRTFileCloseFile))); 1037 RTTEST_CHECK_MSG(hTest, g_testRTFileCloseFile == hcFile, (hTest, "File=%u\n", g_testRTFileCloseFile)); 1053 1038 } 1054 1039 … … 1076 1061 sizeof(Info), &Info); 1077 1062 RTTEST_CHECK_RC_OK(hTest, rc); 1078 RTTEST_CHECK_MSG(hTest, testRTFileSetSizeFile == hcFile, 1079 (hTest, "File=%llu\n", LLUIFY(testRTFileSetSizeFile))); 1063 RTTEST_CHECK_MSG(hTest, g_testRTFileSetSizeFile == hcFile, (hTest, "File=%u\n", g_testRTFileSetSizeFile)); 1080 1064 RTTEST_CHECK_MSG(hTest, testRTFileSetSizeSize == cbNew, 1081 1065 (hTest, "Size=%llu\n", LLUIFY(testRTFileSetSizeSize))); … … 1083 1067 AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService)); 1084 1068 RTTestGuardedFree(hTest, svcTable.pvService); 1085 RTTEST_CHECK_MSG(hTest, testRTFileCloseFile == hcFile, 1086 (hTest, "File=%llu\n", LLUIFY(testRTFileCloseFile))); 1069 RTTEST_CHECK_MSG(hTest, g_testRTFileCloseFile == hcFile, (hTest, "File=%u\n", g_testRTFileCloseFile)); 1087 1070 } 1088 1071 … … 1108 1091 RTTEST_CHECK_RC_OK(hTest, rc); 1109 1092 #ifdef RT_OS_WINDOWS /* Locking is a no-op elsewhere. */ 1110 RTTEST_CHECK_MSG(hTest, testRTFileLockFile == hcFile, 1111 (hTest, "File=%llu\n", LLUIFY(testRTFileLockFile))); 1093 RTTEST_CHECK_MSG(hTest, g_testRTFileLockFile == hcFile, (hTest, "File=%u\n", g_testRTFileLockFile)); 1112 1094 RTTEST_CHECK_MSG(hTest, testRTFileLockfLock == 0, 1113 1095 (hTest, "fLock=%u\n", testRTFileLockfLock)); … … 1120 1102 RTTEST_CHECK_RC_OK(hTest, rc); 1121 1103 #ifdef RT_OS_WINDOWS 1122 RTTEST_CHECK_MSG(hTest, testRTFileUnlockFile == hcFile, 1123 (hTest, "File=%llu\n", LLUIFY(testRTFileUnlockFile))); 1104 RTTEST_CHECK_MSG(hTest, g_testRTFileUnlockFile == hcFile, (hTest, "File=%u\n", g_testRTFileUnlockFile)); 1124 1105 RTTEST_CHECK_MSG(hTest, testRTFileUnlockOffset == offLock, 1125 1106 (hTest, "Offs=%llu\n", … … 1131 1112 AssertReleaseRC(svcTable.pfnDisconnect(NULL, 0, svcTable.pvService)); 1132 1113 RTTestGuardedFree(hTest, svcTable.pvService); 1133 RTTEST_CHECK_MSG(hTest, testRTFileCloseFile == hcFile, 1134 (hTest, "File=%llu\n", LLUIFY(testRTFileCloseFile))); 1114 RTTEST_CHECK_MSG(hTest, g_testRTFileCloseFile == hcFile, (hTest, "File=%u\n", g_testRTFileCloseFile)); 1135 1115 } 1136 1116
Note:
See TracChangeset
for help on using the changeset viewer.