aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test/ProfilingTests.cpp
diff options
context:
space:
mode:
authorNikhil Raj <nikhil.raj@arm.com>2019-08-15 15:49:45 +0100
committerNikhil Raj <nikhil.raj@arm.com>2019-08-15 15:49:45 +0100
commitbc62605b8f4592881dcc6eb74b5d7af089ae3fd0 (patch)
tree07094a9442131a443237fd6ae728ca711958b75c /src/profiling/test/ProfilingTests.cpp
parent4e3e818e1ea73544f3aec4e2ac2621a1c3380b54 (diff)
downloadarmnn-bc62605b8f4592881dcc6eb74b5d7af089ae3fd0.tar.gz
IVGCVSW-3415 Create the Packet Class
Change-Id: Ie59e82e7f87f5ba6496aa8579bc9d40360d90999 Signed-off-by: Nikhil Raj <nikhil.raj@arm.com>
Diffstat (limited to 'src/profiling/test/ProfilingTests.cpp')
-rw-r--r--src/profiling/test/ProfilingTests.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp
index 5abab2fb78..1ea8ab96a2 100644
--- a/src/profiling/test/ProfilingTests.cpp
+++ b/src/profiling/test/ProfilingTests.cpp
@@ -4,7 +4,10 @@
//
#include "../CommandHandlerKey.hpp"
+#include "../Packet.hpp"
+#include <cstdint>
+#include <cstring>
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_SUITE(ExternalProfiling)
@@ -56,4 +59,23 @@ BOOST_AUTO_TEST_CASE(CheckCommandHandlerKeyComparisons)
BOOST_CHECK(vect == expectedVect);
}
+BOOST_AUTO_TEST_CASE(CheckPacketClass)
+{
+ const char* data = "test";
+ unsigned int length = static_cast<unsigned int>(std::strlen(data));
+
+ Packet packetTest1(472580096,length,data);
+ BOOST_CHECK_THROW(Packet packetTest2(472580096,0,""), armnn::Exception);
+
+ Packet packetTest3(472580096,0, nullptr);
+
+ BOOST_CHECK(packetTest1.GetLength() == length);
+ BOOST_CHECK(packetTest1.GetData() == data);
+
+ BOOST_CHECK(packetTest1.GetPacketFamily() == 7);
+ BOOST_CHECK(packetTest1.GetPacketId() == 43);
+ BOOST_CHECK(packetTest1.GetPacketType() == 3);
+ BOOST_CHECK(packetTest1.GetPacketClass() == 5);
+}
+
BOOST_AUTO_TEST_SUITE_END()