CbmRoot
Loading...
Searching...
No Matches
_GTestCbmAddress.cxx
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#include "CbmAddress.h"
6#include "CbmDefs.h"
7
8#include "gtest/gtest-spi.h"
9#include "gtest/gtest.h"
10
11TEST(_GTestCbmAddress, CheckDefaultConstructor)
12{
13 {
14 SCOPED_TRACE("CheckDefaultConstructor");
15 CbmAddress test;
16 CbmAddress* test1 = new CbmAddress();
17 delete test1;
18 }
19}
20
21TEST(_GTestCbmAddress, CheckGetNofSystemBits)
22{
23 SCOPED_TRACE("CheckGetNofSystemBits");
24 CbmAddress test;
25 EXPECT_EQ(4, test.GetNofSystemBits());
26}
27
28TEST(_GTestCbmAddress, CheckGetSytemId)
29{
30 SCOPED_TRACE("CheckGetNofSystemBits");
31 CbmAddress test;
32
33 uint32_t testID {ToIntegralType(ECbmModuleId::kSts)};
34 EXPECT_EQ(ToIntegralType(ECbmModuleId::kSts), test.GetSystemId(testID));
35
37 EXPECT_EQ(ToIntegralType(ECbmModuleId::kTrd), test.GetSystemId(testID));
38
40 EXPECT_EQ(ToIntegralType(ECbmModuleId::kTof), test.GetSystemId(testID));
41}
XPU_D constexpr auto ToIntegralType(T enumerator) -> typename std::underlying_type< T >::type
Definition CbmDefs.h:29
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kSts
Silicon Tracking System.
TEST(_GTestCbmAddress, CheckDefaultConstructor)
Base class for interfaces to the unique address.
Definition CbmAddress.h:27
static int32_t GetNofSystemBits()
Definition CbmAddress.h:40
static int32_t GetSystemId(uint32_t address)
Definition CbmAddress.h:47