diff --git a/test/Makefile b/test/Makefile index a6f9c98..3d04f1e 100644 --- a/test/Makefile +++ b/test/Makefile @@ -42,6 +42,10 @@ TESTPROD += testdata testdata_SRCS += testdata.cpp TESTS += testdata +TESTPROD += testinfo +testinfo_SRCS += testinfo.cpp +TESTS += testinfo + TESTPROD += dummyserv dummyserv_SRCS += dummyserv.cpp # not a unittest diff --git a/test/testinfo.cpp b/test/testinfo.cpp new file mode 100644 index 0000000..e177cd2 --- /dev/null +++ b/test/testinfo.cpp @@ -0,0 +1,145 @@ +/** + * Copyright - See the COPYRIGHT that is included with this distribution. + * pvxs is distributed subject to a Software License Agreement found + * in file LICENSE that is included with this distribution. + */ +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +namespace { +using namespace pvxs; + +struct Tester { + Value initial; + server::SharedPV mbox; + server::Server serv; + client::Context cli; + + Tester() + :initial(nt::NTScalar{TypeCode::Int32}.create()) + ,mbox(server::SharedPV::buildReadonly()) + ,serv(server::Config::localhost() + .build() + .addPV("mailbox", mbox)) + ,cli(serv.clientConfig().build()) + { + testShow()<<"Server:\n"< immediate cancel() + cli.info("mailbox") + .result([&actual, &done](Value&& val) { + actual = std::move(val); + done.trigger(); + }) + .exec(); + + cli.hurryUp(); + + testOk1(!done.wait(2.1)); + } +}; + +} // namespace + +MAIN(testinfo) +{ + testPlan(6); + logger_config_env(); + Tester().loopback(); + Tester().lazy(); + Tester().timeout(); + Tester().cancel(); + return testDone(); +}