VirtualBox

Ignore:
Timestamp:
Feb 20, 2023 9:30:14 AM (2 years ago)
Author:
vboxsync
Message:

DnD/tstDndTransferList: Buggy testcase.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/DragAndDrop/testcase/tstDnDTransferList.cpp

    r98103 r98638  
    138138
    139139    /* From URI data. */
    140 #ifdef RT_OS_WINDOWS
     140#if RTPATH_STYLE == RTPATH_STR_F_STYLE_DOS
    141141    RTStrPrintf(szPathTest, sizeof(szPathTest),  "C:/Windows/");
    142     const char szURI[] =
     142    static const char s_szURI[] =
    143143        "file:///C:/Windows/System32/Boot/\r\n"
    144144        "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";
    145151#else
    146152    RTStrPrintf(szPathTest, sizeof(szPathTest), "/usr/");
    147     const char szURI[] =
     153    static const char s_szURI[] =
    148154        "file:///usr/bin/\r\n"
    149155        "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";
    150162#endif
    151163
    152     RTTEST_CHECK_RC(hTest, DnDTransferListAppendPathsFromBuffer(&list, DNDTRANSFERLISTFMT_URI, szURI, sizeof(szURI), "\r\n",
     164    RTTEST_CHECK_RC(hTest, DnDTransferListAppendPathsFromBuffer(&list, DNDTRANSFERLISTFMT_URI, s_szURI, sizeof(s_szURI), "\r\n",
    153165                                                                DNDTRANSFERLIST_FLAGS_NONE), VINF_SUCCESS);
    154166    RTTEST_CHECK(hTest, DnDTransferListGetRootCount(&list) == 2);
     
    158170    pszBuf = NULL;
    159171    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));
    161173    RTTEST_CHECK_MSG(hTest, cbBuf == strlen(pszBuf) + 1, (hTest, "Got %d, expected %d\n", cbBuf, strlen(pszBuf) + 1));
    162174    RTStrFree(pszBuf);
     
    164176    pszBuf = NULL;
    165177    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));
    167182    RTTEST_CHECK_MSG(hTest, cbBuf == strlen(pszBuf) + 1, (hTest, "Got %d, expected %d\n", cbBuf, strlen(pszBuf) + 1));
    168183    RTStrFree(pszBuf);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette