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

Function TEST

lib/mdflib/mdflib_test/src/testcncomment.cpp:15–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13namespace mdf::test {
14
15TEST(TestCnComment, Properties) {
16 CnComment comment;
17
18 constexpr std::string_view kTx = "CN Test Properties";
19 comment.Comment(MdString(kTx));
20
21 constexpr std::string_view kLinkerName = "Germany";
22 comment.LinkerName(MdString(kLinkerName));
23
24 constexpr uint64_t kLinkerAddress = 0x123456;
25 comment.LinkerAddress(MdNumber(kLinkerAddress, MdDataType::MdHex));
26
27 constexpr MdMonotony kMonotony = MdMonotony::Monotonous;
28 comment.AxisMonotony(kMonotony);
29
30 constexpr double kRaster = 1.23;
31 comment.Raster(MdNumber(kRaster));
32
33 constexpr uint64_t kAddress = 0xABCDEF;
34 comment.Address(MdNumber(kAddress, MdDataType::MdHex));
35
36 const std::string xml_snippet = comment.ToXml();
37 std::cout << xml_snippet << std::endl;
38
39 CnComment comment1;
40 comment1.FromXml(xml_snippet);
41 EXPECT_EQ(comment1.Comment(), kTx);
42
43 EXPECT_EQ(comment1.LinkerName(), kLinkerName);
44 EXPECT_EQ(comment1.LinkerAddress(), kLinkerAddress);
45 EXPECT_EQ(comment1.AxisMonotony(), kMonotony);
46 EXPECT_EQ(comment1.Raster(), kRaster);
47 EXPECT_EQ(comment1.Address(), kAddress);
48}
49
50TEST(TestCnComment, MdNumber) {
51 CnComment comment;

Callers

nothing calls this directly

Calls 15

MdStringClass · 0.85
MdNumberClass · 0.85
LinkerNameMethod · 0.80
LinkerAddressMethod · 0.80
AxisMonotonyMethod · 0.80
RasterMethod · 0.80
AddressMethod · 0.80
ByteCountMethod · 0.80
BitMaskMethod · 0.80
ByteOrderMethod · 0.80
MinMethod · 0.80
MaxMethod · 0.80

Tested by

no test coverage detected