CbmRoot
_GTestCbmAddress.cxx
Go to the documentation of this file.
1 #include "CbmAddress.h"
2 #include "CbmDefs.h"
3 
4 #include "gtest/gtest-spi.h"
5 #include "gtest/gtest.h"
6 
7 TEST(_GTestCbmAddress, CheckDefaultConstructor) {
8  {
9  SCOPED_TRACE("CheckDefaultConstructor");
10  CbmAddress test;
11  CbmAddress* test1 = new CbmAddress();
12  delete test1;
13  }
14 }
15 
16 TEST(_GTestCbmAddress, CheckGetNofSystemBits) {
17  SCOPED_TRACE("CheckGetNofSystemBits");
18  CbmAddress test;
19  EXPECT_EQ(4, test.GetNofSystemBits());
20 }
21 
22 TEST(_GTestCbmAddress, CheckGetSytemId) {
23  SCOPED_TRACE("CheckGetNofSystemBits");
24  CbmAddress test;
25 
26  UInt_t testID {ToIntegralType(ECbmModuleId::kSts)};
27  EXPECT_EQ(ToIntegralType(ECbmModuleId::kSts), test.GetSystemId(testID));
28 
30  EXPECT_EQ(ToIntegralType(ECbmModuleId::kTrd), test.GetSystemId(testID));
31 
33  EXPECT_EQ(ToIntegralType(ECbmModuleId::kTof), test.GetSystemId(testID));
34 }
ECbmModuleId::kTof
@ kTof
Time-of-flight Detector.
CbmAddress
Base class for interfaces to the unique address.
Definition: CbmAddress.h:23
ECbmModuleId::kTrd
@ kTrd
Transition Radiation Detector.
CbmAddress.h
ToIntegralType
constexpr auto ToIntegralType(T enumerator) -> typename std::underlying_type< T >::type
Definition: CbmDefs.h:24
CbmAddress::GetNofSystemBits
static Int_t GetNofSystemBits()
Definition: CbmAddress.h:36
TEST
TEST(_GTestCbmAddress, CheckDefaultConstructor)
Definition: _GTestCbmAddress.cxx:7
ECbmModuleId::kSts
@ kSts
Silicon Tracking System.
CbmAddress::GetSystemId
static Int_t GetSystemId(UInt_t address)
Definition: CbmAddress.h:43
CbmDefs.h