4 #include "gtest/gtest-spi.h"
5 #include "gtest/gtest.h"
10 TEST(_GTestCbmMatch, CheckDefaultConstructor) {
13 SCOPED_TRACE(
"CheckDefaultConstructor");
18 TEST(_GTestCbmMatch, AddLink1) {
21 SCOPED_TRACE(
"AddLink1: Initial Test");
27 SCOPED_TRACE(
"AddLink1: Add first link");
33 SCOPED_TRACE(
"AddLink1: Add second link");
39 SCOPED_TRACE(
"AddLink1: Add third link");
44 TEST(_GTestCbmMatch, AddLink2) {
48 SCOPED_TRACE(
"AddLink2: Initial Test");
54 SCOPED_TRACE(
"AddLink2: Add first link");
60 SCOPED_TRACE(
"AddLink2: Add second link");
66 SCOPED_TRACE(
"AddLink2: Add third link");
72 SCOPED_TRACE(
"AddLink2: Add forth link");
78 SCOPED_TRACE(
"AddLink2: Add fifth link");
88 CbmLink testLink3 {-8., -3, -2, -2};
89 CbmLink testLink4 {8., -3, -3, -2};
90 CbmLink testLink5 {2., -3, -3, -3};
93 SCOPED_TRACE(
"AddLink3: Initial Test");
99 SCOPED_TRACE(
"AddLink3: Add first link");
105 SCOPED_TRACE(
"AddLink3: Add second link");
111 SCOPED_TRACE(
"AddLink3: Add third link");
117 SCOPED_TRACE(
"AddLink3: Add forth link");
123 SCOPED_TRACE(
"AddLink3: Add fifth link");
130 TEST(_GTestCbmMatch, AddLink3) {
137 SCOPED_TRACE(
"AddLink3: Add fifth link");
142 TEST(_GTestCbmMatch, ClearLink) {
146 SCOPED_TRACE(
"ClearLink: Initial Test");
152 SCOPED_TRACE(
"ClearLink: Clear Link");
158 TEST(_GTestCbmMatch, GetLink) {
162 SCOPED_TRACE(
"GetLink: Initial Test");
169 SCOPED_TRACE(
"GetLink: Get Link 0");
175 SCOPED_TRACE(
"GetLink: Get Link 1");
181 SCOPED_TRACE(
"GetLink: Get Link 2");
187 SCOPED_TRACE(
"GetLink: Get Link 3");
192 TEST(_GTestCbmMatch, GetLinks) {
196 SCOPED_TRACE(
"GetLinks: Initial Test");
200 std::vector<CbmLink> link = test.
GetLinks();
204 SCOPED_TRACE(
"GetLinks: Get Link 0");
210 SCOPED_TRACE(
"GetLinks: Get Link 1");
216 SCOPED_TRACE(
"GetLinks: Get Link 2");
222 SCOPED_TRACE(
"GetLinks: Get Link 3");
227 TEST(_GTestCbmMatch, GetMatchedLink) {
231 SCOPED_TRACE(
"GetMatchedLink: Initial Test");
239 SCOPED_TRACE(
"GetMatchedLink: Test Links");
245 TEST(_GTestCbmMatch, CheckToString) {
249 EXPECT_STREQ(
"CbmMatch: nofLinks=0\n totalWeight=0, matchedIndex=-1\n",
252 CbmLink testLink {-8., -3, -2, -2};
255 EXPECT_STREQ(
"CbmMatch: nofLinks=1\nCbmLink: weight=-8 index=-3 entry=-2 "
256 "file=-2\n totalWeight=-8, matchedIndex=0\n",