test PDB get w/ filter
This commit is contained in:
+42
-1
@@ -292,6 +292,45 @@ void testGroupMonitorTriggers(pvac::ClientProvider& client)
|
||||
#endif
|
||||
}
|
||||
|
||||
void testFilters(pvac::ClientProvider& client)
|
||||
{
|
||||
testDiag("test w/ server side filters");
|
||||
|
||||
pvd::shared_vector<const pvd::int16> expected;
|
||||
{
|
||||
pvd::shared_vector<pvd::int16> scratch(9);
|
||||
scratch[0] = 9;
|
||||
scratch[1] = 8;
|
||||
scratch[2] = 7;
|
||||
scratch[3] = 6;
|
||||
scratch[4] = 5;
|
||||
scratch[5] = 4;
|
||||
scratch[6] = 3;
|
||||
scratch[7] = 2;
|
||||
scratch[8] = 1;
|
||||
expected = pvd::freeze(scratch);
|
||||
}
|
||||
|
||||
client.connect("TEST").put().set("value", expected).exec();
|
||||
|
||||
pvd::PVStructure::const_shared_pointer root(client.connect("TEST").get());
|
||||
|
||||
testFieldEqual<pvd::PVShortArray>(root, "value", expected);
|
||||
|
||||
root = client.connect("TEST.{\"arr\":{\"i\":2}}").get();
|
||||
{
|
||||
pvd::shared_vector<pvd::int16> scratch(5);
|
||||
scratch[0] = 9;
|
||||
scratch[1] = 7;
|
||||
scratch[2] = 5;
|
||||
scratch[3] = 3;
|
||||
scratch[4] = 1;
|
||||
expected = pvd::freeze(scratch);
|
||||
}
|
||||
|
||||
testFieldEqual<pvd::PVShortArray>(root, "value", expected);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
extern "C"
|
||||
@@ -299,7 +338,7 @@ void p2pTestIoc_registerRecordDeviceDriver(struct dbBase *);
|
||||
|
||||
MAIN(testpdb)
|
||||
{
|
||||
testPlan(93);
|
||||
testPlan(95);
|
||||
try{
|
||||
QSRVRegistrar_counters();
|
||||
epics::RefSnapshot ref_before;
|
||||
@@ -318,6 +357,7 @@ MAIN(testpdb)
|
||||
#ifdef USE_MULTILOCK
|
||||
testdbReadDatabase("testpdb-groups.db", NULL, NULL);
|
||||
#endif
|
||||
testdbReadDatabase("testfilters.db", NULL, NULL);
|
||||
|
||||
IOC.init();
|
||||
|
||||
@@ -333,6 +373,7 @@ MAIN(testpdb)
|
||||
testSingleMonitor(client);
|
||||
testGroupMonitor(client);
|
||||
testGroupMonitorTriggers(client);
|
||||
testFilters(client);
|
||||
|
||||
testEqual(epics::atomic::get(PDBProvider::num_instances), 1u);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user