eiger tests

This commit is contained in:
Erik Frojdh
2019-12-03 11:47:49 +01:00
parent 9bc60518d8
commit 619106e05f
3 changed files with 138 additions and 84 deletions

View File

@ -13,11 +13,22 @@ using test::GET;
using test::PUT;
/*
This file should contain receiver specific tests use python/scripts/list_tested_cmd.py
to check if all commands are covered
This file should contain receiver specific tests use
python/scripts/list_tested_cmd.py to check if all commands are covered
*/
// TEST_CASE("A test", "[.hey]"){
// std::cout << "start\n";
// SECTION("a section"){
// std::cout << "s1\n";
// }
// SECTION("another section"){
// std::cout << "s2\n";
// }
// std::cout << "end\n";
// }
TEST_CASE("rx_hostname", "[.cmd]") {
// TODO! find a proper way to test, now we read out the rx_hostname
// and then put it to see that we don't crash
@ -26,6 +37,12 @@ TEST_CASE("rx_hostname", "[.cmd]") {
std::string hostname =
det.getRxHostname().tsquash("hostname must be same for test");
auto det_type = det.getDetectorType().squash();
sls::Result<sls::ns> time;
if (det_type == defs::EIGER) {
time = det.getSubDeadTime();
}
{
// disable receiver
std::ostringstream oss1, oss2;
@ -45,6 +62,14 @@ TEST_CASE("rx_hostname", "[.cmd]") {
proxy.Call("rx_hostname", {}, -1, GET, oss2);
REQUIRE(oss2.str() == "rx_hostname " + hostname + "\n");
}
//Bug rx_hostname could change subdeadtime
if (det_type == defs::EIGER) {
auto time2 = det.getSubDeadTime();
for (int i = 0; i != det.size(); ++i) {
REQUIRE(time[i].count() == time2[i].count());
}
}
}
TEST_CASE("rx_framescaught", "[.cmd]") {