diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-21 15:22:55 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-21 15:22:55 +0100 |
| commit | 188830749e4d52b8cc65ea2e4f51a3508e09c3a7 (patch) | |
| tree | b45c08978fbf2b3112e96cdcae7c3d4530866718 /test/fix_basic | |
| parent | 555aa034fd870436ff0168642ea22428962ec73c (diff) | |
chore: Updated Unit tests for FIX.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'test/fix_basic')
| -rw-r--r-- | test/fix_basic/fix_test.cc | 18 |
1 files changed, 12 insertions, 6 deletions
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 <ocl/fix/parser.hpp> #include <gtest/gtest.h> +/// \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"] == ""); } |
