This commit is contained in:
Erik Frojdh
2020-05-11 18:28:06 +02:00
parent 1ed1b5da86
commit eff664e790
4 changed files with 125 additions and 367 deletions

View File

@ -6,6 +6,7 @@
#include <array>
#include <map>
#include <vector>
#include <sstream>
// using namespace sls;
using sls::defs;
@ -216,4 +217,35 @@ TEST_CASE("Detector type") {
auto dt = defs::detectorType::EIGER;
REQUIRE(ToString(dt) == "Eiger");
REQUIRE(StringTo<defs::detectorType>("Eiger") == dt);
}
TEST_CASE("Formatting slsDetectorDefs::ROI"){
slsDetectorDefs::ROI roi{5,159};
REQUIRE(ToString(roi) == "[5, 159]");
}
TEST_CASE("Streaming of slsDetectorDefs::ROI"){
using namespace sls;
slsDetectorDefs::ROI roi{-10,1};
std::ostringstream oss;
oss << roi;
REQUIRE(oss.str() == "[-10, 1]");
}
TEST_CASE("sls::FixedCapacityContainer"){
sls::FixedCapacityContainer<int, 5> vec;
vec.push_back(3);
vec.push_back(8);
REQUIRE(ToString(vec) == "[3, 8]");
}
TEST_CASE("sls::FixedCapacityContainer stream"){
sls::FixedCapacityContainer<int, 5> vec;
vec.push_back(33);
vec.push_back(85667);
vec.push_back(2);
std::ostringstream oss;
oss << vec;
REQUIRE(oss.str() == "[33, 85667, 2]");
}