Belle II Software  release-05-01-25
SVDModeByte.cc
1 #include <svd/dataobjects/SVDModeByte.h>
2 #include <gtest/gtest.h>
3 #include <string>
4 #include <cstdint>
5 
6 using namespace std;
7 
8 namespace Belle2 {
13  namespace SVD {
14 
16  TEST(SVDModeByte, Constructor)
17  {
18  // Default construct
19  SVDModeByte s0;
20  SVDModeByte s_def(151);
21  SVDModeByte s_en(SVDRunType::zero_suppressed, SVDEventType::global_run,
22  SVDDAQModeType::daq_6samples, uint8_t(7));
23  SVDModeByte s_num(2, 0, 2, 7);
24 
25  EXPECT_EQ(s0, s_def);
26  EXPECT_EQ(s_def, s_en);
27  EXPECT_EQ(s_en, s_num);
28  // Empty
29  EXPECT_EQ(uint8_t(151), s0.getID());
30  EXPECT_EQ((string)s0, "0-suppr/global/6 samples/???");
31  // Malformed
32  s0.setTriggerBin(3);
33  EXPECT_EQ((string)s0, "0-suppr/global/6 samples/3");
34  s0.setDAQMode(1);
35  EXPECT_EQ((string)s0, "0-suppr/global/3 samples/3");
36  }
37 
39  TEST(SVDModeByte, getters)
40  {
41  // Construct
42  SVDModeByte s(3, 1, 1, 3);
43  EXPECT_EQ(s.getTriggerBin(), 3);
44  EXPECT_EQ(s.getDAQMode(), SVDDAQModeType::daq_3samples);
45  EXPECT_EQ(s.getEventType(), SVDEventType::local_run);
46  EXPECT_EQ(s.getRunType(), SVDRunType::zero_suppressed_timefit);
47  // Default
48  SVDModeByte s0;
49  EXPECT_EQ(s0.getTriggerBin(), 7);
50  EXPECT_EQ(s0.getDAQMode(), SVDDAQModeType::daq_6samples);
51  }
52  }
54 } // Belle2::SVD namespace
Belle2::SVDModeByte::getTriggerBin
baseType getTriggerBin() const
Get the triggerBin id.
Definition: SVDModeByte.h:150
Belle2::SVDModeByte::getID
baseType getID() const
Get the unique id.
Definition: SVDModeByte.h:148
Belle2::SVDModeByte
Class to store SVD mode information.
Definition: SVDModeByte.h:79
Belle2::SVDModeByte::getDAQMode
baseType getDAQMode() const
Get the daqMode id.
Definition: SVDModeByte.h:152
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TEST
TEST(TestgetDetectorRegion, TestgetDetectorRegion)
Test Constructors.
Definition: utilityFunctions.cc:18