16#define BOOST_TEST_MODULE Test TPC SyncPatternMonitor
17#define BOOST_TEST_MAIN
18#define BOOST_TEST_DYN_LINK
19#include <boost/test/unit_test.hpp>
51 std::vector<short> SYNC_PATTERN{
65#pragma GCC diagnostic push
66#pragma GCC diagnostic ignored "-Wstringop-overflow"
67 test1_vec.insert(test1_vec.begin() + 4 + 2 +
pos, SYNC_PATTERN.begin(), SYNC_PATTERN.end());
68#pragma GCC diagnostic pop
71 for (
int i = 0;
i < test1_vec.size() - 4;
i += 4) {
72 if (
res.position -
i <= 4) {
73 mon.
addSequence(test1_vec[
i], test1_vec[
i + 1], test1_vec[
i + 2], test1_vec[
i + 3]);
76 mon.
addSequence(test1_vec[
i], test1_vec[
i + 1], test1_vec[
i + 2], test1_vec[
i + 3]);
88 std::vector<short> SYNC_PATTERN{
101#pragma GCC diagnostic push
102#pragma GCC diagnostic ignored "-Wstringop-overflow"
103 test1_vec.insert(test1_vec.begin() + 4 + 2 +
pos, SYNC_PATTERN.begin(), SYNC_PATTERN.end());
104#pragma GCC diagnostic pop
108 for (
int v = 4 + 2 +
pos;
v < 4 + 2 +
pos + SYNC_PATTERN.size(); ++
v) {
109 short old_Value = test1_vec[
v];
113 for (
int i = 0;
i < test1_vec.size() - 4;
i += 4) {
114 mon.
addSequence(test1_vec[
i], test1_vec[
i + 1], test1_vec[
i + 2], test1_vec[
i + 3]);
117 test1_vec[
v] = old_Value;
Class to monitor the data stream and detect synchronization patterns.
Class to monitor the data stream and detect synchronization patterns.
short addSequence(const short hw0, const short hw1, const short hw2, const short hw3)
short getPatternB() const
short getPatternA() const
void reset()
Reset function to clear history.
short getSyncStart() const
BOOST_AUTO_TEST_CASE(ClusterHardware_test1)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
BOOST_CHECK_EQUAL(triggersD.size(), triggers.size())