VirtualBox

Changeset 27638 in vbox for trunk/src


Ignore:
Timestamp:
Mar 23, 2010 3:28:07 PM (15 years ago)
Author:
vboxsync
Message:

tstRTPoll: Added test for only polling on RTPOLL_EVT_ERROR on a writable pipe. Adjusted a broken pipe test to work on linux, both error and write are set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstRTPoll.cpp

    r27509 r27638  
    160160    RTTESTI_CHECK_RC(RTPoll(hSet, 1, NULL,  NULL), VERR_TIMEOUT);
    161161
     162    /* add the write pipe with error detection only, check that poll still times out. remove it again. */
     163    RTTESTI_CHECK_RC(RTPollSetAddPipe(hSet, hPipeW, RTPOLL_EVT_ERROR, 11 /*id*/), VINF_SUCCESS);
     164    RTTESTI_CHECK_RETV(RTPollSetGetCount(hSet) == 2);
     165    RTTESTI_CHECK_RC(RTPollSetQueryHandle(hSet, 11 /*id*/, NULL), VINF_SUCCESS);
     166
     167    RTTESTI_CHECK_RC(RTPoll(hSet, 0, NULL,  NULL), VERR_TIMEOUT);
     168    RTTESTI_CHECK_RC(RTPoll(hSet, 1, NULL,  NULL), VERR_TIMEOUT);
     169
     170    RTTESTI_CHECK_RC(RTPollSetRemove(hSet, 11), VINF_SUCCESS);
     171    RTTESTI_CHECK_RETV(RTPollSetGetCount(hSet) == 1);
     172
    162173    /* add the write pipe */
    163174    RTTESTI_CHECK_RC(RTPollSetAddPipe(hSet, hPipeW, RTPOLL_EVT_WRITE, 10 /*id*/), VINF_SUCCESS);
     
    322333    RTTESTI_CHECK_RC(RTPollNoResume(hSet, 0, &fEvents, &id), VINF_SUCCESS);
    323334    RTTESTI_CHECK(id == 10);
    324     RTTESTI_CHECK(fEvents == RTPOLL_EVT_ERROR);
     335    RTTESTI_CHECK_MSG(   fEvents == RTPOLL_EVT_ERROR \
     336                      || fEvents == (RTPOLL_EVT_ERROR | RTPOLL_EVT_WRITE), ("%#x\n", fEvents));
    325337
    326338    RTTESTI_CHECK_RC(RTPollSetDestroy(hSet), VINF_SUCCESS);
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