Fix internal DCB test

The test created a DCB of an unexpected type in an unexpected state with
an invalid file descriptor. This caused the test to fail due to a debug
assertion where the the validity of the file descriptor was asserted in
relation to the internal state of the DCB.
This commit is contained in:
Markus Mäkelä
2017-06-23 14:25:35 +03:00
parent b83538d011
commit be28bf1e23

View File

@ -48,14 +48,12 @@ test1()
DCB *dcb;
SERV_LISTENER dummy;
/* Single buffer tests */
ss_dfprintf(stderr,
"testdcb : creating buffer with type DCB_ROLE_SERVICE_LISTENER");
dcb = dcb_alloc(DCB_ROLE_SERVICE_LISTENER, &dummy);
ss_dfprintf(stderr, "testdcb : creating buffer with type DCB_ROLE_SERVICE_LISTENER");
dcb = dcb_alloc(DCB_ROLE_INTERNAL, &dummy);
printDCB(dcb);
ss_info_dassert(dcb_isvalid(dcb), "New DCB must be valid");
ss_dfprintf(stderr, "\t..done\nAllocated dcb.");
printAllDCBs();
ss_info_dassert(true, "Something is true");
ss_dfprintf(stderr, "\t..done\n");
dcb->state = DCB_STATE_POLLING;
dcb_close(dcb);