Jungfrausync (#519)

* jungfrau sync
This commit is contained in:
Dhanya Thattil
2022-08-23 10:29:16 +02:00
committed by GitHub
parent da16c1101c
commit 4638bf7cf8
16 changed files with 158 additions and 4 deletions

View File

@ -539,4 +539,33 @@ TEST_CASE("filtercells", "[.cmd]") {
}
}
TEST_CASE("sync", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) {
auto prev_val = det.getSynchronization().tsquash(
"inconsistent synchronization to test");
{
std::ostringstream oss;
proxy.Call("sync", {"0"}, -1, PUT, oss);
REQUIRE(oss.str() == "sync 0\n");
}
{
std::ostringstream oss;
proxy.Call("sync", {"1"}, -1, PUT, oss);
REQUIRE(oss.str() == "sync 1\n");
}
{
std::ostringstream oss;
proxy.Call("sync", {}, -1, GET, oss);
REQUIRE(oss.str() == "sync 1\n");
}
det.getSynchronization(prev_val);
} else {
REQUIRE_THROWS(proxy.Call("sync", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("sync", {"0"}, -1, PUT));
}
}
} // namespace sls