Files
slsDetectorPackage/slsDetectorSoftware/tests/master_file/Readers.h
T
2e4cd258a8
Build on RHEL9 docker image / build (push) Successful in 4m1s
Build on RHEL8 docker image / build (push) Successful in 5m1s
Build and Deploy on local RHEL9 / build (push) Successful in 2m1s
Build and Deploy on local RHEL8 / build (push) Successful in 5m7s
Run Simulator Tests on local RHEL9 / build (push) Successful in 18m37s
Run Simulator Tests on local RHEL8 / build (push) Successful in 22m10s
Dev/refactor caller tests master attributes (#1462)
* refactoring

* wip

* refactored, yet to take out checkers

* checker added

* wip acquire ctb state

* wip acquire ctb state

* wip, acq test

* acquire moved out

* fix

* wip, To fix masterattribtues

* wip, masterfilecheks

* wip, at ctbexpectedstate

* wip, fixing acquire

* wip, acquire done

* wip

* compiles

* refactoring

* minor

* minor

* reduced unnecessary includes

* fix in tests

* removed ctb state check

* ctb fix with ctb state

* fixed ctb guard tests

* minor debug

* work for xilinx ctb

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
2026-06-10 17:30:30 +02:00

31 lines
960 B
C++

// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#pragma once
#include "Context.h"
#include "sls/sls_detector_defs.h"
namespace sls::test::master_file {
template <typename Context, typename T> struct Reader;
template <typename Context, typename T> struct AttributeReader;
enum class AccessType { Dataset, Attribute };
template <typename Context, typename T>
T read(const Context &ctx, const std::string &name,
AccessType access = AccessType::Dataset) {
return Reader<Context, T>::read(ctx, name, access);
}
inline void check_size(size_t actual, size_t expected, const std::string &name,
const std::string &doc) {
if (actual != expected) {
throw sls::RuntimeError(
doc + " array " + name + " has " + std::to_string(actual) +
" elements instead of " + std::to_string(expected));
}
}
} // namespace sls::test::master_file