| 13 | namespace mdf::test { |
| 14 | |
| 15 | TEST(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 | |
| 50 | TEST(TestCnComment, MdNumber) { |
| 51 | CnComment comment; |
nothing calls this directly
no test coverage detected