mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 04:17:15 +02:00
merge from 7.0.0
This commit is contained in:
@ -702,11 +702,11 @@ TEST_CASE("confadc", "[.cmd]") {
|
||||
}
|
||||
}
|
||||
|
||||
REQUIRE_THROWS(proxy.Call("confadc", {"11", "2", "0x3ff"}, -1,
|
||||
REQUIRE_THROWS(proxy.Call("confadc", {"11", "2", "0x7f"}, -1,
|
||||
PUT)); // invalid chip index
|
||||
REQUIRE_THROWS(proxy.Call("confadc", {"-1", "10", "0x3ff"}, -1,
|
||||
REQUIRE_THROWS(proxy.Call("confadc", {"-1", "32", "0x7f"}, -1,
|
||||
PUT)); // invalid adc index
|
||||
REQUIRE_THROWS(proxy.Call("confadc", {"-1", "10", "0x1fff"}, -1,
|
||||
REQUIRE_THROWS(proxy.Call("confadc", {"-1", "10", "0x80"}, -1,
|
||||
PUT)); // invalid value
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -718,10 +718,11 @@ TEST_CASE("confadc", "[.cmd]") {
|
||||
proxy.Call("confadc", {"2", "3"}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "confadc 0x11\n");
|
||||
}
|
||||
|
||||
for (int i = 0; i != ndet; ++i) {
|
||||
for (int j = 0; j != nchip; ++j) {
|
||||
for (int k = 0; k != nadc; ++k) {
|
||||
det.setADCConfiguration(j, k, prev_val[i][j][k], {i});
|
||||
det.setADCConfiguration(-1, k, prev_val[i][j][k], {i});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -181,12 +181,14 @@ TEST_CASE("patloop", "[.cmd]") {
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("patloop", {sLoop, "0x20", "0x5c"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "patloop [0x0020, 0x005c]\n");
|
||||
REQUIRE(oss.str() ==
|
||||
"patloop " + sLoop + " [0x0020, 0x005c]\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("patloop", {sLoop}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "patloop [0x0020, 0x005c]\n");
|
||||
REQUIRE(oss.str() ==
|
||||
"patloop " + sLoop + " [0x0020, 0x005c]\n");
|
||||
}
|
||||
for (int iDet = 0; iDet != det.size(); ++iDet) {
|
||||
det.setPatternLoopAddresses(iLoop, prev_val[iDet][0],
|
||||
@ -227,12 +229,12 @@ TEST_CASE("patnloop", "[.cmd]") {
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("patnloop", {sLoop, "5"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "patnloop 5\n");
|
||||
REQUIRE(oss.str() == "patnloop " + sLoop + " 5\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("patnloop", {sLoop}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "patnloop 5\n");
|
||||
REQUIRE(oss.str() == "patnloop " + sLoop + " 5\n");
|
||||
}
|
||||
for (int iDet = 0; iDet != det.size(); ++iDet) {
|
||||
det.setPatternLoopCycles(iLoop, prev_val[iDet], {iDet});
|
||||
@ -272,12 +274,12 @@ TEST_CASE("patwait", "[.cmd]") {
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("patwait", {sLoop, "0x5c"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "patwait 0x005c\n");
|
||||
REQUIRE(oss.str() == "patwait " + sLoop + " 0x005c\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("patwait", {sLoop}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "patwait 0x005c\n");
|
||||
REQUIRE(oss.str() == "patwait " + sLoop + " 0x005c\n");
|
||||
}
|
||||
for (int iDet = 0; iDet != det.size(); ++iDet) {
|
||||
det.setPatternWaitAddr(iLoop, prev_val[iDet], {iDet});
|
||||
@ -317,12 +319,12 @@ TEST_CASE("patwaittime", "[.cmd]") {
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("patwaittime", {sLoop, "8589936640"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "patwaittime 8589936640\n");
|
||||
REQUIRE(oss.str() == "patwaittime " + sLoop + " 8589936640\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("patwaittime", {sLoop}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "patwaittime 8589936640\n");
|
||||
REQUIRE(oss.str() == "patwaittime " + sLoop + " 8589936640\n");
|
||||
}
|
||||
for (int iDet = 0; iDet != det.size(); ++iDet) {
|
||||
det.setPatternWaitTime(iLoop, prev_val[iDet], {iDet});
|
||||
|
@ -145,7 +145,8 @@ TEST_CASE("rx_missingpackets", "[.cmd][.rx]") {
|
||||
REQUIRE(oss.str() != "rx_missingpackets [0, 0]\n");
|
||||
}
|
||||
}
|
||||
{
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type != defs::CHIPTESTBOARD && det_type != defs::MOENCH) {
|
||||
// 0 missing packets (takes into account that acquisition is stopped)
|
||||
det.startReceiver();
|
||||
det.startDetector();
|
||||
|
@ -517,8 +517,19 @@ TEST_CASE("gappixels", "[.cmd]") {
|
||||
CmdProxy proxy(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
|
||||
det_type == defs::EIGER) {
|
||||
// test eiger(quad or full module only)
|
||||
bool gapPixelTest = false;
|
||||
if (det_type == defs:: || det_type == defs::MOENCH)
|
||||
gapPixelTest = true;
|
||||
else if (det_type == defs::EIGER) {
|
||||
bool quad = det.getQuad().squash(false);
|
||||
bool fullModule = (det.getModuleGeometry().y % 2 == 0);
|
||||
if (quad || fullModule) {
|
||||
gapPixelTest = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (gapPixelTest) {
|
||||
auto prev_val = det.getGapPixelsinCallback();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
@ -637,6 +648,8 @@ TEST_CASE("badchannels", "[.cmd]") {
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
|
||||
if (det_type == defs::GOTTHARD2 || det_type == defs::MYTHEN3) {
|
||||
auto prev = det.getBadChannels();
|
||||
|
||||
REQUIRE_THROWS(proxy.Call("badchannels", {}, -1, GET));
|
||||
|
||||
std::string fname_put =
|
||||
@ -649,6 +662,51 @@ TEST_CASE("badchannels", "[.cmd]") {
|
||||
std::vector<int> expected = {0, 12, 15, 40, 41, 42, 43, 44, 1279};
|
||||
REQUIRE(list == expected);
|
||||
|
||||
REQUIRE_NOTHROW(proxy.Call("badchannels", {"none"}, 0, PUT));
|
||||
REQUIRE_NOTHROW(proxy.Call("badchannels", {fname_get}, 0, GET));
|
||||
list = getChannelsFromFile(fname_get);
|
||||
REQUIRE(list.empty());
|
||||
|
||||
REQUIRE_NOTHROW(proxy.Call("badchannels", {fname_put}, 0, PUT));
|
||||
|
||||
REQUIRE_NOTHROW(proxy.Call("badchannels", {"0"}, 0, PUT));
|
||||
REQUIRE_NOTHROW(proxy.Call("badchannels", {fname_get}, 0, GET));
|
||||
list = getChannelsFromFile(fname_get);
|
||||
REQUIRE(list.empty());
|
||||
|
||||
REQUIRE_NOTHROW(proxy.Call("badchannels", {"12"}, 0, PUT));
|
||||
REQUIRE_NOTHROW(proxy.Call("badchannels", {fname_get}, 0, GET));
|
||||
list = getChannelsFromFile(fname_get);
|
||||
expected = {12};
|
||||
REQUIRE(list == expected);
|
||||
|
||||
REQUIRE_NOTHROW(proxy.Call(
|
||||
"badchannels", {"0", "12,", "15", "43", "40:45", "1279"}, 0, PUT));
|
||||
REQUIRE_NOTHROW(proxy.Call("badchannels", {fname_get}, 0, GET));
|
||||
list = getChannelsFromFile(fname_get);
|
||||
expected = {0, 12, 15, 40, 41, 42, 43, 44, 1279};
|
||||
REQUIRE(list == expected);
|
||||
|
||||
REQUIRE_NOTHROW(proxy.Call("badchannels", {"40:45"}, 0, PUT));
|
||||
REQUIRE_NOTHROW(proxy.Call("badchannels", {fname_get}, 0, GET));
|
||||
list = getChannelsFromFile(fname_get);
|
||||
expected = {40, 41, 42, 43, 44};
|
||||
REQUIRE(list == expected);
|
||||
|
||||
REQUIRE_NOTHROW(proxy.Call("badchannels", {"5,6,7"}, 0, PUT));
|
||||
REQUIRE_NOTHROW(proxy.Call("badchannels", {fname_get}, 0, GET));
|
||||
list = getChannelsFromFile(fname_get);
|
||||
expected = {5, 6, 7};
|
||||
REQUIRE(list == expected);
|
||||
|
||||
REQUIRE_NOTHROW(proxy.Call("badchannels", {"1:5,6,7"}, 0, PUT));
|
||||
REQUIRE_NOTHROW(proxy.Call("badchannels", {fname_get}, 0, GET));
|
||||
list = getChannelsFromFile(fname_get);
|
||||
expected = {1, 2, 3, 4, 6, 7};
|
||||
REQUIRE(list == expected);
|
||||
|
||||
det.setBadChannels(prev);
|
||||
|
||||
} else {
|
||||
REQUIRE_THROWS(proxy.Call("badchannels", {}, -1, GET));
|
||||
}
|
||||
@ -1216,7 +1274,7 @@ TEST_CASE("clkphase", "[.cmd]") {
|
||||
}
|
||||
std::string s_deg_val = "15";
|
||||
if (det_type == defs::MYTHEN3) {
|
||||
s_deg_val = "15";
|
||||
s_deg_val = "14";
|
||||
} else if (det_type == defs::GOTTHARD2) {
|
||||
s_deg_val = "23";
|
||||
}
|
||||
|
@ -101,7 +101,8 @@ TEST_CASE("Move SharedMemory", "[detector]") {
|
||||
shm2 = std::move(shm); // shm is now a moved from object!
|
||||
|
||||
CHECK(shm2()->x == 9);
|
||||
CHECK(shm() == nullptr);
|
||||
REQUIRE_THROWS(
|
||||
shm()); // trying to access should throw instead of returning a nullptr
|
||||
CHECK(shm2.getName() == std::string("/slsDetectorPackage_detector_") +
|
||||
std::to_string(shm_id));
|
||||
shm2.removeSharedMemory();
|
||||
|
Reference in New Issue
Block a user