more tests

This commit is contained in:
2020-03-31 18:19:32 +02:00
parent 83010de9f4
commit 262b4b0b16
6 changed files with 77 additions and 43 deletions

View File

@ -13,37 +13,7 @@ using sls::Detector;
using test::GET;
using test::PUT;
TEST_CASE("powerchip", "[.cmd][!mayfail]") {
// TODO! this test currently fails with the
// virtual detecto server
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) {
auto pc = det.getPowerChip();
{
std::ostringstream oss;
proxy.Call("powerchip", {"1"}, -1, PUT, oss);
REQUIRE(oss.str() == "powerchip 1\n");
}
{
std::ostringstream oss;
proxy.Call("powerchip", {"0"}, -1, PUT, oss);
REQUIRE(oss.str() == "powerchip 0\n");
}
{
std::ostringstream oss;
proxy.Call("powerchip", {}, -1, GET, oss);
REQUIRE(oss.str() == "powerchip 0\n");
}
for (int i = 0; i != det.size(); ++i) {
det.setPowerChip(pc[i], {i});
}
} else {
REQUIRE_THROWS(proxy.Call("powerchip", {}, -1, GET));
}
}
TEST_CASE("nframes", "[.cmd]") {
Detector det;