MXS-2196: Fix core unit tests

Fixed the tests so that they properly allocate a service and a listener
for it after which a new session and a DCB are created.
This commit is contained in:
Markus Mäkelä
2018-12-03 21:19:03 +02:00
parent 43c33e9f4a
commit cb18670013
3 changed files with 20 additions and 3 deletions

View File

@ -50,7 +50,10 @@ static int test1()
DCB* dcb;
/* Single buffer tests */
fprintf(stderr, "testdcb : creating buffer with type DCB_ROLE_INTERNAL");
dcb = dcb_alloc(DCB_ROLE_INTERNAL, nullptr);
auto service = service_alloc("service", "readconnroute", nullptr);
auto listener = Listener::create(service, "listener", "mariadbclient", "0.0.0.0", 3306, "", "", nullptr);
auto session = new mxs::Session(listener);
dcb = dcb_alloc(DCB_ROLE_INTERNAL, session);
printDCB(dcb);
fprintf(stderr, "\t..done\nAllocated dcb.");
// TODO: Without running workers, the following will hang. As it does not