6 #include "baseproc-sys.h"
9 #define RUN_TEST(name) \
10 std::cout << #name "... "; \
12 std::cout << "PASSED" << std::endl;
17 int fd = bp_sys::allocfd();
18 auto *cc = new control_conn_t(event_loop, &sset, fd);
20 bp_sys::supply_read_data(fd, { DINIT_CP_QUERYVERSION });
22 event_loop.regd_bidi_watchers[fd]->read_ready(event_loop, fd);
24 // Write will process immediately, so there's no need for this:
25 //event_loop.regd_bidi_watchers[fd]->write_ready(event_loop, fd);
27 // We expect a version number back:
28 std::vector<char> wdata;
29 bp_sys::extract_written_data(fd, wdata);
31 assert(wdata.size() == 5);
32 assert(wdata[0] == DINIT_RP_CPVERSION);
37 int main(int argc, char **argv)