Merge pull request #111 from slsdetectorgroup/shm

Shm
This commit is contained in:
Dhanya Thattil
2020-07-07 13:35:52 +02:00
committed by GitHub
50 changed files with 1646 additions and 1170 deletions

View File

@ -273,4 +273,29 @@ TEST_CASE("int or uin64_t to a string in hex") {
REQUIRE(r == "[0xf4, 0xffff, 0x1900b6]");
r = ToStringHex(temp, 8);
REQUIRE(r == "[0x000000f4, 0x0000ffff, 0x001900b6]");
}
TEST_CASE("Streaming of slsDetectorDefs::scanParameters") {
using namespace sls;
{
defs::scanParameters t{};
std::ostringstream oss;
oss << t;
REQUIRE(oss.str() == "[disabled]");
}
{
defs::scanParameters t{defs::VTH2, 500, 1500, 500};
std::ostringstream oss;
oss << t;
REQUIRE(oss.str() == "[enabled\ndac vth2\nstart 500\nstop 1500\nstep "
"500\nsettleTime 1ms\n]");
}
{
defs::scanParameters t{defs::VTH2, 500, 1500, 500,
std::chrono::milliseconds{500}};
std::ostringstream oss;
oss << t;
REQUIRE(oss.str() == "[enabled\ndac vth2\nstart 500\nstop 1500\nstep "
"500\nsettleTime 0.5s\n]");
}
}

View File

@ -49,4 +49,26 @@ TEST_CASE("assign module", "[support]") {
CHECK(m3.reg == 500);
CHECK(m3.iodelay == 750);
CHECK(m3.nchan == 256 * 256 * 4);
}
TEST_CASE("default construct scanParameters"){
slsDetectorDefs::scanParameters p;
CHECK(p.dacSettleTime_ns == 0);
CHECK(p.dacInd == slsDetectorDefs::DAC_0);
CHECK(p.enable == 0);
CHECK(p.startOffset == 0);
CHECK(p.stopOffset == 0);
CHECK(p.stepSize == 0);
}
TEST_CASE("compare two scanParameters"){
slsDetectorDefs::scanParameters p0;
slsDetectorDefs::scanParameters p1;
CHECK(p0 == p1);
p0.enable = 1;
CHECK_FALSE(p0 == p1);
}