3 #include "gtest/gtest-spi.h"
4 #include "gtest/gtest.h"
8 TEST(_GTestCbmTrdPoint, CheckDefaultConstructor) {
39 TEST(_GTestCbmTrdPoint, CheckStandardConstructor) {
42 TVector3 posin {-2.1, 6.1, 23.};
43 TVector3 momin {2.5, 4.5, 78.};
44 TVector3 posout {2.1, -6.1, -23.};
45 TVector3 momout {-2.5, -4.5, -78.};
47 Double_t length {1.2};
48 Double_t eloss {0.4567};
52 trackid, detid, posin, momin, posout, momout, tof, length, eloss);
67 trackid, detid, posin, momin, posout, momout, tof, length, eloss);
82 TEST(_GTestCbmTrdPoint, CheckCopyConstructor) {
85 TVector3 posin {-2.1, 6.1, 23.};
86 TVector3 momin {2.5, 4.5, 78.};
87 TVector3 posout {2.1, -6.1, -23.};
88 TVector3 momout {-2.5, -4.5, -78.};
90 Double_t length {1.2};
91 Double_t eloss {0.4567};
95 trackid, detid, posin, momin, posout, momout, tof, length, eloss);
140 TEST(_GTestCbmTrdPoint, CheckCopyAssignmentOperator) {
143 TVector3 posin {-2.1, 6.1, 23.};
144 TVector3 momin {2.5, 4.5, 78.};
145 TVector3 posout {2.1, -6.1, -23.};
146 TVector3 momout {-2.5, -4.5, -78.};
147 Double_t tof {34.56};
148 Double_t length {1.2};
149 Double_t eloss {0.4567};
153 trackid, detid, posin, momin, posout, momout, tof, length, eloss);
199 TEST(_GTestCbmTrdPoint, CheckMoveConstructor) {
202 TVector3 posin {-2.1, 6.1, 23.};
203 TVector3 momin {2.5, 4.5, 78.};
204 TVector3 posout {2.1, -6.1, -23.};
205 TVector3 momout {-2.5, -4.5, -78.};
206 Double_t tof {34.56};
207 Double_t length {1.2};
208 Double_t eloss {0.4567};
212 trackid, detid, posin, momin, posout, momout, tof, length, eloss);
258 TEST(_GTestCbmTrdPoint, CheckAssignmentOperator) {
261 TVector3 posin {-2.1, 6.1, 23.};
262 TVector3 momin {2.5, 4.5, 78.};
263 TVector3 posout {2.1, -6.1, -23.};
264 TVector3 momout {-2.5, -4.5, -78.};
265 Double_t tof {34.56};
266 Double_t length {1.2};
267 Double_t eloss {0.4567};
271 trackid, detid, posin, momin, posout, momout, tof, length, eloss);
289 test2 = std::move(test);
318 TEST(_GTestCbmTrdPoint, CheckPrint) {
321 TVector3 posin {-2.1, 6.1, 23.};
322 TVector3 momin {2.5, 4.5, 78.};
323 TVector3 posout {2.1, -6.1, -23.};
324 TVector3 momout {-2.5, -4.5, -78.};
325 Double_t tof {34.56};
326 Double_t length {1.2};
327 Double_t eloss {0.4567};
331 trackid, detid, posin, momin, posout, momout, tof, length, eloss);
345 testing::internal::CaptureStdout();
347 std::string output = testing::internal::GetCapturedStdout();
349 EXPECT_STREQ(
"[INFO] TRD point for track 34 in detector 45\n[INFO] "
350 "Position In (-2.1, 6.1, 23) cm\n[INFO] Momentum In (2.5, "
351 "4.5, 78) GeV\n[INFO] Position Out (2.1, -6.1, -23) "
352 "cm\n[INFO] Momentum Out (-2.5, -4.5, -78) GeV\n[INFO] "
353 "Time 34.56 ns, Length 1.2 cm, Energy loss 456700 keV\n",
358 TEST(_GTestCbmTrdPoint, CheckPositionOut) {
361 TVector3 posin {-2.1, 6.1, 23.};
362 TVector3 momin {2.5, 4.5, 78.};
363 TVector3 posout {2.1, -6.1, -23.};
364 TVector3 momout {-2.5, -4.5, -78.};
365 Double_t tof {34.56};
366 Double_t length {1.2};
367 Double_t eloss {0.4567};
371 trackid, detid, posin, momin, posout, momout, tof, length, eloss);
386 TVector3 testVect {0., 0., 0.};
390 EXPECT_FLOAT_EQ(posout.X(), testVect.X());
391 EXPECT_FLOAT_EQ(posout.Y(), testVect.Y());
392 EXPECT_FLOAT_EQ(posout.Z(), testVect.Z());
395 TEST(_GTestCbmTrdPoint, CheckMomentumOut) {
398 TVector3 posin {-2.1, 6.1, 23.};
399 TVector3 momin {2.5, 4.5, 78.};
400 TVector3 posout {2.1, -6.1, -23.};
401 TVector3 momout {-2.5, -4.5, -78.};
402 Double_t tof {34.56};
403 Double_t length {1.2};
404 Double_t eloss {0.4567};
408 trackid, detid, posin, momin, posout, momout, tof, length, eloss);
423 TVector3 testVect {0., 0., 0.};
427 EXPECT_FLOAT_EQ(momout.X(), testVect.X());
428 EXPECT_FLOAT_EQ(momout.Y(), testVect.Y());
429 EXPECT_FLOAT_EQ(momout.Z(), testVect.Z());