MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / TEST_F

Function TEST_F

lib/mdflib/mdflib_test/src/testwrite3.cpp:74–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74TEST_F(TestWrite3, Mdf3WriteHD) {
75 if (kSkipTest) {
76 GTEST_SKIP();
77 }
78 path mdf_file(kTestDir);
79 mdf_file.append("hd3.mf3");
80
81 auto writer = MdfFactory::CreateMdfWriter(MdfWriterType::Mdf3Basic);
82
83 writer->Init(mdf_file.string());
84
85 auto* header = writer->Header();
86 ASSERT_TRUE(header != nullptr);
87 header->Author("Ingemar Hedvall");
88 header->Department("Home Alone");
89 header->Description("Testing Header");
90 header->Project("Mdf3WriteHD");
91 header->StartTime(MdfHelper::NowNs());
92 header->Subject("PXY");
93
94 for (size_t dg_index = 0; dg_index < 2; ++dg_index) {
95 auto* dg3 = writer->CreateDataGroup();
96 ASSERT_TRUE(dg3 != nullptr);
97 dg3->Description("First Measurement");
98 for (size_t cg_index = 0; cg_index < 2; ++cg_index) {
99 auto* cg3 = mdf::MdfWriter::CreateChannelGroup(dg3);
100 ASSERT_TRUE(cg3 != nullptr);
101 cg3->Description("CG description");
102 for (size_t cn_index = 0; cn_index < 3; ++cn_index) {
103 auto* cn3 = mdf::MdfWriter::CreateChannel(cg3);
104 ASSERT_TRUE(cn3 != nullptr);
105 std::ostringstream name;
106 name << "Channel" << cn_index;
107 cn3->Name(name.str());
108 cn3->Description("Channel description");
109 cn3->Type(cn_index == 0 ? ChannelType::Master
110 : ChannelType::FixedLength);
111 cn3->DataType(ChannelDataType::FloatBe);
112 cn3->DataBytes(4);
113 cn3->Unit("s");
114 }
115 }
116 }
117 writer->InitMeasurement();
118 writer->FinalizeMeasurement();
119}
120
121TEST_F(TestWrite3, TestManyChannel) {
122 if (kSkipTest) {

Callers

nothing calls this directly

Calls 15

appendMethod · 0.45
InitMethod · 0.45
HeaderMethod · 0.45
AuthorMethod · 0.45
DepartmentMethod · 0.45
DescriptionMethod · 0.45
ProjectMethod · 0.45
StartTimeMethod · 0.45
SubjectMethod · 0.45
CreateDataGroupMethod · 0.45
NameMethod · 0.45

Tested by

no test coverage detected