VirtualBox

Changeset 70747 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Jan 25, 2018 4:14:15 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
120515
Message:

ValidationKit/utils/UsbTest: Adjust to correct error code for certain tests to avoid assertions in RTErrConvertFromErrno()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/usb/UsbTest.cpp

    r69753 r70747  
    507507
    508508                if (rcPosix < 0)
    509                     RTTestFailed(g_hTest, "Test failed with %Rrc\n", RTErrConvertFromErrno(errno));
     509                {
     510                    /*
     511                     * The error status code of the unlink testcase is
     512                     * offset by 2000 for the sync and 1000 for the sync code path
     513                     * (see drivers/usb/misc/usbtest.c in the Linux kernel sources).
     514                     *
     515                     * Adjust to the actual status code so converting doesn't assert.
     516                     */
     517                    int iTmpErrno = errno;
     518                    if (iTmpErrno >= 2000)
     519                        iTmpErrno -= 2000;
     520                    else if (iTmpErrno >= 1000)
     521                        iTmpErrno -= 1000;
     522                    RTTestFailed(g_hTest, "Test failed with %Rrc\n", RTErrConvertFromErrno(iTmpErrno));
     523                }
    510524                else
    511525                {
Note: See TracChangeset for help on using the changeset viewer.

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