CbmRoot
Loading...
Searching...
No Matches
_GTestCbmTrdFexMessageSpadic.cxx
Go to the documentation of this file.
1/* Copyright (C) 2026 Goethe-University Frankfurt, Frankfurt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: David Schledt [committer] */
4
7#include "gtest/gtest-spi.h"
8#include "gtest/gtest.h"
9
10#include <cstdint>
11
12TEST(_GTestCbmTrdFexMessageSpadic, CheckSysVersion0x10)
13{
14 uint8_t elink = 42 & Spadic::FexWord<0x10>::m_el;
15 uint8_t channel = 4 & Spadic::FexWord<0x10>::m_ch;
16 uint64_t timestamp = 424242 & Spadic::FexWord<0x10>::m_ts;
17 uint8_t prec_time_fixed_point = 7 & Spadic::FexWord<0x10>::m_pt; // 0.4375
18 float prec_time_float = (float) prec_time_fixed_point / float(1 << 4);
19 uint16_t maxAdc = 42 & Spadic::FexWord<0x10>::m_mA;
20 uint16_t timesample = 424 & Spadic::FexWord<0x10>::m_tsample;
21 uint8_t iMA = 2 & Spadic::FexWord<0x10>::m_iMA;
22 uint8_t ht = 1 & Spadic::FexWord<0x10>::m_ht;
23 uint8_t mh = 0 & Spadic::FexWord<0x10>::m_mh;
24
25
26 // Create a temporary FexWord to use the helper functions within the struct to create a FexWord using the
27 // constructor which we want to test
28 Spadic::FexWord<0x10> temp(elink, channel, timestamp, prec_time_fixed_point, maxAdc, timesample, iMA, ht, mh);
30 Spadic::FexWord<0x10> test(nbc);
31
32 compareTrdFexMessageSpadic0x10DataMembers(test, elink, channel, timestamp, prec_time_float, maxAdc, timesample, iMA,
33 ht, mh);
34}
TEST(_GTestCbmTrdFexMessageSpadic, CheckSysVersion0x10)
void compareTrdFexMessageSpadic0x10DataMembers(Spadic::FexWord< 0x10 > &test, uint8_t elink, uint8_t channel, uint64_t timestamp, float prec_time, uint16_t maxAdc, uint16_t timesample, uint8_t iMA, uint8_t ht, uint8_t mh)