CbmRoot
Loading...
Searching...
No Matches
_GTestCbmPsdAddress.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 "CbmPsdAddress.h"
6
7#include "comparePsdAddress.h"
8#include "gtest/gtest-spi.h"
9#include "gtest/gtest.h"
10
11TEST(_GTestCbmPsdAddress, CheckAddress)
12{
13 int32_t moduleid {1};
14 int32_t sectionid {0};
15 int32_t address {24};
16
17 comparePsdAddressDataMembers(address, ECbmModuleId::kPsd, moduleid, sectionid);
18
19 moduleid = 0;
20 sectionid = 1;
21 address = 1032;
22
23 comparePsdAddressDataMembers(address, ECbmModuleId::kPsd, moduleid, sectionid);
24
25 moduleid = 5;
26 sectionid = 5;
27 address = 5208;
28
29 comparePsdAddressDataMembers(address, ECbmModuleId::kPsd, moduleid, sectionid);
30}
31
32TEST(_GTestCbmPsdAddress, CheckSetModuleId)
33{
34 int32_t moduleid {1};
35 int32_t sectionid {0};
36 int32_t address {24};
37
38 comparePsdAddressDataMembers(address, ECbmModuleId::kPsd, moduleid, sectionid);
39
40 EXPECT_EQ(88, CbmPsdAddress::SetModuleId(24, 5));
41}
42
43TEST(_GTestCbmPsdAddress, CheckSetSectionId)
44{
45 int32_t moduleid {1};
46 int32_t sectionid {0};
47 int32_t address {24};
48
49 comparePsdAddressDataMembers(address, ECbmModuleId::kPsd, moduleid, sectionid);
50
51 EXPECT_EQ(5144, CbmPsdAddress::SetSectionId(24, 5));
52}
@ kPsd
Projectile spectator detector.
TEST(_GTestCbmPsdAddress, CheckAddress)
static uint32_t SetModuleId(uint32_t address, int32_t newModuleId)
Set new module ID for address.
static uint32_t SetSectionId(uint32_t address, int32_t newSectionId)
Set new section ID for address.
void comparePsdAddressDataMembers(int32_t address, ECbmModuleId systemid, int32_t moduleid, int32_t sectionid)