VirtualBox

Changeset 86366 in vbox


Ignore:
Timestamp:
Sep 30, 2020 8:59:03 PM (4 years ago)
Author:
vboxsync
Message:

tstDndPath: Must disable assertions when code being tested is fed bad stuff that triggers them. bugref:9841

File:
1 edited

Legend:

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

    r85660 r86366  
    2828static void tstPathRebase(RTTEST hTest)
    2929{
    30     struct
     30    static struct
    3131    {
    3232        char const *pszPath;
     
    3535        int rc;
    3636        char const *pszResult;
    37     } aTests[] = {
     37    } const s_aTests[] = {
    3838        /* Invalid stuff. */
    3939        { NULL, NULL, NULL, VERR_INVALID_POINTER, NULL },
     
    5656
    5757    char *pszPath = NULL;
    58     for (size_t i = 0; i < RT_ELEMENTS(aTests); i++)
     58    for (size_t i = 0; i < RT_ELEMENTS(s_aTests); i++)
    5959    {
    60         RTTEST_CHECK_RC(hTest, DnDPathRebase(aTests[i].pszPath, aTests[i].pszPathOld, aTests[i].pszPathNew, &pszPath), aTests[i].rc);
    61         if (RT_SUCCESS(aTests[i].rc))
     60        RTTestDisableAssertions(hTest);
     61        RTTEST_CHECK_RC(hTest, DnDPathRebase(s_aTests[i].pszPath, s_aTests[i].pszPathOld, s_aTests[i].pszPathNew, &pszPath),
     62                        s_aTests[i].rc);
     63        RTTestRestoreAssertions(hTest);
     64        if (RT_SUCCESS(s_aTests[i].rc))
    6265        {
    63             if (aTests[i].pszResult)
    64                 RTTEST_CHECK_MSG(hTest, RTPathCompare(pszPath, aTests[i].pszResult) == 0,
    65                                  (hTest, "Test #%zu failed: Got '%s', expected '%s'", i, pszPath, aTests[i].pszResult));
     66            if (s_aTests[i].pszResult)
     67                RTTEST_CHECK_MSG(hTest, RTPathCompare(pszPath, s_aTests[i].pszResult) == 0,
     68                                 (hTest, "Test #%zu failed: Got '%s', expected '%s'", i, pszPath, s_aTests[i].pszResult));
    6669            RTStrFree(pszPath);
    6770            pszPath = NULL;
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