gotthard2 testing

This commit is contained in:
2020-01-29 14:34:23 +01:00
parent 5761642da0
commit ac3230c656
3 changed files with 95 additions and 384 deletions

View File

@@ -34,120 +34,7 @@ TEST_CASE("type", "[.cmd]"){
}
// TEST_CASE("vchip", "[.cmd]") {
// int prev_val = 0;
// if (test::type == slsDetectorDefs::GOTTHARD2) {
// REQUIRE_THROWS(multiSlsDetectorClient("vchip_comp_fe", GET)); //
// needs a chip index
// REQUIRE_THROWS(multiSlsDetectorClient("vchip_comp_fe -1 0x400",
// GET)); // max val is 0x3ff
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_comp_fe -1", GET,
// nullptr, oss)); std::string s = (oss.str()).erase (0,
// strlen("vchip_comp_fe -1 ")); prev_val = stoul(s, 0, 16);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_comp_fe -1 0x137",
// PUT)); std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_comp_fe -1", GET,
// nullptr, oss)); REQUIRE(oss.str() == "vchip_comp_fe -1 0x137\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_comp_fe -1 " +
// sls::ToStringHex(prev_val), PUT));
// REQUIRE_THROWS(multiSlsDetectorClient("vchip_opa_1st", GET)); //
// needs a chip index
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_opa_1st -1", GET,
// nullptr, oss)); std::string s = (oss.str()).erase (0,
// strlen("vchip_opa_1st -1 ")); prev_val = stoul(s, 0, 16);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_opa_1st -1 0x137",
// PUT)); std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_opa_1st -1", GET,
// nullptr, oss)); REQUIRE(oss.str() == "vchip_opa_1st -1 0x137\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_opa_1st -1 " +
// sls::ToStringHex(prev_val), PUT));
// REQUIRE_THROWS(multiSlsDetectorClient("vchip_opa_fd", GET)); // needs
// a chip index
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_opa_fd -1", GET,
// nullptr, oss)); std::string s = (oss.str()).erase (0,
// strlen("vchip_opa_fd -1 ")); prev_val = stoul(s, 0, 16);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_opa_fd -1 0x137",
// PUT)); std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_opa_fd -1", GET,
// nullptr, oss)); REQUIRE(oss.str() == "vchip_opa_fd -1 0x137\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_opa_fd -1 " +
// sls::ToStringHex(prev_val), PUT));
// REQUIRE_THROWS(multiSlsDetectorClient("vchip_comp_adc", GET)); //
// needs a chip index
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_comp_adc -1", GET,
// nullptr, oss)); std::string s = (oss.str()).erase (0,
// strlen("vchip_comp_adc -1 ")); prev_val = stoul(s, 0, 16);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_comp_adc -1 0x137",
// PUT)); std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_comp_adc -1", GET,
// nullptr, oss)); REQUIRE(oss.str() == "vchip_comp_adc -1
// 0x137\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_comp_adc -1 " +
// sls::ToStringHex(prev_val), PUT));
// REQUIRE_THROWS(multiSlsDetectorClient("vchip_ref_comp_fe", GET)); //
// needs a chip index
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_ref_comp_fe -1",
// GET, nullptr, oss)); std::string s = (oss.str()).erase (0,
// strlen("vchip_ref_comp_fe -1 ")); prev_val = stoul(s, 0, 16);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_ref_comp_fe -1
// 0x137", PUT)); std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_ref_comp_fe -1",
// GET, nullptr, oss)); REQUIRE(oss.str() == "vchip_ref_comp_fe -1
// 0x137\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_ref_comp_fe -1 " +
// sls::ToStringHex(prev_val), PUT));
// REQUIRE_THROWS(multiSlsDetectorClient("vchip_cs", GET)); // needs a
// chip index
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_cs -1", GET,
// nullptr, oss)); std::string s = (oss.str()).erase (0,
// strlen("vchip_cs -1 ")); prev_val = stoul(s, 0, 16);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_cs -1 0x137",
// PUT)); std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_cs -1", GET,
// nullptr, oss)); REQUIRE(oss.str() == "vchip_cs -1 0x137\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vchip_cs -1 " +
// sls::ToStringHex(prev_val), PUT));
// } else {
// REQUIRE_THROWS(multiSlsDetectorClient("vchip_comp_fe", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vchip_opa_1st", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vchip_opa_fd", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vchip_comp_adc", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vchip_ref_comp_fe", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vchip_cs", GET));
// }
// }
// TEST_CASE("dacs", "[.cmd]") {
// REQUIRE_NOTHROW(multiSlsDetectorClient("daclist", GET));
@@ -574,238 +461,6 @@ TEST_CASE("type", "[.cmd]"){
// REQUIRE_THROWS(multiSlsDetectorClient("vdd_prot", GET));
// }
// else if (test::type == slsDetectorDefs::GOTTHARD2) {
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_h_adc", GET,
// nullptr, oss)); std::string s = (oss.str()).erase (0,
// strlen("vref_h_adc ")); prev_val = std::stoi(s);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_h_adc 1000", PUT));
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_h_adc", GET,
// nullptr, oss)); REQUIRE(oss.str() == "vref_h_adc 1000\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_h_adc " +
// std::to_string(prev_val), PUT));
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_fe", GET,
// nullptr, oss)); std::string s = (oss.str()).erase (0,
// strlen("vb_comp_fe ")); prev_val = std::stoi(s);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_fe 1000", PUT));
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_fe", GET,
// nullptr, oss)); REQUIRE(oss.str() == "vb_comp_fe 1000\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_fe " +
// std::to_string(prev_val), PUT));
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_adc", GET,
// nullptr, oss)); std::string s = (oss.str()).erase (0,
// strlen("vb_comp_adc ")); prev_val = std::stoi(s);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_adc 1000", PUT));
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_adc", GET,
// nullptr, oss)); REQUIRE(oss.str() == "vb_comp_adc 1000\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_comp_adc " +
// std::to_string(prev_val), PUT));
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_cds", GET, nullptr,
// oss)); std::string s = (oss.str()).erase (0, strlen("vcom_cds
// ")); prev_val = std::stoi(s);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_cds 1000", PUT));
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_cds", GET, nullptr,
// oss)); REQUIRE(oss.str() == "vcom_cds 1000\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_cds " +
// std::to_string(prev_val), PUT));
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_rstore", GET,
// nullptr, oss)); std::string s = (oss.str()).erase (0,
// strlen("vref_rstore ")); prev_val = std::stoi(s);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_rstore 1000",
// PUT)); std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_rstore", GET,
// nullptr, oss)); REQUIRE(oss.str() == "vref_rstore 1000\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_rstore " +
// std::to_string(prev_val), PUT));
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_1st", GET,
// nullptr, oss)); std::string s = (oss.str()).erase (0,
// strlen("vb_opa_1st ")); prev_val = std::stoi(s);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_1st 1000", PUT));
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_1st", GET,
// nullptr, oss)); REQUIRE(oss.str() == "vb_opa_1st 1000\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_1st " +
// std::to_string(prev_val), PUT));
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_comp_fe", GET,
// nullptr, oss)); std::string s = (oss.str()).erase (0,
// strlen("vref_comp_fe ")); prev_val = std::stoi(s);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_comp_fe 1000",
// PUT)); std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_comp_fe", GET,
// nullptr, oss)); REQUIRE(oss.str() == "vref_comp_fe 1000\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_comp_fe " +
// std::to_string(prev_val), PUT));
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc1", GET, nullptr,
// oss)); std::string s = (oss.str()).erase (0, strlen("vcom_adc1
// ")); prev_val = std::stoi(s);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc1 1000", PUT));
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc1", GET, nullptr,
// oss)); REQUIRE(oss.str() == "vcom_adc1 1000\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc1 " +
// std::to_string(prev_val), PUT));
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_prech", GET,
// nullptr, oss)); std::string s = (oss.str()).erase (0,
// strlen("vref_prech ")); prev_val = std::stoi(s);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_prech 1000", PUT));
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_prech", GET,
// nullptr, oss)); REQUIRE(oss.str() == "vref_prech 1000\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_prech " +
// std::to_string(prev_val), PUT));
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_l_adc", GET,
// nullptr, oss)); std::string s = (oss.str()).erase (0,
// strlen("vref_l_adc ")); prev_val = std::stoi(s);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_l_adc 1000", PUT));
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_l_adc", GET,
// nullptr, oss)); REQUIRE(oss.str() == "vref_l_adc 1000\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_l_adc " +
// std::to_string(prev_val), PUT));
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_cds", GET, nullptr,
// oss)); std::string s = (oss.str()).erase (0, strlen("vref_cds
// ")); prev_val = std::stoi(s);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_cds 1000", PUT));
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_cds", GET, nullptr,
// oss)); REQUIRE(oss.str() == "vref_cds 1000\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vref_cds " +
// std::to_string(prev_val), PUT));
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_cs", GET, nullptr,
// oss)); std::string s = (oss.str()).erase (0, strlen("vb_cs "));
// prev_val = std::stoi(s);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_cs 1000", PUT));
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_cs", GET, nullptr,
// oss)); REQUIRE(oss.str() == "vb_cs 1000\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_cs " +
// std::to_string(prev_val), PUT));
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_fd", GET, nullptr,
// oss)); std::string s = (oss.str()).erase (0, strlen("vb_opa_fd
// ")); prev_val = std::stoi(s);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_fd 1000", PUT));
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_fd", GET, nullptr,
// oss)); REQUIRE(oss.str() == "vb_opa_fd 1000\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vb_opa_fd " +
// std::to_string(prev_val), PUT));
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc2", GET, nullptr,
// oss)); std::string s = (oss.str()).erase (0, strlen("vcom_adc2
// ")); prev_val = std::stoi(s);
// }
// {
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc2 1000", PUT));
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc2", GET, nullptr,
// oss)); REQUIRE(oss.str() == "vcom_adc2 1000\n");
// }
// REQUIRE_NOTHROW(multiSlsDetectorClient("vcom_adc2 " +
// std::to_string(prev_val), PUT));
// REQUIRE_THROWS(multiSlsDetectorClient("vthreshold", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vsvp", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vsvn", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vtr", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vrf", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vrs", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vtgstv", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vcmp_ll", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vcmp_lr", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vcal", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vcmp_rl", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vcmp_rr", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("rxb_rb", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("rxb_lb", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vcp", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vcn", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vis", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("iodelay", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vref_ds", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vcascn_pb", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vcascp_pb", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vout_cm", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vcasc_out", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vin_cm", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vref_comp", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("ib_test_c", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vb_ds", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vb_comp", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vb_pixbuf", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vin_com", GET));
// REQUIRE_THROWS(multiSlsDetectorClient("vdd_prot", GET));
// }
// }
TEST_CASE("user", "[.cmd]") {