CbmRoot
Loading...
Searching...
No Matches
compareMuchDigi.h
Go to the documentation of this file.
1/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer] */
4
5#ifndef COMPAREMUCHDIGI_H
6#define COMPAREMUCHDIGI_H 1
7
8#include "gtest/gtest.h"
9
10void compareMuchDigiDataMembers(CbmMuchDigi& test, int32_t address, ECbmModuleId systemid, uint64_t time,
11 int32_t charge)
12{
13 int32_t retValInt {-222};
14 double retValDouble {-222.};
16
17 retValInt = test.GetAddress();
18 EXPECT_EQ(address, retValInt);
19
20 retVal = test.GetSystem();
21 EXPECT_EQ(systemid, retVal);
22
23 retValDouble = test.GetTime();
24 EXPECT_FLOAT_EQ(static_cast<double>(time), retValDouble);
25
26 retValDouble = test.GetCharge();
27 EXPECT_EQ(static_cast<double>(charge), retValDouble);
28
29 retValInt = test.GetAdc();
30 EXPECT_EQ(charge, retValInt);
31}
32
33#endif // COMPAREMUCHDIGI_H
ECbmModuleId
Definition CbmDefs.h:39
@ kNotExist
If not found.
double GetCharge() const
Charge.
Definition CbmMuchDigi.h:69
uint16_t GetAdc() const
Definition CbmMuchDigi.h:90
int32_t GetAddress() const
Definition CbmMuchDigi.h:93
double GetTime() const
Definition CbmMuchDigi.h:94
static ECbmModuleId GetSystem()
Definition CbmMuchDigi.h:75
void compareMuchDigiDataMembers(CbmMuchDigi &test, int32_t address, ECbmModuleId systemid, uint64_t time, int32_t charge)