formatting

This commit is contained in:
2023-10-25 09:36:51 +02:00
parent 4023ed0775
commit 35ed926047
9 changed files with 71 additions and 74 deletions

View File

@ -886,7 +886,8 @@ void Detector::stopDetector(Positions pos) {
// idle before stopping will return running (after async start script) when
// getting status after, which will then be stopped again.
while (!status.contains_only(defs::runStatus::IDLE, defs::runStatus::STOPPED)){
while (!status.contains_only(defs::runStatus::IDLE,
defs::runStatus::STOPPED)) {
if (status.any(defs::runStatus::ERROR)) {
throw RuntimeError("Could not stop detector. At least one module "
"returned error status.");

View File

@ -84,9 +84,7 @@ class DetectorImpl : public virtual slsDetectorDefs {
*/
virtual ~DetectorImpl();
template <class CT> struct NonDeduced {
using type = CT;
};
template <class CT> struct NonDeduced { using type = CT; };
template <typename RT, typename... CT>
Result<RT> Parallel(RT (Module::*somefunc)(CT...),
std::vector<int> positions,

View File

@ -692,7 +692,8 @@ TEST_CASE("confadc", "[.cmd]") {
const int ndet = det.size();
const int nchip = 10;
const int nadc = 32;
std::vector<std::vector<std::vector<int>>> prev_val(ndet, std::vector<std::vector<int>>(nchip, std::vector<int>(nadc)));
std::vector<std::vector<std::vector<int>>> prev_val(
ndet, std::vector<std::vector<int>>(nchip, std::vector<int>(nadc)));
for (int i = 0; i != ndet; ++i) {
for (int j = 0; j != nchip; ++j) {
for (int k = 0; k != nadc; ++k) {

View File

@ -196,24 +196,24 @@ TEST_CASE("String conversions") {
"[{one: 1}, {one: 1, three: 3, two: 2}, {one: 1}]");
}
TEST_CASE("Any element is equal"){
Result<int> r{1,2,3,4,5};
TEST_CASE("Any element is equal") {
Result<int> r{1, 2, 3, 4, 5};
REQUIRE(r.any(3));
REQUIRE_FALSE(r.any(9));
}
TEST_CASE("Result contains only the specified elements"){
Result<int> r{1,1,1};
TEST_CASE("Result contains only the specified elements") {
Result<int> r{1, 1, 1};
REQUIRE(r.contains_only(1));
REQUIRE(r.contains_only(1,1));
REQUIRE(r.contains_only(1, 1));
}
TEST_CASE("Only with multiple values"){
Result<int> r{1,1,2,1,2,1,1};
TEST_CASE("Only with multiple values") {
Result<int> r{1, 1, 2, 1, 2, 1, 1};
REQUIRE_FALSE(r.contains_only(1));
REQUIRE_FALSE(r.contains_only(2));
REQUIRE(r.contains_only(1,2));
REQUIRE(r.contains_only(2,1));
REQUIRE(r.contains_only(1, 2));
REQUIRE(r.contains_only(2, 1));
}
} // namespace sls