5 #include "gtest/gtest-spi.h"
6 #include "gtest/gtest.h"
12 TEST(_GTestCbmCluster, CheckDefaultConstructor) {
14 std::vector<Int_t> testvector;
16 SCOPED_TRACE(
"CheckDefaultConstructor");
21 TEST(_GTestCbmCluster, CheckStandardConstructor) {
22 std::vector<Int_t> testvector {1, 2, 3, 4, 5};
25 SCOPED_TRACE(
"CheckStandardConstructor");
30 TEST(_GTestCbmCluster, CheckSetDigis) {
31 std::vector<Int_t> testvector {1, 2, 3, 4, 5};
34 SCOPED_TRACE(
"CheckSetDigis: InitialTest");
38 std::vector<Int_t> testvector1 {11, 21, 31, 41, 51, 61};
39 test.SetDigis(testvector1);
41 SCOPED_TRACE(
"CheckSetDigis: SetDigis");
46 TEST(_GTestCbmCluster, CheckAddDigi) {
47 std::vector<Int_t> testvector {1, 2, 3, 4, 5};
48 std::vector<Int_t> testvector1 {1, 2, 3, 4, 5, 111};
49 std::vector<Int_t> testvector2 {1, 2, 3, 4, 5, 111, 222};
53 SCOPED_TRACE(
"CheckAddDigi: InitialTest");
55 test, testvector.size(), testvector, -11,
nullptr);
60 SCOPED_TRACE(
"CheckAddDigis: AddDigi 1");
62 test, testvector.size() + 1, testvector1, -11,
nullptr);
67 SCOPED_TRACE(
"CheckAddDigis: AddDigi 2");
69 test, testvector.size() + 2, testvector2, -11,
nullptr);
73 TEST(_GTestCbmCluster, CheckAddDigis) {
74 std::vector<Int_t> testvector {1, 2, 3, 4, 5};
75 std::vector<Int_t> testvector1 {11, 21, 31, 41, 51, 61};
76 std::vector<Int_t> testvector2 {1, 2, 3, 4, 5, 11, 21, 31, 41, 51, 61};
80 SCOPED_TRACE(
"CheckAddDigis: InitialTest");
82 test, testvector.size(), testvector, -11,
nullptr);
85 test.AddDigis(testvector1);
87 SCOPED_TRACE(
"CheckAddDigis: AddDigis");
89 test, testvector2.size(), testvector2, -11,
nullptr);
93 TEST(_GTestCbmCluster, CheckClearDigis) {
94 std::vector<Int_t> testvector {1, 2, 3, 4, 5};
95 std::vector<Int_t> testvector1;
99 SCOPED_TRACE(
"CheckClearDigis: InitialTest");
101 test, testvector.size(), testvector, -11,
nullptr);
106 SCOPED_TRACE(
"CheckClearDigis: AddDigis");
111 TEST(_GTestCbmCluster, CheckSetters) {
112 std::vector<Int_t> testvector {1, 2, 3, 4, 5};
116 SCOPED_TRACE(
"CheckSetters: InitialTest");
118 test, testvector.size(), testvector, -11,
nullptr);
121 test.SetAddress(-111);
123 SCOPED_TRACE(
"CheckSetters: SetAddress");
125 test, testvector.size(), testvector, -111,
nullptr);
129 test.SetMatch(&testMatch);
131 SCOPED_TRACE(
"CheckSetters: SetAddress");
133 test, testvector.size(), testvector, -111, &testMatch);
137 TEST(_GTestCbmCluster, CheckToString) {
138 std::vector<Int_t> testvector {1, 2, 3, 4, 5};
141 EXPECT_STREQ(
"CbmCluster: nofDigis=5 | 1 2 3 4 5 | address=-11\n",
142 test.ToString().c_str());