From fc2df5e752258bb46f72ade35d5517bc39002be2 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Thu, 12 Jul 2018 18:27:48 +0100 Subject: [PATCH] tests: make unload test more comprehensive. Specifically, make sure that the service that we request to unload is not loaded afterwards. --- src/tests/cptests/cptests.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/tests/cptests/cptests.cc b/src/tests/cptests/cptests.cc index c75061b..89034ca 100644 --- a/src/tests/cptests/cptests.cc +++ b/src/tests/cptests/cptests.cc @@ -527,6 +527,19 @@ void cptest_unload() assert(wdata.size() == 1); assert(wdata[0] = DINIT_RP_NAK); + // If we try to FIND service 1 now, it should not be there: + cmd = { DINIT_CP_FINDSERVICE }; + cmd.insert(cmd.end(), name_len_cptr, name_len_cptr + sizeof(name_len)); + cmd.insert(cmd.end(), service_name1, service_name1 + name_len); + + bp_sys::supply_read_data(fd, std::move(cmd)); + + event_loop.regd_bidi_watchers[fd]->read_ready(event_loop, fd); + + bp_sys::extract_written_data(fd, wdata); + assert(wdata.size() == 1); + assert(wdata[0] = DINIT_RP_NOSERVICE); + delete cc; } -- 2.25.1