From 188830749e4d52b8cc65ea2e4f51a3508e09c3a7 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 21 Dec 2025 15:22:55 +0100 Subject: chore: Updated Unit tests for FIX. Signed-off-by: Amlal El Mahrouss --- test/fix_basic/fix_test.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'test/fix_basic') diff --git a/test/fix_basic/fix_test.cc b/test/fix_basic/fix_test.cc index 6139b12..fd82965 100644 --- a/test/fix_basic/fix_test.cc +++ b/test/fix_basic/fix_test.cc @@ -8,6 +8,7 @@ #include #include +/// \brief The template to do our tests on. constexpr char default_fix[] = { '8', '=', 'F', 'I', 'X', '.', '4', '.', '2', 0x01, '9', '=', '6', '3', 0x01, // BodyLength = 63 @@ -21,18 +22,23 @@ constexpr char default_fix[] = { '1', '0', '=', '1', '4', '3', 0x01, 0x00 // CheckSum = 143 }; -ocl::fix::basic_visitor basic_visitor; -ocl::fix::basic_range_data fix = basic_visitor.visit(default_fix); +ocl::fix::visitor basic_visitor; +ocl::fix::range_buffer fix = basic_visitor.visit(default_fix); -TEST(FIXTest, FIX1) +TEST(FIXTest, FIXGoodPacket) { EXPECT_TRUE(fix.is_valid()); +} + +TEST(FIXTest, FIXGoodParse) +{ EXPECT_TRUE(fix["35"].empty() == false && fix["35"] == "A"); EXPECT_TRUE(fix["49"].empty() == false && fix["49"] == "SERVER"); + + EXPECT_TRUE(fix["49"].empty() == false && fix["49"] != "A"); } -TEST(FIXTest, FIX2) +TEST(FIXTest, FIXGoodErrorOnParse) { - EXPECT_TRUE(fix["133"].empty() == true && fix["133"] != ""); - EXPECT_TRUE(fix["49"].empty() == false && fix["49"] != "A"); + EXPECT_TRUE(fix["133"].empty() == true && fix["133"] == ""); } -- cgit v1.2.3