CbmRoot
Loading...
Searching...
No Matches
comparePsdAddress.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 COMPAREPSDDIGI_H
6#define COMPAREPSDDIGI_H 1
7
8#include "gtest/gtest.h"
9
10void comparePsdAddressDataMembers(int32_t address, ECbmModuleId systemid, int32_t moduleid, int32_t sectionid)
11{
12 int32_t retValInt {-222};
13
14 retValInt = CbmPsdAddress::GetSystemId(address);
15 EXPECT_EQ(ToIntegralType(systemid), retValInt);
16
17 retValInt = CbmPsdAddress::GetModuleId(address);
18 EXPECT_EQ(moduleid, retValInt);
19
20 retValInt = CbmPsdAddress::GetSectionId(address);
21 EXPECT_EQ(sectionid, retValInt);
22}
23
24#endif // COMPAREPSDDIGI_H
XPU_D constexpr auto ToIntegralType(T enumerator) -> typename std::underlying_type< T >::type
Definition CbmDefs.h:29
ECbmModuleId
Definition CbmDefs.h:39
static uint32_t GetSystemId(uint32_t address)
Return System identifier from address.
static uint32_t GetSectionId(uint32_t address)
Return sector ID from address.
static uint32_t GetModuleId(uint32_t address)
Return module ID from address.
void comparePsdAddressDataMembers(int32_t address, ECbmModuleId systemid, int32_t moduleid, int32_t sectionid)