Changeset 98638 in vbox for trunk/src/VBox/GuestHost/DragAndDrop
- Timestamp:
- Feb 20, 2023 9:30:14 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/DragAndDrop/testcase/tstDnDTransferList.cpp
r98103 r98638 138 138 139 139 /* From URI data. */ 140 #if def RT_OS_WINDOWS140 #if RTPATH_STYLE == RTPATH_STR_F_STYLE_DOS 141 141 RTStrPrintf(szPathTest, sizeof(szPathTest), "C:/Windows/"); 142 const charszURI[] =142 static const char s_szURI[] = 143 143 "file:///C:/Windows/System32/Boot/\r\n" 144 144 "file:///C:/Windows/System/\r\n"; 145 static const char s_szURIFmtURI[] = 146 "file:///base/System32/Boot/\r\n" 147 "file:///base/System/\r\n"; 148 static const char s_szURIFmtNative[] = 149 "\\base\\System32\\Boot\\\r\n" 150 "\\base\\System\\\r\n"; 145 151 #else 146 152 RTStrPrintf(szPathTest, sizeof(szPathTest), "/usr/"); 147 const charszURI[] =153 static const char s_szURI[] = 148 154 "file:///usr/bin/\r\n" 149 155 "file:///usr/lib/\r\n"; 156 static const char s_szURIFmtURI[] = 157 "file:///base/bin/\r\n" 158 "file:///base/lib/\r\n"; 159 static const char s_szURIFmtNative[] = 160 "/base/bin/\r\n" 161 "/base/lib/\r\n"; 150 162 #endif 151 163 152 RTTEST_CHECK_RC(hTest, DnDTransferListAppendPathsFromBuffer(&list, DNDTRANSFERLISTFMT_URI, s zURI, sizeof(szURI), "\r\n",164 RTTEST_CHECK_RC(hTest, DnDTransferListAppendPathsFromBuffer(&list, DNDTRANSFERLISTFMT_URI, s_szURI, sizeof(s_szURI), "\r\n", 153 165 DNDTRANSFERLIST_FLAGS_NONE), VINF_SUCCESS); 154 166 RTTEST_CHECK(hTest, DnDTransferListGetRootCount(&list) == 2); … … 158 170 pszBuf = NULL; 159 171 RTTEST_CHECK_RC(hTest, DnDTransferListGetRootsEx(&list, DNDTRANSFERLISTFMT_URI, "/base/", "\r\n", &pszBuf, &cbBuf), VINF_SUCCESS); 160 RTTEST_CHECK_MSG(hTest, RTStrCmp(pszBuf, "file:///base/bin/\r\nfile:///base/lib/\r\n") == 0, (hTest, "Got '%s'", pszBuf));172 RTTEST_CHECK_MSG(hTest, RTStrCmp(pszBuf, s_szURIFmtURI) == 0, (hTest, "Got '%s'", pszBuf)); 161 173 RTTEST_CHECK_MSG(hTest, cbBuf == strlen(pszBuf) + 1, (hTest, "Got %d, expected %d\n", cbBuf, strlen(pszBuf) + 1)); 162 174 RTStrFree(pszBuf); … … 164 176 pszBuf = NULL; 165 177 RTTEST_CHECK_RC(hTest, DnDTransferListGetRootsEx(&list, DNDTRANSFERLISTFMT_NATIVE, "/base/", "\r\n", &pszBuf, &cbBuf), VINF_SUCCESS); 166 RTTEST_CHECK_MSG(hTest, RTStrCmp(pszBuf, "/base/bin/\r\n/base/lib/\r\n") == 0, (hTest, "Got '%s'", pszBuf)); 178 RTTEST_CHECK_MSG(hTest, RTStrCmp(pszBuf, s_szURIFmtNative) == 0, 179 (hTest, "Expected %.*Rhxs\nGot %.*Rhxs\n '%s'", 180 sizeof(s_szURIFmtNative) - 1, s_szURIFmtNative, 181 strlen(pszBuf), pszBuf, pszBuf)); 167 182 RTTEST_CHECK_MSG(hTest, cbBuf == strlen(pszBuf) + 1, (hTest, "Got %d, expected %d\n", cbBuf, strlen(pszBuf) + 1)); 168 183 RTStrFree(pszBuf);
Note:
See TracChangeset
for help on using the changeset viewer.