mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 05:08:06 +01:00
somewhere between fork and pipes, crashes at sendingudppacket at print
This commit is contained in:
@@ -49,7 +49,6 @@ void test_onchip_dac(defs::dacIndex index, const std::string &dacname, int dacva
|
||||
auto dacValueStr = sls::ToStringHex(dacvalue);
|
||||
auto chipIndexStr = std::to_string(chipIndex);
|
||||
std::ostringstream oss_set, oss_get;
|
||||
std::cout << "chipindexstr:"<<chipIndexStr<<" dacvaluestr:"<<dacValueStr<<std::endl;
|
||||
proxy.Call(dacname, {chipIndexStr, dacValueStr}, -1, PUT, oss_set);
|
||||
REQUIRE(oss_set.str() == dacname + " " + chipIndexStr + " " + dacValueStr + "\n");
|
||||
proxy.Call(dacname, {chipIndexStr}, -1, GET, oss_get);
|
||||
|
||||
@@ -852,9 +852,88 @@ TEST_CASE("temp_fpga", "[.cmd][.new]") {
|
||||
}
|
||||
}
|
||||
|
||||
/* acquisition */
|
||||
|
||||
TEST_CASE("clearbusy", "[.cmd][.new]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
REQUIRE_NOTHROW(proxy.Call("clearbusy", {}, -1, PUT));
|
||||
REQUIRE_THROWS(proxy.Call("clearbusy", {"0"}, -1, PUT));
|
||||
REQUIRE_THROWS(proxy.Call("clearbusy", {}, -1, GET));
|
||||
}
|
||||
|
||||
TEST_CASE("start", "[.cmd][.rx][.new]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
// PUT only command
|
||||
REQUIRE_THROWS(proxy.Call("start", {}, -1, GET));
|
||||
auto prev_val = det.getExptime();
|
||||
det.setExptime(std::chrono::seconds(10));
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("start", {}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "start successful\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("status", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "status running\n");
|
||||
}
|
||||
det.stopDetector();
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setExptime(prev_val[i], {i});
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("stop", "[.cmd][.rx][.new]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
// PUT only command
|
||||
REQUIRE_THROWS(proxy.Call("stop", {}, -1, GET));
|
||||
auto prev_val = det.getExptime();
|
||||
det.setExptime(std::chrono::seconds(10));
|
||||
det.startDetector();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("status", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "status running\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("stop", {}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "stop successful\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("status", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "status idle\n");
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setExptime(prev_val[i], {i});
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("status", "[.cmd][.rx][.new]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
auto prev_val = det.getExptime();
|
||||
det.setExptime(std::chrono::seconds(10));
|
||||
det.startReceiver();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("status", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "status running\n");
|
||||
}
|
||||
det.stopReceiver();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("status", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "status idle\n");
|
||||
}
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setExptime(prev_val[i], {i});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user