roi constructor added

This commit is contained in:
2020-07-30 14:04:50 +02:00
parent b47f751d66
commit d31839e80e
4 changed files with 6 additions and 8 deletions

View File

@@ -160,6 +160,8 @@ class slsDetectorDefs {
struct ROI {
int xmin{-1};
int xmax{-1};
ROI() = default;
ROI(int xmin, int xmax) : xmin(xmin), xmax(xmax){};
} __attribute__((packed));
#else
typedef struct {

View File

@@ -221,13 +221,13 @@ TEST_CASE("Detector type") {
}
TEST_CASE("Formatting slsDetectorDefs::ROI") {
slsDetectorDefs::ROI roi{5, 159};
slsDetectorDefs::ROI roi(5, 159);
REQUIRE(ToString(roi) == "[5, 159]");
}
TEST_CASE("Streaming of slsDetectorDefs::ROI") {
using namespace sls;
slsDetectorDefs::ROI roi{-10, 1};
slsDetectorDefs::ROI roi(-10, 1);
std::ostringstream oss;
oss << roi;
REQUIRE(oss.str() == "[-10, 1]");