mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
@ -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]");
|
||||
}
|
||||
}
|
@ -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);
|
||||
|
||||
}
|
Reference in New Issue
Block a user