ChimeraTK-DeviceAccess  03.18.00
testLMapBackendUnified.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 
4 #define BOOST_TEST_DYN_LINK
5 #define BOOST_TEST_MODULE LMapBackendUnifiedTest
6 #include <boost/test/unit_test.hpp>
7 using namespace boost::unit_test_framework;
8 
9 #include "Device.h"
10 #include "DummyRegisterAccessor.h"
11 #include "ExceptionDummyBackend.h"
13 #include "TransferGroup.h"
14 #include "UnifiedBackendTest.h"
15 
16 using namespace ChimeraTK;
17 
18 BOOST_AUTO_TEST_SUITE(LMapBackendUnifiedTestSuite)
19 
20 /**********************************************************************************************************************/
21 
22 static boost::shared_ptr<ExceptionDummy> exceptionDummyLikeMtcadummy, exceptionDummyMuxed, exceptionDummyPush;
23 static boost::shared_ptr<LogicalNameMappingBackend> lmapBackend;
24 
25 /**********************************************************************************************************************/
26 /* First a number of base descriptors is defined to simplify the descriptors for the individual registers. */
27 
29 template<typename Derived>
31  Derived* derived{static_cast<Derived*>(this)};
32 
33  static constexpr auto capabilities = TestCapabilities<>()
35  .disableAsyncReadInconsistency()
36  .disableSwitchReadOnly()
37  .disableSwitchWriteOnly()
38  .disableTestWriteNeverLosesData()
39  .enableTestRawTransfer();
40  // Note: I set enableTestRawTransfer to enabled here and disable it where necessary, so new registers will be tested
41  // by default.
42 
43  bool isWriteable() { return true; }
44  bool isReadable() { return true; }
45  bool isPush() { return false; }
48  if(derived->isPush()) flags.add(ChimeraTK::AccessMode::wait_for_new_data);
49  return flags;
50  }
51  size_t writeQueueLength() { return std::numeric_limits<size_t>::max(); }
52  size_t nRuntimeErrorCases() { return 1; }
53 
54  void setForceRuntimeError(bool enable, size_t) {
55  auto& dummy = dynamic_cast<ExceptionDummy&>(derived->acc.getBackend());
56  dummy.throwExceptionRead = enable;
57  dummy.throwExceptionWrite = enable;
58  dummy.throwExceptionOpen = enable;
59  if(derived->isPush() && enable) {
60  dummy.triggerInterrupt(6);
61  }
62  }
63 };
64 
66 template<typename Derived>
69  static constexpr auto capabilities = RegisterDescriptorBase<Derived>::capabilities.disableTestRawTransfer();
70 
71  size_t nChannels() { return 1; }
72  bool isWriteable() { return false; }
73 
74  template<typename UserType>
75  std::vector<std::vector<UserType>> generateValue() {
76  std::vector<UserType> v;
77  for(size_t k = 0; k < derived->nElementsPerChannel(); ++k) {
78  v.push_back(derived->acc[derived->channel][k] + derived->increment * (k + 1));
79  }
80  return {v};
81  }
82 
83  template<typename UserType>
84  std::vector<std::vector<UserType>> getRemoteValue() {
85  std::vector<UserType> v;
86  for(size_t k = 0; k < derived->nElementsPerChannel(); ++k) {
87  v.push_back(derived->acc[derived->channel][k]);
88  }
89  return {v};
90  }
91 
92  void setRemoteValue() {
93  auto v = generateValue<typename Derived::minimumUserType>()[0];
94  for(size_t k = 0; k < derived->nElementsPerChannel(); ++k) {
95  derived->acc[derived->channel][k] = v[k];
96  }
97  if(derived->isPush()) {
98  // At the moment only interrupt 6 is used, so we hard code it here. Can be made more flexible if needed.
99  dynamic_cast<DummyBackend&>(derived->acc.getBackend()).triggerInterrupt(6);
100  }
101  }
102 };
103 
105 template<typename Derived>
108 
109  size_t nChannels() { return 1; }
110 
111  size_t myOffset() { return 0; }
112 
113  // T is always minimumUserType, but C++ doesn't allow to use Derived::minimumUserType here (circular dependency)
114  template<typename T, typename Traw>
115  T convertRawToCooked(Traw value) {
116  return static_cast<T>(value);
117  }
118 
119  template<typename UserType>
120  void generateValueHook(std::vector<UserType>&) {} // override in derived if needed
121 
122  // type can be user type or raw type
123  template<typename Type>
124  std::vector<std::vector<Type>> generateValue(bool getRaw = false) {
125  std::vector<Type> v;
126  typedef typename Derived::rawUserType Traw;
127  typedef typename Derived::minimumUserType T;
128  auto cv = derived->template getRemoteValue<Traw>(true)[0];
129  for(size_t i = 0; i < derived->nElementsPerChannel(); ++i) {
130  Traw e = cv[i] + derived->increment * (static_cast<Traw>(i) + 1);
131  if(!getRaw) {
132  v.push_back(derived->template convertRawToCooked<T, Traw>(e));
133  }
134  else {
135  v.push_back(static_cast<T>(e));
136  }
137  }
138  derived->generateValueHook(v);
139  return {v};
140  }
141 
142  template<typename UserType>
143  std::vector<std::vector<UserType>> getRemoteValue(bool getRaw = false) {
144  typedef typename Derived::rawUserType Traw;
145 
146  std::vector<UserType> cookedValues(derived->nElementsPerChannel());
147  std::vector<Traw> rawValues(derived->nElementsPerChannel());
148 
149  // Keep the scope of the dummy buffer lock as limited as possible (see #12332).
150  // The rawToCooked conversion will acquire a lock via the math pluging decorator,
151  // which will cause lock order inversion if you hold the dummy buffer lock at that point.
152  {
153  auto bufferLock = derived->acc.getBufferLock();
154 
155  for(size_t i = 0; i < derived->nElementsPerChannel(); ++i) {
156  rawValues[i] = derived->acc[i + derived->myOffset()];
157  }
158  } // end of bufferLock scope
159 
160  for(size_t i = 0; i < derived->nElementsPerChannel(); ++i) {
161  if(!getRaw) {
162  cookedValues[i] = derived->template convertRawToCooked<UserType, Traw>(rawValues[i]);
163  }
164  else {
165  cookedValues[i] = static_cast<UserType>(rawValues[i]); // you can only use raw if user type and raw type are
166  // the same, so the static cast is a no-op
167  }
168  }
169  return {cookedValues};
170  }
171 
172  void setRemoteValue() {
173  auto v = generateValue<typename Derived::rawUserType>(true)[0];
174  { // scope for the buffer lock
175  auto bufferLock = derived->acc.getBufferLock();
176  for(size_t i = 0; i < derived->nElementsPerChannel(); ++i) {
177  derived->acc[i + derived->myOffset()] = v[i];
178  }
179  } // release the buffer lock before triggering another thread
180  if(derived->isPush()) {
181  dynamic_cast<ExceptionDummy&>(derived->acc.getBackend()).triggerInterrupt(6);
182  }
183  }
184 };
185 
187 template<typename Derived>
189  size_t nElementsPerChannel() { return 1; }
190 };
191 
193 template<typename Derived>
196  static constexpr auto capabilities =
197  RegisterDescriptorBase<Derived>::capabilities.disableTestRawTransfer().disableSetRemoteValueIncrementsVersion();
198 
199  size_t nChannels() { return 1; }
200  bool isWriteable() { return false; }
202 
203  size_t nRuntimeErrorCases() { return 0; }
204 
205  template<typename UserType>
206  std::vector<std::vector<UserType>> generateValue() {
207  return this->getRemoteValue<UserType>();
208  }
209 
210  template<typename UserType>
211  std::vector<std::vector<UserType>> getRemoteValue() {
212  std::vector<UserType> v;
213  for(size_t k = 0; k < derived->nElementsPerChannel(); ++k) {
214  v.push_back(derived->value[k]);
215  }
216  return {v};
217  }
218 
219  void setRemoteValue() {}
220 
221  void setForceRuntimeError(bool, size_t) { assert(false); }
222 };
223 
225 template<typename Derived>
228  static constexpr auto capabilities = RegisterDescriptorBase<Derived>::capabilities.disableTestRawTransfer();
229 
230  size_t nChannels() { return 1; }
232 
233  size_t nRuntimeErrorCases() { return 0; }
234 
235  template<typename UserType>
236  std::vector<std::vector<UserType>> getRemoteValue(bool = false) {
237  // For Variables we don't have a backdoor. We have to use the normal read and write
238  // functions which are good enough. It seems like a self consistency test, but all
239  // functionality the variable has to provide is that I can write something, and
240  // read it back, which is tested with it.
241 
242  // We might have to open/recover the backend to perform the operation. We have to remember
243  // that we did so and close/set-exception it again it we did. Some tests require the backend to be closed.
244  bool backendWasOpened = lmapBackend->isOpen();
245  bool backendWasFunctional = lmapBackend->isFunctional();
246  if(!backendWasOpened || !backendWasFunctional) {
247  lmapBackend->open();
248  }
249  auto acc = lmapBackend->getRegisterAccessor<typename Derived::minimumUserType>(derived->path(), 0, 0, {});
250  acc->read();
251  if(!backendWasOpened) {
252  lmapBackend->close();
253  }
254  else if(!backendWasFunctional) {
255  lmapBackend->setException("Some message");
256  }
257  std::vector<UserType> v;
258  for(size_t k = 0; k < derived->nElementsPerChannel(); ++k) {
259  v.push_back(acc->accessData(k));
260  }
261  return {v};
262  }
263 
264  void setRemoteValue() {
265  auto acc = lmapBackend->getRegisterAccessor<typename Derived::minimumUserType>(derived->path(), 0, 0, {});
266  auto v = derived->template generateValue<typename Derived::minimumUserType>()[0];
267  for(size_t k = 0; k < derived->nElementsPerChannel(); ++k) {
268  acc->accessData(k) = v[k];
269  }
270  bool backendWasOpened = lmapBackend->isOpen();
271  if(!backendWasOpened) {
272  lmapBackend->open();
273  }
274  try {
275  acc->write();
276  }
277  catch(...) {
278  // ignore any exceptions: if the device is in an exception state, this write must not take place but the exception
279  // must not get through.
280  }
281  if(!backendWasOpened) {
282  lmapBackend->close();
283  }
284  }
285 
286  void setForceRuntimeError(bool, size_t) { assert(false); }
287 };
288 
289 // Base descriptor for bit accessors
290 template<typename Derived>
293  static constexpr auto capabilities = RegisterDescriptorBase<Derived>::capabilities.disableTestRawTransfer();
294 
295  size_t nChannels() { return 1; }
296  size_t nElementsPerChannel() { return 1; }
297 
299  typedef int32_t rawUserType;
300 
302 
303  size_t nRuntimeErrorCases() { return derived->target.nRuntimeErrorCases(); }
304 
305  template<typename UserType>
306  std::vector<std::vector<UserType>> generateValue() {
307  return {{!this->template getRemoteValue<uint64_t>()[0][0]}};
308  }
309 
310  template<typename UserType>
311  std::vector<std::vector<UserType>> getRemoteValue() {
312  uint64_t v = derived->target.template getRemoteValue<uint64_t>()[0][0];
313  uint64_t mask = 1 << derived->bit;
314  bool result = v & mask;
315  return {{result}};
316  }
317 
318  void setRemoteValue() {
319  derived->target.setRemoteValue();
320  if(derived->isPush()) {
321  // At the moment only interrupt 6 is used, so we hard code it here. Can be made more flexible if needed.
322  exceptionDummyPush->triggerInterrupt(6);
323  }
324  }
325 
326  void setForceRuntimeError(bool enable, size_t caseIndex) { derived->target.setForceRuntimeError(enable, caseIndex); }
327 };
328 
329 /**********************************************************************************************************************/
330 /* Now for each register in unifiedTest.xlmap we define a descriptor */
331 
334  std::string path() { return "/SingleWord"; }
335 
336  const uint32_t increment = 3;
337 
338  typedef uint32_t minimumUserType;
339  typedef int32_t rawUserType;
340  DummyRegisterAccessor<minimumUserType> acc{exceptionDummyLikeMtcadummy.get(), "", "/BOARD.WORD_FIRMWARE"};
341 };
342 
346  std::string path() { return "/SingleWord"; }
347 
348  const uint32_t increment = 3;
349 
350  typedef uint32_t minimumUserType;
351  typedef int32_t rawUserType;
352  DummyRegisterAccessor<minimumUserType> acc{exceptionDummyPush.get(), "", "/BOARD.WORD_FIRMWARE"};
353 };
354 
356 struct RegSingleWord_push : ScalarRegisterDescriptorBase<RegSingleWord_push> {
357  std::string path() { return "/SingleWord_push"; }
358  bool isPush() { return true; }
359  bool isWriteable() {
360  std::cout << "Warning: Writing test for /SingleWord_push has been disabled due to missing support in the dummy."
361  << std::endl;
362  return false;
363  }
364 
365  const uint32_t increment = 3;
366 
367  typedef uint32_t minimumUserType;
368  typedef int32_t rawUserType;
369  DummyRegisterAccessor<minimumUserType> acc{exceptionDummyPush.get(), "", "/BOARD.WORD_FIRMWARE"};
370 };
371 
374  std::string path() { return "/FullArea"; }
375 
376  const int32_t increment = 7;
377  size_t nElementsPerChannel() { return 0x400; }
378 
379  typedef int32_t minimumUserType;
380  typedef int32_t rawUserType;
381  DummyRegisterAccessor<minimumUserType> acc{exceptionDummyLikeMtcadummy.get(), "", "/ADC.AREA_DMAABLE"};
382 };
383 
385 struct RegPartOfArea : OneDRegisterDescriptorBase<RegPartOfArea> {
386  std::string path() { return "/PartOfArea"; }
387 
388  const int32_t increment = 11;
389  size_t nElementsPerChannel() { return 20; }
390  size_t myOffset() { return 10; }
391 
392  typedef int32_t minimumUserType;
393  typedef int32_t rawUserType;
394  DummyRegisterAccessor<minimumUserType> acc{exceptionDummyLikeMtcadummy.get(), "", "/ADC.AREA_DMAABLE"};
395 };
396 
399  std::string path() { return "/Channel3"; }
400 
401  const int32_t increment = 17;
402  size_t nElementsPerChannel() { return 4; }
403  const size_t channel{3};
404 
405  typedef int32_t minimumUserType;
406  typedef int32_t rawUserType;
407 
408  // Multiplexed 2d accessors don't have access mode raw
410  DummyMultiplexedRegisterAccessor<minimumUserType> acc{exceptionDummyMuxed.get(), "TEST", "NODMA"};
411 };
412 
415  std::string path() { return "/Channel4_push"; }
416  bool isPush() { return true; }
417 
418  const int32_t increment = 23;
419  size_t nElementsPerChannel() { return 4; }
420  const size_t channel{4};
421 
422  typedef int32_t minimumUserType;
423  typedef int32_t rawUserType;
424 
425  // Multiplexed 2d accessors don't have access mode raw
427  DummyMultiplexedRegisterAccessor<minimumUserType> acc{exceptionDummyMuxed.get(), "TEST", "NODMA"};
428 };
429 
432  std::string path() { return "/LastChannelInRegister"; }
433 
434  const int32_t increment = 27;
435  size_t nElementsPerChannel() { return 4; }
436  const size_t channel{15};
437 
438  typedef int32_t minimumUserType;
439  typedef int32_t rawUserType;
440 
441  // Multiplexed 2d accessors don't have access mode raw
443  DummyMultiplexedRegisterAccessor<minimumUserType> acc{exceptionDummyMuxed.get(), "TEST", "NODMA"};
444 };
445 
448  std::string path() { return "/Constant"; }
449 
450  size_t nElementsPerChannel() { return 1; }
451  const std::vector<int32_t> value{42};
452 
453  typedef int32_t minimumUserType;
454  typedef int32_t rawUserType;
455 };
456 
459  std::string path() { return "/Constant2"; }
460 
461  size_t nElementsPerChannel() { return 1; }
462  const std::vector<int32_t> value{666};
463 
464  typedef int32_t minimumUserType;
465  typedef int32_t rawUserType;
466 };
467 
470  std::string path() { return "/MyModule/SomeSubmodule/Variable"; }
471 
472  const int increment = 43;
473  size_t nElementsPerChannel() { return 1; }
474 
475  typedef float minimumUserType;
476  typedef int32_t rawUserType;
477 };
478 
481  std::string path() { return "/ArrayConstant"; }
482 
483  const std::vector<int32_t> value{1111, 2222, 3333, 4444, 5555};
484  size_t nElementsPerChannel() { return 5; }
485 
486  typedef float minimumUserType;
487  typedef int32_t rawUserType;
488 };
489 
492  std::string path() { return "/ArrayVariable"; }
493 
494  const int increment = 121;
495  size_t nElementsPerChannel() { return 6; }
496 
497  typedef float minimumUserType;
498  typedef int32_t rawUserType;
499 };
500 
502 struct RegBit0OfVar : BitRegisterDescriptorBase<RegBit0OfVar> {
503  std::string path() { return "/Bit0ofVar"; }
504 
506  size_t bit = 0;
507 };
508 
510 struct RegBit3OfVar : BitRegisterDescriptorBase<RegBit3OfVar> {
511  std::string path() { return "/Bit3ofVar"; }
512 
514  size_t bit = 3;
515 };
516 
518 struct RegBit2OfWordFirmware : BitRegisterDescriptorBase<RegBit2OfWordFirmware> {
519  std::string path() { return "/Bit2ofWordFirmwareA"; }
520 
522  size_t bit = 2;
523 };
524 
526 struct RegBit2OfWordFirmwareB : BitRegisterDescriptorBase<RegBit2OfWordFirmwareB> {
527  std::string path() { return "/Bit2ofWordFirmwareB"; }
528 
530  size_t bit = 2;
531  // in order to make our test sensitive to incorrect (bit accessor->device) associations, we need an instance
532  // of a bit accessor to device A, same register path, as a fixture
533  boost::shared_ptr<NDRegisterAccessor<minimumUserType>> fixAccessorOnA{
534  lmapBackend->getRegisterAccessor<minimumUserType>("/Bit2ofWordFirmwareA", 1, 0, AccessModeFlags{})};
535 };
536 
538 struct RegBit2OfWordFirmware_push : BitRegisterDescriptorBase<RegBit2OfWordFirmware_push> {
539  std::string path() { return "/Bit2ofWordFirmware_push"; }
540  bool isPush() { return true; }
541  bool isWriteable() {
542  std::cout
543  << "Warning: Writing test for /Bit2ofWordFirmware_push has been disabled due to missing support in the dummy."
544  << std::endl;
545  return false;
546  }
547 
549  size_t bit = 2;
550 };
551 
553 template<typename Derived>
555  std::string path() { return "/SingleWord_Scaled"; }
556 
557  const double increment = std::exp(1.);
558 
559  typedef double minimumUserType;
560  typedef uint32_t rawUserType;
561  // Mutliply plugin does not support access mode raw
562  static constexpr auto capabilities = ScalarRegisterDescriptorBase<Derived>::capabilities.disableTestRawTransfer();
564  DummyRegisterAccessor<rawUserType> acc{exceptionDummyLikeMtcadummy.get(), "", "/BOARD.WORD_FIRMWARE"};
565 };
566 
567 struct RegSingleWordScaled_R : RegSingleWordScaled<RegSingleWordScaled_R> {
568  bool isWriteable() { return false; }
569  // turn off the catalogue check. It reports that the register is writeable, which is correct. Writing is just turned
570  // off for the test.
571  static constexpr auto capabilities = RegSingleWordScaled<RegSingleWordScaled_R>::capabilities.disableTestCatalogue();
572 
573  template<typename T, typename Traw>
574  T convertRawToCooked(Traw value) {
575  return value * 4.2;
576  }
577 };
578 
579 struct RegSingleWordScaled_W : RegSingleWordScaled<RegSingleWordScaled_W> {
580  bool isReadable() { return false; }
581  // turn off the catalogue check. It reports that the register is readable, which is correct. Reading is just turned
582  // off for the test.
583  static constexpr auto capabilities = RegSingleWordScaled<RegSingleWordScaled_W>::capabilities.disableTestCatalogue();
584 
585  // the scale plugin applies the same factor in both directions, so we have to inverse it for write tests
586  template<typename T, typename Traw>
587  T convertRawToCooked(Traw value) {
588  return value / 4.2;
589  }
590 };
591 
592 struct RegSingleWordScaled_RW : RegSingleWordScaled<RegSingleWordScaled_RW> {
593  std::string path() { return "/SingleWord_NotScaled"; }
594 
595  // The scale plugin applies the same factor in both directions, so it has to be 1 to make the test pass
596  // for both reading and writing.
597  template<typename T, typename Traw>
598  T convertRawToCooked(Traw value) {
599  return value;
600  }
601 };
602 
604 struct RegSingleWordScaledTwice_push : ScalarRegisterDescriptorBase<RegSingleWordScaledTwice_push> {
605  std::string path() { return "/SingleWord_Scaled_Twice_push"; }
606  bool isWriteable() { return false; }
607  bool isPush() { return true; }
608 
609  const double increment = std::exp(3.);
610 
611  template<typename T, typename Traw>
612  T convertRawToCooked(Traw value) {
613  return 6 * value;
614  }
615 
616  typedef double minimumUserType;
618  // Mutliply plugin does not support access mode raw
619  static constexpr auto capabilities =
621  ChimeraTK::AccessModeFlags supportedFlags() { return {AccessMode::wait_for_new_data}; }
622  DummyRegisterAccessor<minimumUserType> acc{exceptionDummyPush.get(), "", "/BOARD.WORD_FIRMWARE"};
623 };
624 
626 struct RegFullAreaScaled : OneDRegisterDescriptorBase<RegFullAreaScaled> {
627  std::string path() { return "/FullArea_Scaled"; }
628  bool isWriteable() { return false; }
629  // Mutliply plugin does not support access mode raw
630  // turn off the catalogue check. It reports that the register is readable, which is correct. Reading is just turned
631  // off for the test.
632  static constexpr auto capabilities =
633  OneDRegisterDescriptorBase<RegFullAreaScaled>::capabilities.disableTestRawTransfer().disableTestCatalogue();
634 
635  const double increment = std::exp(4.);
636  size_t nElementsPerChannel() { return 0x400; }
637 
638  template<typename T, typename Traw>
639  T convertRawToCooked(Traw value) {
640  return 0.5 * value;
641  }
642 
643  typedef double minimumUserType;
644  typedef int32_t rawUserType;
645  // Mutliply plugin does not support access mode raw. Capabilities already turned off above.
647  DummyRegisterAccessor<minimumUserType> acc{exceptionDummyLikeMtcadummy.get(), "", "/ADC.AREA_DMAABLE"};
648 };
649 
651 struct RegWordFirmwareForcedReadOnly : ScalarRegisterDescriptorBase<RegWordFirmwareForcedReadOnly> {
652  std::string path() { return "/WordFirmwareForcedReadOnly"; }
653 
654  const uint32_t increment = -47;
655  bool isWriteable() { return false; }
656 
657  typedef uint32_t minimumUserType;
658  typedef int32_t rawUserType;
659  DummyRegisterAccessor<minimumUserType> acc{exceptionDummyLikeMtcadummy.get(), "", "/BOARD.WORD_FIRMWARE"};
660 };
661 
663 struct RegWordFirmwareForcedReadOnly_push : ScalarRegisterDescriptorBase<RegWordFirmwareForcedReadOnly_push> {
664  std::string path() { return "/WordFirmwareForcedReadOnly_push"; }
665  bool isPush() { return true; }
666 
667  const uint32_t increment = -47;
668  bool isWriteable() { return false; }
669 
670  typedef uint32_t minimumUserType;
671  typedef int32_t rawUserType;
672  DummyRegisterAccessor<minimumUserType> acc{exceptionDummyPush.get(), "", "/BOARD.WORD_FIRMWARE"};
673 };
674 
676 template<typename Derived>
678  const double increment = 7;
679 
680  typedef double minimumUserType;
681  typedef uint32_t rawUserType;
682  // Math plugin does not support access mode raw
683  static constexpr auto capabilities = ScalarRegisterDescriptorBase<Derived>::capabilities.disableTestRawTransfer();
685  DummyRegisterAccessor<rawUserType> acc{exceptionDummyPush.get(), "", "/BOARD.WORD_FIRMWARE"};
686 };
687 
688 struct RegWordFirmwareWithMath_R : RegWordFirmwareWithMath<RegWordFirmwareWithMath_R> {
689  std::string path() { return "/WordFirmwareWithMath_r"; }
690  bool isWriteable() { return false; }
691 
692  template<typename T, typename Traw>
693  T convertRawToCooked(Traw value) {
694  return value + 2.345;
695  }
696 };
697 
698 struct RegWordFirmwareWithMath_R_push : RegWordFirmwareWithMath<RegWordFirmwareWithMath_R_push> {
699  bool isWriteable() { return false; }
700  bool isPush() { return true; }
701  std::string path() { return "/WordFirmwareWithMath_push"; }
702 
703  template<typename T, typename Traw>
704  T convertRawToCooked(Traw value) {
705  return value + 2.345;
706  }
707  // Math plugin does not support access mode raw
708  ChimeraTK::AccessModeFlags supportedFlags() { return {AccessMode::wait_for_new_data}; }
709 };
710 
711 struct RegWordFirmwareWithMath_W : RegWordFirmwareWithMath<RegWordFirmwareWithMath_W> {
712  std::string path() { return "/WordFirmwareWithMath_w"; }
713  bool isReadable() { return false; }
714 
715  // the math plugin applies the same formula in both directions, so we have to reverse the formula for write tests
716  template<typename T, typename Traw>
717  T convertRawToCooked(Traw value) {
718  return value - 2.345;
719  }
720 };
721 
723 struct RegWordFirmwareAsParameterInMath : ScalarRegisterDescriptorBase<RegWordFirmwareAsParameterInMath> {
724  std::string path() { return "/WordFirmwareAsParameterInMath"; }
725 
726  // no write test, since we cannot write into a parameter...
727  bool isWriteable() { return false; }
728 
729  const double increment = 91;
730 
731  template<typename T, typename Traw>
732  T convertRawToCooked(Traw value) {
733  return value - 42;
734  }
735 
736  typedef double minimumUserType;
738  // Math plugin does not support access mode raw
739  static constexpr auto capabilities =
742  DummyRegisterAccessor<rawUserType> acc{exceptionDummyLikeMtcadummy.get(), "", "/BOARD.WORD_FIRMWARE"};
743 };
744 
749 static double RegVariableAsPushParameterInMathBase_lastX;
750 
751 /* We use a has-a-pattern mixin-like pattern to break the "diamond of death".
752  * - There is a convertRawToCooked() per variable (var1, var2, x)
753  * - There is a base implementation and a "not written" implementation of generateValue() and getRemoteValue()
754  * All combinations of them have to be tested, and each of them has a unique generateValueHook().
755  * If we try multiple inveritance this ends up in a diamond of death.
756  *
757  * Solution: The convertRawToCooked() is not done by inheritance but coming from a RawToCookedProvider, which is a
758  * template parameter. Like this RegVariableAsPushParameterInMathBase and RegVariableAsPushParameterInMath_not_written
759  * can be used with all conversion functions and there is no code duplication.
760  */
761 template<typename Derived, typename RawToCookedProvider>
763  // Test only write direction, as we are writing to the variable parameter in this test
764  // Also turn off the catalogue test which would fail because the register actually is readable.
765  static constexpr auto capabilities = ScalarRegisterDescriptorBase<Derived>::capabilities.enableTestWriteOnly()
766  .disableTestRawTransfer()
767  .disableTestCatalogue();
768 
769  // no runtime error test cases, as writes happen to the variable only!
770  size_t nRuntimeErrorCases() { return 0; }
771  void setForceRuntimeError(bool, size_t) { assert(false); }
772 
773  // the test "sees" the variable which supports wait_for_new_data
775 
776  template<typename T, typename Traw>
777  T convertRawToCooked(Traw value) {
778  return RawToCookedProvider::convertRawToCooked_impl(value, lmapBackend);
779  }
780 
781  typedef double minimumUserType;
782  typedef minimumUserType rawUserType; // for this context raw means before the math conversion
783  DummyRegisterAccessor<rawUserType> acc{exceptionDummyLikeMtcadummy.get(), "", "/BOARD.WORD_STATUS"};
784 };
785 
786 // template type UserType and RawType have to be double for the math plugin, so we make that explicit in this helper
787 // function
789  static double convertRawToCooked_impl(double value, boost::shared_ptr<LogicalNameMappingBackend>& lmapBackend) {
790  auto variable2 = lmapBackend->getRegisterAccessor<double>("/VariableForMathTest2", 0, 0, {});
791  variable2->read();
792  return (value - variable2->accessData(0) * 121 - RegVariableAsPushParameterInMathBase_lastX) / 120;
793  }
794 };
795 
797 : RegVariableAsPushParameterInMathBase<RegVariableAsPushParameterInMath_var1, RawToCookedProvider_Var1> {
798  std::string path() { return "/VariableForMathTest1"; }
799 
800  const double increment = 17;
801 
802  template<typename UserType>
803  void generateValueHook(std::vector<UserType>&) {
804  // this is a bit a hack: we know that the test has to generate a value before writing, so we can activate
805  // async read here which is required for the test to be successful. The assumption is that generateValue is not
806  // called before the device is open... FIXME: Better introduce a proper pre-write hook in the UnifiedBackendTest!
807  lmapBackend->activateAsyncRead();
808 
809  // In addition we have to write the accessor which has the math plugin and the second parameter.
810  // Otherwise writing of the parameters will have no effect.
811  auto x = lmapBackend->getRegisterAccessor<double>("/RegisterWithVariableAsPushParameterInMath", 0, 0, {});
812  x->accessData(0) = RegVariableAsPushParameterInMathBase_lastX;
813  x->write();
814  auto p2 = lmapBackend->getRegisterAccessor<double>("/VariableForMathTest2", 0, 0, {});
815  p2->read();
816  p2->write();
817  }
818 };
819 
820 template<typename Derived, typename RawToCookedProvider>
822 : RegVariableAsPushParameterInMathBase<Derived, RawToCookedProvider> {
823  template<typename UserType>
824  std::vector<std::vector<UserType>> generateValue(bool /*getRaw */ = false) {
825  // raw has been set to true, so we get the value as it is on the device
826  registerValueBeforeWrite = getRemoteValue<double>(true)[0][0]; // remember for comparison later
827 
828  auto generatedValue =
830  lastGeneratedValue = generatedValue[0][0]; // remember for comparison later
831  return generatedValue;
832  }
833 
834  template<typename UserType>
835  std::vector<std::vector<UserType>> getRemoteValue(bool getRaw = false) {
836  // We have to trick the unified test into passing. It expects to see the data it has written.
837  // However, the test here is that the data actually has not been written.
838  // So we do the real test here, and return what we gave out in generateValue, so the unified test can succeed.
839 
840  auto remoteRawValue =
842 
843  // Hack:
844  // getRemoteValue is used by the generateValue implementation in raw mode to access the device. We still need that.
845  // As the register with math pluin does not have a raw value, the unified test will always see the tricked version
846  // with the data it expects.
847  if(getRaw) {
848  return remoteRawValue;
849  }
850 
851  auto convertedValue = this->derived->template convertRawToCooked<double, double>(registerValueBeforeWrite);
852  assert(convertedValue != lastGeneratedValue); // test that the unified test does not accidentally pass because
853  // something in generateValue went wrong.
854  if(remoteRawValue[0][0] == registerValueBeforeWrite) {
855  // test successful. Return what is expected
856  return {{lastGeneratedValue}};
857  }
858  else {
859  // print limiter because this function is called many times in a timeout loop due to the multi-threading
860  if((lastReportedRemoteValue != remoteRawValue[0][0]) ||
861  (lastReportedValueBeforeWrite != registerValueBeforeWrite)) {
862  std::cout << "FAILED TEST: Register content altered when it should not have been. (" << remoteRawValue[0][0]
863  << " != " << registerValueBeforeWrite << ")" << std::endl;
864  lastReportedRemoteValue = remoteRawValue[0][0];
865  lastReportedValueBeforeWrite = registerValueBeforeWrite;
866  }
867  return {{convertedValue}};
868  }
869  }
870 
873  double lastReportedRemoteValue{0}; // for the print limiter
874  double lastReportedValueBeforeWrite{0}; // for the print limiter
875 };
876 
878 : RegVariableAsPushParameterInMath_not_written<RegVariableAsPushParameterInMath_var1_not_written1,
879  RawToCookedProvider_Var1> {
880  std::string path() { return "/VariableForMathTest1"; }
881 
882  const double increment = 18;
883 
884  template<typename UserType>
885  void generateValueHook(std::vector<UserType>&) {
886  // this is a bit a hack: we know that the test has to generate a value before writing, so we can activate
887  // async read here which is required for the test to be successful. The assumption is that generateValue is not
888  // called before the device is open... FIXME: Better introduce a proper pre-write hook in the UnifiedBackendTest!
889  lmapBackend->close();
890  lmapBackend->open(); // this test is explicitly for writing after open
891  lmapBackend->activateAsyncRead();
892  // Only write the accessor, not the second parameter.
893  auto x = lmapBackend->getRegisterAccessor<double>("/RegisterWithVariableAsPushParameterInMath", 0, 0, {});
894  x->accessData(0) = RegVariableAsPushParameterInMathBase_lastX;
895  x->write();
896  }
897 };
898 
900 : RegVariableAsPushParameterInMath_not_written<RegVariableAsPushParameterInMath_var1_not_written2,
901  RawToCookedProvider_Var1> {
902  std::string path() { return "/VariableForMathTest1"; }
903 
904  const double increment = 19;
905 
906  template<typename UserType>
907  void generateValueHook(std::vector<UserType>&) {
908  // this is a bit a hack: we know that the test has to generate a value before writing, so we can activate
909  // async read here which is required for the test to be successful. The assumption is that generateValue is not
910  // called before the device is open... FIXME: Better introduce a proper pre-write hook in the UnifiedBackendTest!
911  lmapBackend->close();
912  lmapBackend->open(); // this test is explicitly for writing after open
913  lmapBackend->activateAsyncRead();
914  // Only write the second parameter, not the accessor.
915  auto p2 = lmapBackend->getRegisterAccessor<double>("/VariableForMathTest2", 0, 0, {});
916  p2->read();
917  p2->write();
918  }
919 };
920 
922  static double convertRawToCooked_impl(double value, boost::shared_ptr<LogicalNameMappingBackend>& lmapBackend) {
923  auto variable1 = lmapBackend->getRegisterAccessor<double>("/VariableForMathTest1", 0, 0, {});
924  variable1->read();
925  return (value - variable1->accessData(0) * 120 - RegVariableAsPushParameterInMathBase_lastX) / 121;
926  }
927 };
928 
930 : RegVariableAsPushParameterInMathBase<RegVariableAsPushParameterInMath_var2, RawToCookedProvider_Var2> {
931  std::string path() { return "/VariableForMathTest2"; }
932 
933  const double increment = 23;
934 
935  template<typename UserType>
936  void generateValueHook(std::vector<UserType>&) {
937  // this is a bit a hack: we know that the test has to generate a value before writing, so we can activate
938  // async read here which is required for the test to be successful. The assumption is that generateValue is not
939  // called before the device is open... FIXME: Better introduce a proper pre-write hook in the UnifiedBackendTest!
940  lmapBackend->activateAsyncRead();
941 
942  // In addition we have to write the accessor which has the math plugin and the first parameter.
943  // Otherwise writing of the parameters will have no effect.
944  auto x = lmapBackend->getRegisterAccessor<double>("/RegisterWithVariableAsPushParameterInMath", 0, 0, {});
945  x->accessData(0) = RegVariableAsPushParameterInMathBase_lastX;
946  x->write();
947  auto p1 = lmapBackend->getRegisterAccessor<double>("/VariableForMathTest1", 0, 0, {});
948  p1->read();
949  p1->write();
950  }
951 };
952 
954  static double convertRawToCooked_impl(double value, boost::shared_ptr<LogicalNameMappingBackend>& lmapBackend) {
955  auto variable1 = lmapBackend->getRegisterAccessor<double>("/VariableForMathTest1", 0, 0, {});
956  variable1->read();
957  auto variable2 = lmapBackend->getRegisterAccessor<double>("/VariableForMathTest2", 0, 0, {});
958  variable2->read();
959  return value - variable1->accessData(0) * 120 - variable2->accessData(0) * 121;
960  }
961 };
962 
963 // This is the actual register that is "decoreated" with the math plugin (the x in the formula)
965 : RegVariableAsPushParameterInMathBase<RegVariableAsPushParameterInMath_x, RawToCookedProvider_x> {
966  std::string path() { return "/RegisterWithVariableAsPushParameterInMath"; }
967 
968  const double increment = 42;
969 
970  template<typename UserType>
971  void generateValueHook(std::vector<UserType>& v) {
972  // Note: This in particular is a hack, since we have no guarantee that this gets actually written!
973  // FIXME: Better introduce a proper pre-write hook in the UnifiedBackendTest!
974  RegVariableAsPushParameterInMathBase_lastX = v[0];
975  // this is a bit a hack: we know that the test has to generate a value before writing, so we can activate
976  // async read here which is required for the test to be successful. The assumption is that generateValue is not
977  // called before the device is open... FIXME: Better introduce a proper pre-write hook in the UnifiedBackendTest!
978  lmapBackend->activateAsyncRead();
979 
980  // In addition we have to write the two parameters. Otherwise writing must have no effect.
981  auto p1 = lmapBackend->getRegisterAccessor<double>("/VariableForMathTest1", 0, 0, {});
982  p1->read();
983  p1->write();
984  auto p2 = lmapBackend->getRegisterAccessor<double>("/VariableForMathTest2", 0, 0, {});
985  p2->read();
986  p2->write();
987  }
988 };
989 
991 : RegVariableAsPushParameterInMath_not_written<RegVariableAsPushParameterInMath_x_not_written1, RawToCookedProvider_x> {
992  std::string path() { return "/RegisterWithVariableAsPushParameterInMath"; }
993 
994  const double increment = 43;
995 
996  template<typename UserType>
997  void generateValueHook(std::vector<UserType>& v) {
998  // Note: This in particular is a hack, since we have no guarantee that this gets actually written!
999  // FIXME: Better introduce a proper pre-write hook in the UnifiedBackendTest!
1000  RegVariableAsPushParameterInMathBase_lastX = v[0];
1001  // this is a bit a hack: we know that the test has to generate a value before writing, so we can activate
1002  // async read here which is required for the test to be successful. The assumption is that generateValue is not
1003  // called before the device is open... FIXME: Better introduce a proper pre-write hook in the UnifiedBackendTest!
1004  lmapBackend->close();
1005  lmapBackend->open(); // this test is explicitly for writing after open
1006  lmapBackend->activateAsyncRead();
1007 
1008  auto p1 = lmapBackend->getRegisterAccessor<double>("/VariableForMathTest1", 0, 0, {});
1009  p1->read();
1010  p1->write();
1011  // don't write p2
1012  }
1013 };
1014 
1016 : RegVariableAsPushParameterInMath_not_written<RegVariableAsPushParameterInMath_x_not_written2, RawToCookedProvider_x> {
1017  std::string path() { return "/RegisterWithVariableAsPushParameterInMath"; }
1018 
1019  const double increment = 44;
1020 
1021  template<typename UserType>
1022  void generateValueHook(std::vector<UserType>& v) {
1023  // Note: This in particular is a hack, since we have no guarantee that this gets actually written!
1024  // FIXME: Better introduce a proper pre-write hook in the UnifiedBackendTest!
1025  RegVariableAsPushParameterInMathBase_lastX = v[0];
1026  // this is a bit a hack: we know that the test has to generate a value before writing, so we can activate
1027  // async read here which is required for the test to be successful. The assumption is that generateValue is not
1028  // called before the device is open... FIXME: Better introduce a proper pre-write hook in the UnifiedBackendTest!
1029  lmapBackend->close();
1030  lmapBackend->open(); // this test is explicitly for writing after open
1031  lmapBackend->activateAsyncRead();
1032 
1033  auto p2 = lmapBackend->getRegisterAccessor<double>("/VariableForMathTest2", 0, 0, {});
1034  p2->read();
1035  p2->write();
1036  }
1037 };
1038 
1039 // template type UserType and RawType have to be double for the math plugin, so we make that explicit in this helper
1040 // function
1042  static constexpr double theOffset = 10;
1043 
1044  static double convertRawToCooked_impl(double value, boost::shared_ptr<LogicalNameMappingBackend>&) {
1045  return ((uint32_t(value) >> 3) & 1) + theOffset;
1046  }
1047 };
1048 
1050 : RegVariableAsPushParameterInMathBase<RegRedirectedBitWithMath, RawToCookedProvider_BitWithMath> {
1051  std::string path() { return "/RedirectedBitWithMath"; }
1052 
1053  const double increment = 8;
1054  typedef int32_t rawUserType;
1055 
1056  template<typename UserType>
1057  void generateValueHook(std::vector<UserType>&) {
1058  // this is a bit a hack: we know that the test has to generate a value before writing, so we can activate
1059  // async read here which is required for the test to be successful. The assumption is that generateValue is not
1060  // called before the device is open... FIXME: Better introduce a proper pre-write hook in the UnifiedBackendTest!
1061  lmapBackend->activateAsyncRead();
1062 
1063  // In addition we have to write the accessor which has the math plugin.
1064  // Otherwise writing of the parameters will have no effect.
1065  auto x = lmapBackend->getRegisterAccessor<double>("/RedirectedBitWithMath_helper", 0, 0, {});
1066  x->accessData(0) = RawToCookedProvider_BitWithMath::theOffset;
1067  x->write();
1068  }
1069 };
1070 
1072 struct RegMonostableTrigger : ScalarRegisterDescriptorBase<RegMonostableTrigger> {
1073  std::string path() { return "/MonostableTrigger"; }
1074 
1075  // Note: the test is rather trivial and does not cover much apart from exception handling, since it requires a special
1076  // dummy to test the intermediate value.
1077 
1078  bool isReadable() { return false; }
1079 
1080  uint32_t increment = 0; // unused but required to be present
1081 
1082  template<typename UserType>
1083  std::vector<std::vector<UserType>> generateValue() {
1084  return {{0}};
1085  }
1086 
1087  // Conceptually the monostable trigger is of data type void. The input value
1088  // is not written anywhere. To fulfill the requirements of the test, just return what
1089  // was generated so the comparison succeeds.
1090  template<typename UserType>
1091  std::vector<std::vector<UserType>> getRemoteValue(bool /*getRaw*/ = false) {
1092  return generateValue<UserType>();
1093  }
1094 
1095  // FIXME: This is Boolean until the UnifiedTest is modified to support Void correctly
1098 
1099  // Mutliply plugin does not support access mode raw
1100  static constexpr auto capabilities =
1103  DummyRegisterAccessor<minimumUserType> acc{exceptionDummyLikeMtcadummy.get(), "", "/BOARD.WORD_STATUS"};
1104 };
1105 
1106 // Base descriptor for bit accessors
1107 template<typename Derived>
1110  static constexpr auto capabilities = RegisterDescriptorBase<Derived>::capabilities.disableTestRawTransfer();
1111 
1112  size_t nChannels() { return 1; }
1113  size_t nElementsPerChannel() { return 1; }
1114 
1116 
1117  size_t nRuntimeErrorCases() { return derived->target.nRuntimeErrorCases(); }
1118 
1119  template<typename UserType>
1120  std::vector<std::vector<UserType>> generateValue() {
1121  return derived->target.template generateValue<UserType>();
1122  }
1123 
1124  template<typename UserType>
1125  std::vector<std::vector<UserType>> getRemoteValue() {
1126  uint64_t v = derived->target.template getRemoteValue<uint64_t>()[0][0];
1127  uint64_t mask = ((1 << derived->width) - 1) << derived->shift;
1128  UserType result = (v & mask) >> derived->shift;
1129  return {{result}};
1130  }
1131 
1132  void setRemoteValue() { derived->target.setRemoteValue(); }
1133 
1134  void setForceRuntimeError(bool enable, size_t caseIndex) { derived->target.setForceRuntimeError(enable, caseIndex); }
1135 };
1136 
1137 struct BitRangeAccessorTarget : ScalarRegisterDescriptorBase<BitRangeAccessorTarget> {
1138  std::string path() { return "/BOARD.WORD_FIRMWARE"; }
1139 
1140  const uint32_t increment = 0x1313'2131;
1141 
1142  using minimumUserType = uint32_t;
1143  using rawUserType = int32_t;
1144  DummyRegisterAccessor<minimumUserType> acc{exceptionDummyLikeMtcadummy.get(), "", "/BOARD.WORD_FIRMWARE"};
1145 };
1146 
1147 struct RegLowerHalfOfFirmware : RegBitRangeDescriptor<RegLowerHalfOfFirmware> {
1148  std::string path() { return "/BitRangeLower"; }
1149 
1150  using minimumUserType = int8_t;
1151 
1152  uint16_t width = 8;
1153  uint16_t shift = 8;
1154 
1155  BitRangeAccessorTarget target;
1156 };
1157 
1158 struct RegUpperHalfOfFirmware : RegBitRangeDescriptor<RegUpperHalfOfFirmware> {
1159  std::string path() { return "/BitRangeUpper"; }
1160 
1161  using minimumUserType = int16_t;
1162 
1163  uint16_t width = 16;
1164  uint16_t shift = 16;
1165 
1166  BitRangeAccessorTarget target;
1167 };
1168 
1169 struct Reg9BitsInChar : RegBitRangeDescriptor<Reg9BitsInChar> {
1170  std::string path() { return "/BitRangeMiddle"; }
1171 
1172  using minimumUserType = int8_t;
1173 
1174  uint16_t width = 9;
1175  uint16_t shift = 4;
1176 
1177  BitRangeAccessorTarget target;
1178 };
1179 
1180 /**********************************************************************************************************************/
1181 
1182 BOOST_AUTO_TEST_CASE(unifiedBackendTest) {
1183  std::string dummyCdd = "(ExceptionDummy?map=mtcadummy.map)";
1184  std::string muxedDummyCdd = "(ExceptionDummy?map=muxedDataAcessor.map)";
1185  std::string pushDummyCdd = "(ExceptionDummy?map=mtcadummyB.map)";
1186  std::string lmapCdd = "(logicalNameMap?map=unifiedTest.xlmap&target=" + dummyCdd + "&target2=" + muxedDummyCdd +
1187  "&target3=" + pushDummyCdd + ")";
1188  exceptionDummyLikeMtcadummy =
1189  boost::dynamic_pointer_cast<ExceptionDummy>(BackendFactory::getInstance().createBackend(dummyCdd));
1190  exceptionDummyMuxed =
1191  boost::dynamic_pointer_cast<ExceptionDummy>(BackendFactory::getInstance().createBackend(muxedDummyCdd));
1192  // needed for a test that redirected bit goes to right target device
1193  exceptionDummyPush =
1194  boost::dynamic_pointer_cast<ExceptionDummy>(BackendFactory::getInstance().createBackend(pushDummyCdd));
1195  lmapBackend =
1196  boost::dynamic_pointer_cast<LogicalNameMappingBackend>(BackendFactory::getInstance().createBackend(lmapCdd));
1197 
1198  ChimeraTK::UnifiedBackendTest<>()
1199  .addRegister<RegSingleWord>()
1200  .addRegister<RegSingleWord_push>()
1201  .addRegister<RegFullArea>()
1202  .addRegister<RegPartOfArea>()
1203  .addRegister<RegChannel3>()
1204  .addRegister<RegChannel4_push>()
1205  .addRegister<RegChannelLast>()
1206  .addRegister<RegConstant>()
1207  .addRegister<RegConstant2>()
1208  .addRegister<RegVariable>()
1209  .addRegister<RegArrayConstant>()
1210  .addRegister<RegArrayVariable>()
1211  .addRegister<RegBit0OfVar>()
1212  .addRegister<RegBit3OfVar>()
1213  .addRegister<RegBit2OfWordFirmware>()
1214  .addRegister<RegBit2OfWordFirmwareB>()
1215  .addRegister<RegBit2OfWordFirmware_push>()
1216  .addRegister<RegSingleWordScaled_R>()
1217  .addRegister<RegSingleWordScaled_W>()
1218  .addRegister<RegSingleWordScaled_RW>()
1219  .addRegister<RegSingleWordScaledTwice_push>()
1220  .addRegister<RegFullAreaScaled>()
1221  .addRegister<RegWordFirmwareForcedReadOnly>()
1222  .addRegister<RegWordFirmwareForcedReadOnly_push>()
1223  .addRegister<RegWordFirmwareWithMath_R>()
1224  .addRegister<RegWordFirmwareWithMath_R_push>()
1225  .addRegister<RegWordFirmwareWithMath_W>()
1226  .addRegister<RegWordFirmwareAsParameterInMath>()
1227  .addRegister<RegVariableAsPushParameterInMath_var1>()
1228  .addRegister<RegVariableAsPushParameterInMath_var1_not_written1>()
1229  .addRegister<RegVariableAsPushParameterInMath_var1_not_written2>()
1230  .addRegister<RegVariableAsPushParameterInMath_var2>()
1231  .addRegister<RegVariableAsPushParameterInMath_x>()
1232  .addRegister<RegVariableAsPushParameterInMath_x_not_written1>()
1233  .addRegister<RegVariableAsPushParameterInMath_x_not_written2>()
1234  .addRegister<RegRedirectedBitWithMath>()
1235  .addRegister<RegMonostableTrigger>()
1236  .addRegister<RegLowerHalfOfFirmware>()
1237  .addRegister<RegUpperHalfOfFirmware>()
1238  .addRegister<Reg9BitsInChar>()
1239  .runTests(lmapCdd);
1240 }
1241 
1242 /**********************************************************************************************************************/
1243 
1244 BOOST_AUTO_TEST_SUITE_END()
RegArrayVariable::path
std::string path()
Definition: testLMapBackendUnified.cpp:492
RegConstant2::nElementsPerChannel
size_t nElementsPerChannel()
Definition: testLMapBackendUnified.cpp:461
ExceptionDummyBackend.h
RegArrayConstant
Test constant accessor with arrays.
Definition: testLMapBackendUnified.cpp:480
ConstantRegisterDescriptorBase::setRemoteValue
void setRemoteValue()
Definition: testLMapBackendUnified.cpp:219
ConstantRegisterDescriptorBase
Base descriptor for constant accessors.
Definition: testLMapBackendUnified.cpp:194
OneDRegisterDescriptorBase::nChannels
size_t nChannels()
Definition: testLMapBackendUnified.cpp:109
BitRegisterDescriptorBase::minimumUserType
ChimeraTK::Boolean minimumUserType
Definition: testLMapBackendUnified.cpp:298
ConstantRegisterDescriptorBase::isWriteable
bool isWriteable()
Definition: testLMapBackendUnified.cpp:200
RegVariableAsPushParameterInMath_x_not_written2::generateValueHook
void generateValueHook(std::vector< UserType > &v)
Definition: testLMapBackendUnified.cpp:1022
ScalarRegisterDescriptorBase::nElementsPerChannel
size_t nElementsPerChannel()
Definition: testLMapBackendUnified.cpp:189
RegWordFirmwareWithMath::minimumUserType
double minimumUserType
Definition: testLMapBackendUnified.cpp:680
RegSingleWordScaled::minimumUserType
double minimumUserType
Definition: testLMapBackendUnified.cpp:559
RegFullAreaScaled::nElementsPerChannel
size_t nElementsPerChannel()
Definition: testLMapBackendUnified.cpp:636
ChimeraTK::ExceptionDummy
Definition: ExceptionDummyBackend.h:23
RegFullArea::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:380
RegFullAreaScaled::minimumUserType
double minimumUserType
Definition: testLMapBackendUnified.cpp:643
RegVariableAsPushParameterInMath_x::path
std::string path()
Definition: testLMapBackendUnified.cpp:966
BitRegisterDescriptorBase::nElementsPerChannel
size_t nElementsPerChannel()
Definition: testLMapBackendUnified.cpp:296
TransferGroup.h
ChimeraTK::AccessMode::raw
@ raw
Raw access: disable any possible conversion from the original hardware data type into the given UserT...
RegWordFirmwareForcedReadOnly_push::isWriteable
bool isWriteable()
Definition: testLMapBackendUnified.cpp:668
RawToCookedProvider_Var1::convertRawToCooked_impl
static double convertRawToCooked_impl(double value, boost::shared_ptr< LogicalNameMappingBackend > &lmapBackend)
Definition: testLMapBackendUnified.cpp:789
RegBitRangeDescriptor::setForceRuntimeError
void setForceRuntimeError(bool enable, size_t caseIndex)
Definition: testLMapBackendUnified.cpp:1134
RegWordFirmwareWithMath_R_push
Definition: testLMapBackendUnified.cpp:698
RegSingleWordB::path
std::string path()
Definition: testLMapBackendUnified.cpp:346
RegVariable::path
std::string path()
Definition: testLMapBackendUnified.cpp:470
RegMonostableTrigger::minimumUserType
ChimeraTK::Boolean minimumUserType
Definition: testLMapBackendUnified.cpp:1096
RegWordFirmwareForcedReadOnly_push
Test force readonly plugin with wait_for_new_data.
Definition: testLMapBackendUnified.cpp:663
ChimeraTK::DummyRegisterAccessor< minimumUserType >
RegVariable::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:476
RegSingleWord_push::minimumUserType
uint32_t minimumUserType
Definition: testLMapBackendUnified.cpp:367
RegBit2OfWordFirmware::target
RegSingleWord target
Definition: testLMapBackendUnified.cpp:521
ChannelRegisterDescriptorBase
Base descriptor for channel accessors.
Definition: testLMapBackendUnified.cpp:67
RegSingleWordScaledTwice_push::isWriteable
bool isWriteable()
Definition: testLMapBackendUnified.cpp:606
RegBit2OfWordFirmware_push::isPush
bool isPush()
Definition: testLMapBackendUnified.cpp:540
RegBit0OfVar::path
std::string path()
Definition: testLMapBackendUnified.cpp:503
RegWordFirmwareForcedReadOnly_push::path
std::string path()
Definition: testLMapBackendUnified.cpp:664
RawToCookedProvider_BitWithMath
Definition: testLMapBackendUnified.cpp:1041
RegBit2OfWordFirmware_push::isWriteable
bool isWriteable()
Definition: testLMapBackendUnified.cpp:541
RegVariableAsPushParameterInMathBase
Definition: testLMapBackendUnified.cpp:762
RegWordFirmwareAsParameterInMath::convertRawToCooked
T convertRawToCooked(Traw value)
Definition: testLMapBackendUnified.cpp:732
RegSingleWordScaled_R::isWriteable
bool isWriteable()
Definition: testLMapBackendUnified.cpp:568
RegVariableAsPushParameterInMath_not_written::lastGeneratedValue
double lastGeneratedValue
Definition: testLMapBackendUnified.cpp:872
RegArrayConstant::nElementsPerChannel
size_t nElementsPerChannel()
Definition: testLMapBackendUnified.cpp:484
RegWordFirmwareAsParameterInMath::minimumUserType
double minimumUserType
Definition: testLMapBackendUnified.cpp:736
RegVariableAsPushParameterInMathBase::nRuntimeErrorCases
size_t nRuntimeErrorCases()
Definition: testLMapBackendUnified.cpp:770
RegArrayVariable
Test variable accessor with arrays.
Definition: testLMapBackendUnified.cpp:491
RegWordFirmwareWithMath_R_push::isPush
bool isPush()
Definition: testLMapBackendUnified.cpp:700
VariableRegisterDescriptorBase::nRuntimeErrorCases
size_t nRuntimeErrorCases()
Definition: testLMapBackendUnified.cpp:233
RawToCookedProvider_BitWithMath::convertRawToCooked_impl
static double convertRawToCooked_impl(double value, boost::shared_ptr< LogicalNameMappingBackend > &)
Definition: testLMapBackendUnified.cpp:1044
ChannelRegisterDescriptorBase::generateValue
std::vector< std::vector< UserType > > generateValue()
Definition: testLMapBackendUnified.cpp:75
ChimeraTK::DummyMultiplexedRegisterAccessor< minimumUserType >
RegBitRangeDescriptor::setRemoteValue
void setRemoteValue()
Definition: testLMapBackendUnified.cpp:1132
RegBit2OfWordFirmwareB::path
std::string path()
Definition: testLMapBackendUnified.cpp:527
BitRegisterDescriptorBase::getRemoteValue
std::vector< std::vector< UserType > > getRemoteValue()
Definition: testLMapBackendUnified.cpp:311
RegVariableAsPushParameterInMathBase::minimumUserType
double minimumUserType
Definition: testLMapBackendUnified.cpp:781
RegVariableAsPushParameterInMath_x
Definition: testLMapBackendUnified.cpp:964
RawToCookedProvider_Var2
Definition: testLMapBackendUnified.cpp:921
RegBit3OfVar
Test bit accessor with a variable accessor as target.
Definition: testLMapBackendUnified.cpp:510
RegConstant2::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:465
RegSingleWordScaled_W::isReadable
bool isReadable()
Definition: testLMapBackendUnified.cpp:580
RegBit2OfWordFirmware_push
Test bit accessor with a real dummy accessor as target.
Definition: testLMapBackendUnified.cpp:538
RegChannel4_push::nElementsPerChannel
size_t nElementsPerChannel()
Definition: testLMapBackendUnified.cpp:419
RegWordFirmwareWithMath_W::path
std::string path()
Definition: testLMapBackendUnified.cpp:712
RegConstant2::minimumUserType
int32_t minimumUserType
Definition: testLMapBackendUnified.cpp:464
RegVariable::nElementsPerChannel
size_t nElementsPerChannel()
Definition: testLMapBackendUnified.cpp:473
RegVariableAsPushParameterInMathBase::convertRawToCooked
T convertRawToCooked(Traw value)
Definition: testLMapBackendUnified.cpp:777
RegWordFirmwareWithMath_W::convertRawToCooked
T convertRawToCooked(Traw value)
Definition: testLMapBackendUnified.cpp:717
RegFullArea
Test passing through 1D array accessors.
Definition: testLMapBackendUnified.cpp:373
RegPartOfArea::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:393
ConstantRegisterDescriptorBase::setForceRuntimeError
void setForceRuntimeError(bool, size_t)
Definition: testLMapBackendUnified.cpp:221
RegSingleWordScaledTwice_push::isPush
bool isPush()
Definition: testLMapBackendUnified.cpp:607
RegSingleWordScaled_RW::convertRawToCooked
T convertRawToCooked(Traw value)
Definition: testLMapBackendUnified.cpp:598
OneDRegisterDescriptorBase::setRemoteValue
void setRemoteValue()
Definition: testLMapBackendUnified.cpp:172
RegVariableAsPushParameterInMath_var2::generateValueHook
void generateValueHook(std::vector< UserType > &)
Definition: testLMapBackendUnified.cpp:936
RegBit2OfWordFirmware::path
std::string path()
Definition: testLMapBackendUnified.cpp:519
RegChannel3
Test channel accessor.
Definition: testLMapBackendUnified.cpp:398
LogicalNameMappingBackend.h
RawToCookedProvider_Var2::convertRawToCooked_impl
static double convertRawToCooked_impl(double value, boost::shared_ptr< LogicalNameMappingBackend > &lmapBackend)
Definition: testLMapBackendUnified.cpp:922
RegWordFirmwareAsParameterInMath::rawUserType
minimumUserType rawUserType
Definition: testLMapBackendUnified.cpp:737
BitRangeAccessorTarget::increment
const uint32_t increment
Definition: testLMapBackendUnified.cpp:1140
RegRedirectedBitWithMath::path
std::string path()
Definition: testLMapBackendUnified.cpp:1051
ChannelRegisterDescriptorBase::isWriteable
bool isWriteable()
Definition: testLMapBackendUnified.cpp:72
RegVariableAsPushParameterInMath_x_not_written1::path
std::string path()
Definition: testLMapBackendUnified.cpp:992
RegConstant::path
std::string path()
Definition: testLMapBackendUnified.cpp:448
RegConstant2
Test constant accessor.
Definition: testLMapBackendUnified.cpp:458
RegBit3OfVar::target
RegVariable target
Definition: testLMapBackendUnified.cpp:513
RegSingleWordScaled_RW
Definition: testLMapBackendUnified.cpp:592
RegSingleWordScaledTwice_push::convertRawToCooked
T convertRawToCooked(Traw value)
Definition: testLMapBackendUnified.cpp:612
ChimeraTK::TestCapabilities
Descriptor for the test capabilities for each register.
Definition: UnifiedBackendTest.h:54
RegChannel4_push
Test channel accessors.
Definition: testLMapBackendUnified.cpp:414
RegRedirectedBitWithMath::generateValueHook
void generateValueHook(std::vector< UserType > &)
Definition: testLMapBackendUnified.cpp:1057
RegMonostableTrigger::getRemoteValue
std::vector< std::vector< UserType > > getRemoteValue(bool=false)
Definition: testLMapBackendUnified.cpp:1091
RegArrayConstant::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:487
RegBit3OfVar::path
std::string path()
Definition: testLMapBackendUnified.cpp:511
RegBit2OfWordFirmwareB
Test bit accessor with another instance of a real dummy accessor as target.
Definition: testLMapBackendUnified.cpp:526
RegisterDescriptorBase::nRuntimeErrorCases
size_t nRuntimeErrorCases()
Definition: testLMapBackendUnified.cpp:52
RegWordFirmwareForcedReadOnly_push::minimumUserType
uint32_t minimumUserType
Definition: testLMapBackendUnified.cpp:670
RegSingleWord::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:339
RegRedirectedBitWithMath
Definition: testLMapBackendUnified.cpp:1049
RegSingleWordScaled_R
Definition: testLMapBackendUnified.cpp:567
RegWordFirmwareWithMath_R_push::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:708
RegMonostableTrigger::generateValue
std::vector< std::vector< UserType > > generateValue()
Definition: testLMapBackendUnified.cpp:1083
BitRegisterDescriptorBase::generateValue
std::vector< std::vector< UserType > > generateValue()
Definition: testLMapBackendUnified.cpp:306
RegChannelLast::minimumUserType
int32_t minimumUserType
Definition: testLMapBackendUnified.cpp:438
RegWordFirmwareWithMath_R::path
std::string path()
Definition: testLMapBackendUnified.cpp:689
RegPartOfArea::nElementsPerChannel
size_t nElementsPerChannel()
Definition: testLMapBackendUnified.cpp:389
RegisterDescriptorBase::setForceRuntimeError
void setForceRuntimeError(bool enable, size_t)
Definition: testLMapBackendUnified.cpp:54
RegFullAreaScaled::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:646
RegSingleWord_push::isWriteable
bool isWriteable()
Definition: testLMapBackendUnified.cpp:359
BitRangeAccessorTarget::path
std::string path()
Definition: testLMapBackendUnified.cpp:1138
RegPartOfArea
Test passing through partial array accessors.
Definition: testLMapBackendUnified.cpp:385
RegBitRangeDescriptor::getRemoteValue
std::vector< std::vector< UserType > > getRemoteValue()
Definition: testLMapBackendUnified.cpp:1125
RegVariableAsPushParameterInMath_not_written::getRemoteValue
std::vector< std::vector< UserType > > getRemoteValue(bool getRaw=false)
Definition: testLMapBackendUnified.cpp:835
RegVariableAsPushParameterInMathBase::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:774
RegSingleWordScaledTwice_push
Test multiply plugin applied twice (just one direction for sake of simplicity)
Definition: testLMapBackendUnified.cpp:604
OneDRegisterDescriptorBase::generateValue
std::vector< std::vector< Type > > generateValue(bool getRaw=false)
Definition: testLMapBackendUnified.cpp:124
ConstantRegisterDescriptorBase::nChannels
size_t nChannels()
Definition: testLMapBackendUnified.cpp:199
RegSingleWordScaled::path
std::string path()
Definition: testLMapBackendUnified.cpp:555
OneDRegisterDescriptorBase::getRemoteValue
std::vector< std::vector< UserType > > getRemoteValue(bool getRaw=false)
Definition: testLMapBackendUnified.cpp:143
RegSingleWord::minimumUserType
uint32_t minimumUserType
Definition: testLMapBackendUnified.cpp:338
RegPartOfArea::minimumUserType
int32_t minimumUserType
Definition: testLMapBackendUnified.cpp:392
RegSingleWordScaled_R::convertRawToCooked
T convertRawToCooked(Traw value)
Definition: testLMapBackendUnified.cpp:574
RegChannel3::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:406
RegChannel4_push::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:423
RegVariableAsPushParameterInMath_var2
Definition: testLMapBackendUnified.cpp:929
RegSingleWordScaled
Test multiply plugin - needs to be done separately for reading and writing (see below)
Definition: testLMapBackendUnified.cpp:554
BitRegisterDescriptorBase::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:299
RegWordFirmwareAsParameterInMath::isWriteable
bool isWriteable()
Definition: testLMapBackendUnified.cpp:727
RegWordFirmwareWithMath_R::convertRawToCooked
T convertRawToCooked(Traw value)
Definition: testLMapBackendUnified.cpp:693
RegChannel3::path
std::string path()
Definition: testLMapBackendUnified.cpp:399
ChimeraTK::AccessMode::wait_for_new_data
@ wait_for_new_data
Make any read blocking until new data has arrived since the last read.
RegBitRangeDescriptor::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:1115
RegVariableAsPushParameterInMath_x_not_written2
Definition: testLMapBackendUnified.cpp:1015
RegVariableAsPushParameterInMath_x::generateValueHook
void generateValueHook(std::vector< UserType > &v)
Definition: testLMapBackendUnified.cpp:971
RegWordFirmwareAsParameterInMath::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:741
RegSingleWordB
Test passing through scalar accessors - use another target.
Definition: testLMapBackendUnified.cpp:345
BitRangeAccessorTarget
Definition: testLMapBackendUnified.cpp:1137
Device.h
RegConstant::minimumUserType
int32_t minimumUserType
Definition: testLMapBackendUnified.cpp:453
RegBit0OfVar
Test bit accessor with a variable accessor as target.
Definition: testLMapBackendUnified.cpp:502
RegMonostableTrigger
Test monostable trigger plugin (rather minimal test, needs extension!)
Definition: testLMapBackendUnified.cpp:1072
RegArrayConstant::minimumUserType
float minimumUserType
Definition: testLMapBackendUnified.cpp:486
BitRegisterDescriptorBase::nRuntimeErrorCases
size_t nRuntimeErrorCases()
Definition: testLMapBackendUnified.cpp:303
ScalarRegisterDescriptorBase
Base descriptor for scalars.
Definition: testLMapBackendUnified.cpp:188
RegChannel3::nElementsPerChannel
size_t nElementsPerChannel()
Definition: testLMapBackendUnified.cpp:402
RegVariableAsPushParameterInMath_var1_not_written2
Definition: testLMapBackendUnified.cpp:899
RegWordFirmwareWithMath_R::isWriteable
bool isWriteable()
Definition: testLMapBackendUnified.cpp:690
ChannelRegisterDescriptorBase::getRemoteValue
std::vector< std::vector< UserType > > getRemoteValue()
Definition: testLMapBackendUnified.cpp:84
RegSingleWord
Test passing through scalar accessors.
Definition: testLMapBackendUnified.cpp:333
RegArrayVariable::minimumUserType
float minimumUserType
Definition: testLMapBackendUnified.cpp:497
RegArrayVariable::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:498
RegChannelLast::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:442
RegisterDescriptorBase::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:46
OneDRegisterDescriptorBase::myOffset
size_t myOffset()
Definition: testLMapBackendUnified.cpp:111
RegBitRangeDescriptor::nChannels
size_t nChannels()
Definition: testLMapBackendUnified.cpp:1112
RegFullAreaScaled::path
std::string path()
Definition: testLMapBackendUnified.cpp:627
RegWordFirmwareWithMath_R_push::isWriteable
bool isWriteable()
Definition: testLMapBackendUnified.cpp:699
ConstantRegisterDescriptorBase::generateValue
std::vector< std::vector< UserType > > generateValue()
Definition: testLMapBackendUnified.cpp:206
RegVariableAsPushParameterInMath_x_not_written2::path
std::string path()
Definition: testLMapBackendUnified.cpp:1017
RegVariableAsPushParameterInMath_x_not_written1::generateValueHook
void generateValueHook(std::vector< UserType > &v)
Definition: testLMapBackendUnified.cpp:997
RegVariableAsPushParameterInMath_var1_not_written2::path
std::string path()
Definition: testLMapBackendUnified.cpp:902
RegMonostableTrigger::isReadable
bool isReadable()
Definition: testLMapBackendUnified.cpp:1078
RegChannel4_push::path
std::string path()
Definition: testLMapBackendUnified.cpp:415
RegMonostableTrigger::path
std::string path()
Definition: testLMapBackendUnified.cpp:1073
RegMonostableTrigger::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:1102
VariableRegisterDescriptorBase::setRemoteValue
void setRemoteValue()
Definition: testLMapBackendUnified.cpp:264
VariableRegisterDescriptorBase::getRemoteValue
std::vector< std::vector< UserType > > getRemoteValue(bool=false)
Definition: testLMapBackendUnified.cpp:236
BitRegisterDescriptorBase::nChannels
size_t nChannels()
Definition: testLMapBackendUnified.cpp:295
RawToCookedProvider_x::convertRawToCooked_impl
static double convertRawToCooked_impl(double value, boost::shared_ptr< LogicalNameMappingBackend > &lmapBackend)
Definition: testLMapBackendUnified.cpp:954
RegPartOfArea::myOffset
size_t myOffset()
Definition: testLMapBackendUnified.cpp:390
RegWordFirmwareWithMath::rawUserType
uint32_t rawUserType
Definition: testLMapBackendUnified.cpp:681
RegChannelLast::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:439
BitRegisterDescriptorBase::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:301
RegBit0OfVar::target
RegVariable target
Definition: testLMapBackendUnified.cpp:505
ChimeraTK::TestCapabilities::disableForceDataLossWrite
constexpr TestCapabilities< _syncRead, TestCapability::disabled, _asyncReadInconsistency, _switchReadOnly, _switchWriteOnly, _writeNeverLosesData, _testWriteOnly, _testReadOnly, _testRawTransfer, _testCatalogue, _setRemoteValueIncrementsVersion > disableForceDataLossWrite() const
Definition: UnifiedBackendTest.h:81
RegVariable::minimumUserType
float minimumUserType
Definition: testLMapBackendUnified.cpp:475
RegSingleWord_push::isPush
bool isPush()
Definition: testLMapBackendUnified.cpp:358
RegBit2OfWordFirmwareB::target
RegSingleWordB target
Definition: testLMapBackendUnified.cpp:529
RegVariableAsPushParameterInMathBase::rawUserType
minimumUserType rawUserType
Definition: testLMapBackendUnified.cpp:782
RegVariableAsPushParameterInMath_var1_not_written1::generateValueHook
void generateValueHook(std::vector< UserType > &)
Definition: testLMapBackendUnified.cpp:885
RegVariableAsPushParameterInMath_var1
Definition: testLMapBackendUnified.cpp:796
RegFullArea::path
std::string path()
Definition: testLMapBackendUnified.cpp:374
RegRedirectedBitWithMath::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:1054
RegisterDescriptorBase::isReadable
bool isReadable()
Definition: testLMapBackendUnified.cpp:44
RegBit2OfWordFirmware_push::target
RegSingleWordB target
Definition: testLMapBackendUnified.cpp:548
OneDRegisterDescriptorBase
Base descriptor for 1D accessors (and scalars)
Definition: testLMapBackendUnified.cpp:106
RegWordFirmwareAsParameterInMath::path
std::string path()
Definition: testLMapBackendUnified.cpp:724
RegArrayVariable::nElementsPerChannel
size_t nElementsPerChannel()
Definition: testLMapBackendUnified.cpp:495
BitRegisterDescriptorBase::setForceRuntimeError
void setForceRuntimeError(bool enable, size_t caseIndex)
Definition: testLMapBackendUnified.cpp:326
RegisterDescriptorBase::isPush
bool isPush()
Definition: testLMapBackendUnified.cpp:45
RegBitRangeDescriptor::nElementsPerChannel
size_t nElementsPerChannel()
Definition: testLMapBackendUnified.cpp:1113
RegChannel3::minimumUserType
int32_t minimumUserType
Definition: testLMapBackendUnified.cpp:405
ChannelRegisterDescriptorBase::setRemoteValue
void setRemoteValue()
Definition: testLMapBackendUnified.cpp:92
ConstantRegisterDescriptorBase::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:201
OneDRegisterDescriptorBase::convertRawToCooked
T convertRawToCooked(Traw value)
Definition: testLMapBackendUnified.cpp:115
RegVariableAsPushParameterInMath_x_not_written1
Definition: testLMapBackendUnified.cpp:990
RegVariableAsPushParameterInMath_var1::generateValueHook
void generateValueHook(std::vector< UserType > &)
Definition: testLMapBackendUnified.cpp:803
RegWordFirmwareWithMath
Test math plugin - needs to be done separately for reading and writing (see below)
Definition: testLMapBackendUnified.cpp:677
RegConstant::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:454
RegChannel4_push::isPush
bool isPush()
Definition: testLMapBackendUnified.cpp:416
VariableRegisterDescriptorBase
Base descriptor for variable accessors.
Definition: testLMapBackendUnified.cpp:226
RawToCookedProvider_BitWithMath::theOffset
static constexpr double theOffset
Definition: testLMapBackendUnified.cpp:1042
RegSingleWord_push::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:368
DummyRegisterAccessor.h
RegVariableAsPushParameterInMath_var1_not_written2::generateValueHook
void generateValueHook(std::vector< UserType > &)
Definition: testLMapBackendUnified.cpp:907
VariableRegisterDescriptorBase::nChannels
size_t nChannels()
Definition: testLMapBackendUnified.cpp:230
RegVariableAsPushParameterInMathBase::setForceRuntimeError
void setForceRuntimeError(bool, size_t)
Definition: testLMapBackendUnified.cpp:771
RegVariableAsPushParameterInMath_var1_not_written1
Definition: testLMapBackendUnified.cpp:877
RegConstant::nElementsPerChannel
size_t nElementsPerChannel()
Definition: testLMapBackendUnified.cpp:450
RegFullArea::nElementsPerChannel
size_t nElementsPerChannel()
Definition: testLMapBackendUnified.cpp:377
RegVariableAsPushParameterInMath_not_written::registerValueBeforeWrite
double registerValueBeforeWrite
Definition: testLMapBackendUnified.cpp:871
OneDRegisterDescriptorBase::generateValueHook
void generateValueHook(std::vector< UserType > &)
Definition: testLMapBackendUnified.cpp:120
RegBitRangeDescriptor::generateValue
std::vector< std::vector< UserType > > generateValue()
Definition: testLMapBackendUnified.cpp:1120
RegWordFirmwareForcedReadOnly::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:658
RegisterDescriptorBase
Base descriptor with defaults, used for all registers.
Definition: testLMapBackendUnified.cpp:30
RegFullAreaScaled
Test multiply plugin applied to array (just one direction for sake of simplicity)
Definition: testLMapBackendUnified.cpp:626
RegSingleWordScaledTwice_push::rawUserType
minimumUserType rawUserType
Definition: testLMapBackendUnified.cpp:617
RegWordFirmwareWithMath::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:684
ChannelRegisterDescriptorBase::nChannels
size_t nChannels()
Definition: testLMapBackendUnified.cpp:71
BitRegisterDescriptorBase
Definition: testLMapBackendUnified.cpp:291
RegFullAreaScaled::isWriteable
bool isWriteable()
Definition: testLMapBackendUnified.cpp:628
RegConstant
Test constant accessor.
Definition: testLMapBackendUnified.cpp:447
RegBitRangeDescriptor
Definition: testLMapBackendUnified.cpp:1108
RegWordFirmwareWithMath_R_push::convertRawToCooked
T convertRawToCooked(Traw value)
Definition: testLMapBackendUnified.cpp:704
RegSingleWord_push::path
std::string path()
Definition: testLMapBackendUnified.cpp:357
ConstantRegisterDescriptorBase::getRemoteValue
std::vector< std::vector< UserType > > getRemoteValue()
Definition: testLMapBackendUnified.cpp:211
RegVariableAsPushParameterInMath_not_written::generateValue
std::vector< std::vector< UserType > > generateValue(bool=false)
Definition: testLMapBackendUnified.cpp:824
RegChannelLast
Test channel accessors.
Definition: testLMapBackendUnified.cpp:431
RegMonostableTrigger::rawUserType
minimumUserType rawUserType
Definition: testLMapBackendUnified.cpp:1097
RegWordFirmwareWithMath_R_push::path
std::string path()
Definition: testLMapBackendUnified.cpp:701
RegWordFirmwareForcedReadOnly::isWriteable
bool isWriteable()
Definition: testLMapBackendUnified.cpp:655
ChimeraTK::DummyBackend
The dummy device opens a mapping file instead of a device, and implements all registers defined in th...
Definition: DummyBackend.h:45
RegWordFirmwareForcedReadOnly::path
std::string path()
Definition: testLMapBackendUnified.cpp:652
ChimeraTK::AccessModeFlags
Set of AccessMode flags with additional functionality for an easier handling.
Definition: AccessMode.h:48
RegFullAreaScaled::convertRawToCooked
T convertRawToCooked(Traw value)
Definition: testLMapBackendUnified.cpp:639
RegWordFirmwareWithMath_R
Definition: testLMapBackendUnified.cpp:688
RegSingleWordB::minimumUserType
uint32_t minimumUserType
Definition: testLMapBackendUnified.cpp:350
RegChannelLast::nElementsPerChannel
size_t nElementsPerChannel()
Definition: testLMapBackendUnified.cpp:435
RegSingleWordScaled::rawUserType
uint32_t rawUserType
Definition: testLMapBackendUnified.cpp:560
RegFullAreaScaled::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:644
RegChannelLast::path
std::string path()
Definition: testLMapBackendUnified.cpp:432
VariableRegisterDescriptorBase::setForceRuntimeError
void setForceRuntimeError(bool, size_t)
Definition: testLMapBackendUnified.cpp:286
RegSingleWordScaled_W
Definition: testLMapBackendUnified.cpp:579
RegVariableAsPushParameterInMath_var2::path
std::string path()
Definition: testLMapBackendUnified.cpp:931
RegSingleWord_push
Test passing through push-type scalar accessors.
Definition: testLMapBackendUnified.cpp:356
RegSingleWordScaledTwice_push::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:621
RegVariableAsPushParameterInMath_var1::path
std::string path()
Definition: testLMapBackendUnified.cpp:798
BitRegisterDescriptorBase::setRemoteValue
void setRemoteValue()
Definition: testLMapBackendUnified.cpp:318
RegWordFirmwareForcedReadOnly
Test force readonly plugin.
Definition: testLMapBackendUnified.cpp:651
RegChannel4_push::minimumUserType
int32_t minimumUserType
Definition: testLMapBackendUnified.cpp:422
VariableRegisterDescriptorBase::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:231
ChimeraTK::DummyBackendBase::throwExceptionRead
std::atomic< bool > throwExceptionRead
Definition: DummyBackendBase.h:77
RegSingleWordScaled_RW::path
std::string path()
Definition: testLMapBackendUnified.cpp:593
RegChannel3::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:409
ChimeraTK
Definition: DummyBackend.h:16
RegWordFirmwareAsParameterInMath
Test math plugin with real dummy register as parameter (exception handling...)
Definition: testLMapBackendUnified.cpp:723
RegSingleWordScaledTwice_push::minimumUserType
double minimumUserType
Definition: testLMapBackendUnified.cpp:616
UnifiedBackendTest.h
RegBit2OfWordFirmware_push::path
std::string path()
Definition: testLMapBackendUnified.cpp:539
RegWordFirmwareForcedReadOnly_push::isPush
bool isPush()
Definition: testLMapBackendUnified.cpp:665
RegSingleWord::path
std::string path()
Definition: testLMapBackendUnified.cpp:334
ChimeraTK::Boolean
Wrapper Class to avoid vector<bool> problems.
Definition: SupportedUserTypes.h:21
RegArrayConstant::path
std::string path()
Definition: testLMapBackendUnified.cpp:481
RegVariableAsPushParameterInMath_var1_not_written1::path
std::string path()
Definition: testLMapBackendUnified.cpp:880
RegSingleWordScaledTwice_push::path
std::string path()
Definition: testLMapBackendUnified.cpp:605
RegWordFirmwareWithMath_W
Definition: testLMapBackendUnified.cpp:711
RegisterDescriptorBase::isWriteable
bool isWriteable()
Definition: testLMapBackendUnified.cpp:43
RegSingleWordScaled::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:563
RegisterDescriptorBase::writeQueueLength
size_t writeQueueLength()
Definition: testLMapBackendUnified.cpp:51
RegSingleWordScaled_W::convertRawToCooked
T convertRawToCooked(Traw value)
Definition: testLMapBackendUnified.cpp:587
RegWordFirmwareForcedReadOnly::minimumUserType
uint32_t minimumUserType
Definition: testLMapBackendUnified.cpp:657
ConstantRegisterDescriptorBase::nRuntimeErrorCases
size_t nRuntimeErrorCases()
Definition: testLMapBackendUnified.cpp:203
RawToCookedProvider_x
Definition: testLMapBackendUnified.cpp:953
RegConstant2::path
std::string path()
Definition: testLMapBackendUnified.cpp:459
RegWordFirmwareWithMath_W::isReadable
bool isReadable()
Definition: testLMapBackendUnified.cpp:713
RegVariableAsPushParameterInMath_not_written
Definition: testLMapBackendUnified.cpp:821
RegBitRangeDescriptor::nRuntimeErrorCases
size_t nRuntimeErrorCases()
Definition: testLMapBackendUnified.cpp:1117
RegFullArea::minimumUserType
int32_t minimumUserType
Definition: testLMapBackendUnified.cpp:379
RegPartOfArea::path
std::string path()
Definition: testLMapBackendUnified.cpp:386
RawToCookedProvider_Var1
Definition: testLMapBackendUnified.cpp:788
RegBit2OfWordFirmware
Test bit accessor with a real dummy accessor as target.
Definition: testLMapBackendUnified.cpp:518
RegSingleWordB::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:351
RegChannel4_push::supportedFlags
ChimeraTK::AccessModeFlags supportedFlags()
Definition: testLMapBackendUnified.cpp:426
RegWordFirmwareForcedReadOnly_push::rawUserType
int32_t rawUserType
Definition: testLMapBackendUnified.cpp:671
RegVariable
Test variable accessor.
Definition: testLMapBackendUnified.cpp:469