From d88e47c3a334447b964649518c088bf32054ed79 Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Mon, 19 Aug 2019 10:04:23 +0100 Subject: IVGCVSW-3429 Add a utility Version class Change-Id: Id429f7d9176c775953c1261c5a3e9f1d565927c1 Signed-off-by: Nikhil Raj --- src/profiling/test/ProfilingTests.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/profiling/test/ProfilingTests.cpp') diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp index a8ec0277d2..8a2f2bd88e 100644 --- a/src/profiling/test/ProfilingTests.cpp +++ b/src/profiling/test/ProfilingTests.cpp @@ -6,6 +6,7 @@ #include "../CommandHandlerKey.hpp" #include "../CommandHandlerFunctor.hpp" #include "../CommandHandlerRegistry.hpp" +#include "../EncodeVersion.hpp" #include "../Packet.hpp" #include @@ -62,6 +63,36 @@ BOOST_AUTO_TEST_CASE(CheckCommandHandlerKeyComparisons) BOOST_CHECK(vect == expectedVect); } +BOOST_AUTO_TEST_CASE(CheckEncodeVersion) +{ + mlutil::Version version1(12); + + BOOST_CHECK(version1.GetMajor() == 0); + BOOST_CHECK(version1.GetMinor() == 0); + BOOST_CHECK(version1.GetPatch() == 12); + + mlutil::Version version2(4108); + + BOOST_CHECK(version2.GetMajor() == 0); + BOOST_CHECK(version2.GetMinor() == 1); + BOOST_CHECK(version2.GetPatch() == 12); + + mlutil::Version version3(4198412); + + BOOST_CHECK(version3.GetMajor() == 1); + BOOST_CHECK(version3.GetMinor() == 1); + BOOST_CHECK(version3.GetPatch() == 12); + + mlutil::Version version4(0); + + BOOST_CHECK(version4.GetMajor() == 0); + BOOST_CHECK(version4.GetMinor() == 0); + BOOST_CHECK(version4.GetPatch() == 0); + + mlutil::Version version5(1,0,0); + BOOST_CHECK(version5.GetEncodedValue() == 4194304); +} + BOOST_AUTO_TEST_CASE(CheckPacketClass) { const char* data = "test"; -- cgit v1.2.1