ChimeraTK-DeviceAccess-TangoBackend 00.01.02
Loading...
Searching...
No Matches
testValidityPropagation.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3#define BOOST_TEST_DYN_LINK
4#define BOOST_TEST_MODULE testValidity
5
7
8#define BOOST_NO_EXCEPTIONS
9#include <boost/test/unit_test.hpp>
10#undef BOOST_NO_EXCEPTIONS
11
12using namespace boost::unit_test_framework;
13
15
16#include <ChimeraTK/Device.h>
17
18BOOST_AUTO_TEST_CASE(testValidityFromServer) {
19 auto cdd = "(tango: " + TangoServerLauncher::self->getClientUrl() + ")";
20 auto device = ChimeraTK::Device(cdd);
21
22 BOOST_CHECK_NO_THROW(device.open());
23
24 {
25 auto accessor = device.getScalarRegisterAccessor<uint64_t>("InvalidValue");
26 BOOST_CHECK_NO_THROW(accessor.read());
27 BOOST_TEST(accessor.dataValidity() == ChimeraTK::DataValidity::faulty);
28 }
29
30 {
31 auto accessor = device.getScalarRegisterAccessor<uint64_t>("AlarmValue");
32 BOOST_CHECK_NO_THROW(accessor.read());
33 BOOST_TEST(accessor.dataValidity() == ChimeraTK::DataValidity::faulty);
34 }
35
36 {
37 auto accessor = device.getScalarRegisterAccessor<uint64_t>("WarningValue");
38 BOOST_CHECK_NO_THROW(accessor.read());
39 BOOST_TEST(accessor.dataValidity() == ChimeraTK::DataValidity::faulty);
40 }
41}
std::string getClientUrl() const
An URL that can be used by the Tango::DeviceProxy to connect to this server.
static TangoServerLauncher * self
BOOST_GLOBAL_FIXTURE(TangoServerLauncher)
BOOST_AUTO_TEST_CASE(testValidityFromServer)