clang-format

This commit is contained in:
Erik Frojdh
2020-05-04 16:30:00 +02:00
parent 32662baef8
commit 959fd562d3
38 changed files with 3615 additions and 3194 deletions

View File

@@ -22,9 +22,12 @@ TEST_CASE("bursts", "[.cmd][.new]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2) {
auto prev_burst = det.getNumberOfBursts().tsquash("#bursts should be same to test");
auto prev_trigger = det.getNumberOfFrames().tsquash("#frames should be same to test");
auto prev_frames = det.getNumberOfTriggers().tsquash("#triggers should be same to test");
auto prev_burst =
det.getNumberOfBursts().tsquash("#bursts should be same to test");
auto prev_trigger =
det.getNumberOfFrames().tsquash("#frames should be same to test");
auto prev_frames = det.getNumberOfTriggers().tsquash(
"#triggers should be same to test");
auto prev_timingMode = det.getTimingMode();
auto prev_burstMode = det.getBurstMode();
// changing continuous mode frames and bursts
@@ -47,7 +50,7 @@ TEST_CASE("bursts", "[.cmd][.new]") {
std::ostringstream oss;
proxy.Call("bursts", {}, -1, GET, oss);
REQUIRE(oss.str() == "bursts 3\n");
}
}
det.setTimingMode(defs::AUTO_TIMING);
{
std::ostringstream oss;
@@ -100,15 +103,25 @@ TEST_CASE("Setting and reading back GOTTHARD2 dacs", "[.cmd][.dacs][.new]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2) {
SECTION("vref_h_adc") { test_dac(defs::VREF_H_ADC, "vref_h_adc", 2099); }
SECTION("vref_h_adc") {
test_dac(defs::VREF_H_ADC, "vref_h_adc", 2099);
}
SECTION("vb_comp_fe") { test_dac(defs::VB_COMP_FE, "vb_comp_fe", 0); }
SECTION("vb_comp_adc") { test_dac(defs::VB_COMP_ADC, "vb_comp_adc", 0); }
SECTION("vb_comp_adc") {
test_dac(defs::VB_COMP_ADC, "vb_comp_adc", 0);
}
SECTION("vcom_cds") { test_dac(defs::VCOM_CDS, "vcom_cds", 1400); }
SECTION("vref_rstore") { test_dac(defs::VREF_RSTORE, "vref_rstore", 640); }
SECTION("vref_rstore") {
test_dac(defs::VREF_RSTORE, "vref_rstore", 640);
}
SECTION("vb_opa_1st") { test_dac(defs::VB_OPA_1ST, "vb_opa_1st", 0); }
SECTION("vref_comp_fe") { test_dac(defs::VREF_COMP_FE, "vref_comp_fe", 0); }
SECTION("vref_comp_fe") {
test_dac(defs::VREF_COMP_FE, "vref_comp_fe", 0);
}
SECTION("vcom_adc1") { test_dac(defs::VCOM_ADC1, "vcom_adc1", 1400); }
SECTION("vref_prech") { test_dac(defs::VREF_PRECH, "vref_prech", 1720); }
SECTION("vref_prech") {
test_dac(defs::VREF_PRECH, "vref_prech", 1720);
}
SECTION("vref_l_adc") { test_dac(defs::VREF_L_ADC, "vref_l_adc", 700); }
SECTION("vref_cds") { test_dac(defs::VREF_CDS, "vref_cds", 1200); }
SECTION("vb_cs") { test_dac(defs::VB_CS, "vb_cs", 2799); }
@@ -178,7 +191,9 @@ TEST_CASE("vchip_comp_fe", "[.cmd][.onchipdacs][.new]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2) {
SECTION("vchip_comp_fe") { test_onchip_dac(defs::VB_COMP_FE, "vchip_comp_fe", 0x137); }
SECTION("vchip_comp_fe") {
test_onchip_dac(defs::VB_COMP_FE, "vchip_comp_fe", 0x137);
}
} else {
REQUIRE_THROWS(proxy.Call("vchip_comp_fe", {}, -1, GET));
}
@@ -189,7 +204,9 @@ TEST_CASE("vchip_opa_1st", "[.cmd][.onchipdacs][.new]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2) {
SECTION("vchip_opa_1st") { test_onchip_dac(defs::VB_OPA_1ST, "vchip_opa_1st", 0x000); }
SECTION("vchip_opa_1st") {
test_onchip_dac(defs::VB_OPA_1ST, "vchip_opa_1st", 0x000);
}
} else {
REQUIRE_THROWS(proxy.Call("vchip_opa_1st", {}, -1, GET));
}
@@ -200,7 +217,9 @@ TEST_CASE("vchip_opa_fd", "[.cmd][.onchipdacs][.new]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2) {
SECTION("vchip_opa_fd") { test_onchip_dac(defs::VB_OPA_FD, "vchip_opa_fd", 0x134); }
SECTION("vchip_opa_fd") {
test_onchip_dac(defs::VB_OPA_FD, "vchip_opa_fd", 0x134);
}
} else {
REQUIRE_THROWS(proxy.Call("vchip_opa_fd", {}, -1, GET));
}
@@ -211,7 +230,9 @@ TEST_CASE("vchip_comp_adc", "[.cmd][.onchipdacs][.new]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2) {
SECTION("vchip_comp_adc") { test_onchip_dac(defs::VB_COMP_ADC, "vchip_comp_adc", 0x3FF); }
SECTION("vchip_comp_adc") {
test_onchip_dac(defs::VB_COMP_ADC, "vchip_comp_adc", 0x3FF);
}
} else {
REQUIRE_THROWS(proxy.Call("vchip_comp_adc", {}, -1, GET));
}
@@ -222,7 +243,9 @@ TEST_CASE("vchip_ref_comp_fe", "[.cmd][.onchipdacs][.new]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2) {
SECTION("vchip_ref_comp_fe") { test_onchip_dac(defs::VREF_COMP_FE, "vchip_ref_comp_fe", 0x100); }
SECTION("vchip_ref_comp_fe") {
test_onchip_dac(defs::VREF_COMP_FE, "vchip_ref_comp_fe", 0x100);
}
} else {
REQUIRE_THROWS(proxy.Call("vchip_ref_comp_fe", {}, -1, GET));
}
@@ -239,22 +262,6 @@ TEST_CASE("vchip_cs", "[.cmd][.onchipdacs][.new]") {
}
}
TEST_CASE("burstmode", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
@@ -286,7 +293,6 @@ TEST_CASE("burstmode", "[.cmd]") {
}
}
TEST_CASE("vetoref", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
@@ -294,14 +300,14 @@ TEST_CASE("vetoref", "[.cmd]") {
if (det_type == defs::GOTTHARD2) {
REQUIRE_THROWS(proxy.Call("vetoref", {}, -1, GET));
REQUIRE_THROWS(proxy.Call("vetoref", {"3", "0x3ff"}, -1, PUT)); // invalid chip index
REQUIRE_THROWS(proxy.Call("vetoref", {"3", "0x3ff"}, -1,
PUT)); // invalid chip index
REQUIRE_NOTHROW(proxy.Call("vetoref", {"1", "0x010"}, -1, PUT));
} else {
REQUIRE_THROWS(proxy.Call("vetoref", {"3", "0x0"}, -1, PUT));
}
}
TEST_CASE("vetophoton", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
@@ -310,16 +316,17 @@ TEST_CASE("vetophoton", "[.cmd]") {
if (det_type == defs::GOTTHARD2) {
REQUIRE_THROWS(proxy.Call("vetophoton", {}, -1, GET));
REQUIRE_NOTHROW(proxy.Call("vetophoton", {"-1"}, -1, GET));
REQUIRE_THROWS(proxy.Call("vetophoton", {"12", "1", "39950"}, -1, PUT));// invalid chip index
REQUIRE_THROWS(proxy.Call("vetophoton", {"-1", "0"}, -1, PUT)); // invalid photon number
REQUIRE_THROWS(proxy.Call("vetophoton", {"-1", "1", "39950"}, -1, PUT)); // invald file
REQUIRE_THROWS(proxy.Call("vetophoton", {"12", "1", "39950"}, -1,
PUT)); // invalid chip index
REQUIRE_THROWS(proxy.Call("vetophoton", {"-1", "0"}, -1,
PUT)); // invalid photon number
REQUIRE_THROWS(proxy.Call("vetophoton", {"-1", "1", "39950"}, -1,
PUT)); // invald file
} else {
REQUIRE_THROWS(proxy.Call("vetophoton", {"-1"}, -1, GET));
}
}
TEST_CASE("inj_ch", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
@@ -327,8 +334,10 @@ TEST_CASE("inj_ch", "[.cmd]") {
if (det_type == defs::GOTTHARD2) {
auto inj = det.getInjectChannel();
REQUIRE_THROWS(proxy.Call("inj_ch", {"-1", "1"}, -1, PUT));// invalid offset
REQUIRE_THROWS(proxy.Call("inj_ch", {"0", "0"}, -1, PUT));// invalid increment
REQUIRE_THROWS(
proxy.Call("inj_ch", {"-1", "1"}, -1, PUT)); // invalid offset
REQUIRE_THROWS(
proxy.Call("inj_ch", {"0", "0"}, -1, PUT)); // invalid increment
{
std::ostringstream oss;
proxy.Call("inj_ch", {"0", "1"}, -1, PUT, oss);
@@ -347,9 +356,6 @@ TEST_CASE("inj_ch", "[.cmd]") {
}
}
TEST_CASE("burstperiod", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
@@ -372,7 +378,6 @@ TEST_CASE("burstperiod", "[.cmd]") {
}
}
TEST_CASE("currentsource", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
@@ -410,12 +415,12 @@ TEST_CASE("timingsource", "[.cmd]") {
if (det_type == defs::GOTTHARD2) {
auto prev_val = det.getTimingSource();
/* { until its activated in fpga
std::ostringstream oss;
proxy.Call("timingsource", {"external"}, -1, PUT, oss);
REQUIRE(oss.str() == "timingsource external\n");
}*/
{
/* { until its activated in fpga
std::ostringstream oss;
proxy.Call("timingsource", {"external"}, -1, PUT, oss);
REQUIRE(oss.str() == "timingsource external\n");
}*/
{
std::ostringstream oss;
proxy.Call("timingsource", {"internal"}, -1, PUT, oss);
REQUIRE(oss.str() == "timingsource internal\n");