mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-22 17:47:59 +02:00
Test
This commit is contained in:
@ -106,7 +106,7 @@ std::string ToString(const slsDetectorDefs::scanParameters &r) {
|
||||
std::ostringstream oss;
|
||||
oss << '[';
|
||||
if (r.enable) {
|
||||
oss << "enabled " << std::endl
|
||||
oss << "enabled" << std::endl
|
||||
<< "dac " << ToString(r.dacInd) << std::endl
|
||||
<< "start " << r.startOffset << std::endl
|
||||
<< "stop " << r.stopOffset << std::endl
|
||||
|
@ -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]");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user