diff --git a/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp b/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp index e09a59e45..e1ed94f71 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp @@ -12,6 +12,26 @@ using sls::Detector; using test::GET; using test::PUT; +// TEST_CASE("tengiga", "[.cmd][.eiger][.ctb]") { +// if (test::type == slsDetectorDefs::EIGER || test::type == +// slsDetectorDefs::CHIPTESTBOARD) { +// { +// REQUIRE_NOTHROW(multiSlsDetectorClient("tengiga 1", PUT)); +// std::ostringstream oss; +// REQUIRE_NOTHROW(multiSlsDetectorClient("0:tengiga", GET, nullptr, +// oss)); REQUIRE(oss.str() == "tengiga 1\n"); +// } +// { +// REQUIRE_NOTHROW(multiSlsDetectorClient("tengiga 0", PUT)); +// std::ostringstream oss; +// REQUIRE_NOTHROW(multiSlsDetectorClient("0:tengiga", GET, nullptr, +// oss)); REQUIRE(oss.str() == "tengiga 0\n"); +// } +// } else { +// REQUIRE_THROWS(multiSlsDetectorClient("tengiga", GET)); +// } +// } + TEST_CASE("quad", "[.cmd]") { // TODO! set and get once available in virtual detector Detector det; diff --git a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp index 8e2c7bffa..fcec4f5e5 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp @@ -156,15 +156,6 @@ TEST_CASE("resetfpga", "[.cmd]") { } } -// TEST_CASE("resetfpga", "[.cmd][.ctb][.jungfrau]") { -// if (test::type == slsDetectorDefs::JUNGFRAU || test::type == -// slsDetectorDefs::CHIPTESTBOARD) { -// ;//REQUIRE_NOTHROW(multiSlsDetectorClient("resetfpga", PUT)); -// } else { -// REQUIRE_THROWS(multiSlsDetectorClient("resetfpga", GET)); -// } -// } - // void test_dac(defs::dacIndex index, const std::string &dacname, int dacvalue) diff --git a/slsDetectorSoftware/tests/test-CmdProxy.cpp b/slsDetectorSoftware/tests/test-CmdProxy.cpp index f0cf1dcf3..d40f8cb73 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy.cpp @@ -1386,10 +1386,6 @@ TEST_CASE("user", "[.cmd]") { REQUIRE_THROWS(proxy.Call("user", {}, -1, PUT)); } - - - - // TEST_CASE("execcommand", "[.cmd]") { // REQUIRE_NOTHROW(multiSlsDetectorClient("execcommand ls", PUT)); // } @@ -1428,28 +1424,6 @@ TEST_CASE("stopport", "[.cmd]") { REQUIRE(port == 1953); } - - -// TEST_CASE("bustest", "[.cmd]") { -// if (test::type == slsDetectorDefs::JUNGFRAU || test::type == -// slsDetectorDefs::CHIPTESTBOARD || test::type == -// slsDetectorDefs::GOTTHARD) { -// REQUIRE_NOTHROW(multiSlsDetectorClient("bustest", PUT)); -// } else { -// REQUIRE_THROWS(multiSlsDetectorClient("bustest", PUT)); -// } -// } - -// TEST_CASE("firmwaretest", "[.cmd]") { -// if (test::type == slsDetectorDefs::JUNGFRAU || test::type == -// slsDetectorDefs::CHIPTESTBOARD || test::type == -// slsDetectorDefs::GOTTHARD) { -// REQUIRE_NOTHROW(multiSlsDetectorClient("firmwaretest", PUT)); -// } else { -// REQUIRE_THROWS(multiSlsDetectorClient("firmwaretest", PUT)); -// } -// } - // TEST_CASE("reg", "[.cmd]") { // if (test::type == slsDetectorDefs::JUNGFRAU) { // { @@ -1606,15 +1580,6 @@ TEST_CASE("stopport", "[.cmd]") { // } // } -// TEST_CASE("resetfpga", "[.cmd][.ctb][.jungfrau]") { -// if (test::type == slsDetectorDefs::JUNGFRAU || test::type == -// slsDetectorDefs::CHIPTESTBOARD) { -// ;//REQUIRE_NOTHROW(multiSlsDetectorClient("resetfpga", PUT)); -// } else { -// REQUIRE_THROWS(multiSlsDetectorClient("resetfpga", GET)); -// } -// } - // TEST_CASE("programfpga", "[.cmd][.ctb][.jungfrau]") { // if (test::type == slsDetectorDefs::JUNGFRAU || test::type == // slsDetectorDefs::CHIPTESTBOARD) { @@ -2741,8 +2706,6 @@ TEST_CASE("stopport", "[.cmd]") { // } // } - - // TEST_CASE("temp_", "[.cmd][.jungfrau]") { // if (test::type == slsDetectorDefs::JUNGFRAU) { // std::string s; @@ -3228,29 +3191,41 @@ TEST_CASE("stopport", "[.cmd]") { // } // } -// TEST_CASE("fpath", "[.cmd]") { -// std::string s; -// { -// std::ostringstream oss; -// REQUIRE_NOTHROW(multiSlsDetectorClient("0:fpath", GET, nullptr, -// oss)); s = oss.str(); -// } -// { -// REQUIRE_NOTHROW(multiSlsDetectorClient(s, PUT)); -// std::ostringstream oss; -// REQUIRE_NOTHROW(multiSlsDetectorClient("fpath", GET, nullptr, oss)); -// REQUIRE(oss.str() == s); -// } -// } +TEST_CASE("fpath", "[.cmd]") { + Detector det; + CmdProxy proxy(&det); + auto fpath = det.getFilePath().squash(); + + std::ostringstream oss1, oss2, oss3; + proxy.Call("fpath", {}, -1, GET, oss1); + REQUIRE(oss1.str() == "fpath " + fpath + "\n"); + proxy.Call("fpath", {fpath}, -1, PUT, oss2); + REQUIRE(oss2.str() == "fpath " + fpath + "\n"); + proxy.Call("fpath", {}, -1, GET, oss3); + REQUIRE(oss3.str() == "fpath " + fpath + "\n"); +} + +TEST_CASE("fformat", "[.cmd]") { + Detector det; + CmdProxy proxy(&det); + auto fformat = det.getFileFormat(); + { + std::ostringstream oss; + proxy.Call("fformat", {"binary"}, -1, PUT, oss); + REQUIRE(oss.str() == "fformat binary\n"); + } + { + std::ostringstream oss; + proxy.Call("fformat", {}, -1, GET, oss); + REQUIRE(oss.str() == "fformat binary\n"); + } + + // Reset file format after test + for (int i = 0; i != det.size(); ++i) { + det.setFileFormat(fformat[i], {i}); + } +} -// TEST_CASE("fformat", "[.cmd]") { -// { -// std::ostringstream oss; -// REQUIRE_NOTHROW(multiSlsDetectorClient("fformat", GET, nullptr, -// oss)); -// REQUIRE(oss.str() == "fformat binary\n"); -// } -// } // TEST_CASE("txndelay", "[.cmd][.eiger][.jungfrau]") { // if (test::type == slsDetectorDefs::EIGER) { @@ -3333,25 +3308,7 @@ TEST_CASE("stopport", "[.cmd]") { // } // } -// TEST_CASE("tengiga", "[.cmd][.eiger][.ctb]") { -// if (test::type == slsDetectorDefs::EIGER || test::type == -// slsDetectorDefs::CHIPTESTBOARD) { -// { -// REQUIRE_NOTHROW(multiSlsDetectorClient("tengiga 1", PUT)); -// std::ostringstream oss; -// REQUIRE_NOTHROW(multiSlsDetectorClient("0:tengiga", GET, nullptr, -// oss)); REQUIRE(oss.str() == "tengiga 1\n"); -// } -// { -// REQUIRE_NOTHROW(multiSlsDetectorClient("tengiga 0", PUT)); -// std::ostringstream oss; -// REQUIRE_NOTHROW(multiSlsDetectorClient("0:tengiga", GET, nullptr, -// oss)); REQUIRE(oss.str() == "tengiga 0\n"); -// } -// } else { -// REQUIRE_THROWS(multiSlsDetectorClient("tengiga", GET)); -// } -// } + // TEST_CASE("network", "[.cmd]") { // /* {TODO custom srcip in globals