diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-10-15 09:35:29 +0100 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-10-15 15:20:31 +0000 |
commit | 8d9590e5510b8ebdc4e0b2b31ce4b653b46fc02a (patch) | |
tree | 0521297dae9ebbf4b012df52313abe44d66d4c42 /src/profiling/test | |
parent | 672d06eac5b0842c22f9f219e9b65efcd5883d33 (diff) | |
download | armnn-8d9590e5510b8ebdc4e0b2b31ce4b653b46fc02a.tar.gz |
IVGCVSW-3939 Code refactoring and minor fixes
* Fixed value masking in SendPeriodicCounterCapturePacket and updated
the pertinent unit tests
* Code refactoring and cleanup
* Added extra comments to the ProfilingService stop/reset procedure
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Change-Id: Ibaf2fede76e06d5b8ce7258a4820a60e5993559f
Diffstat (limited to 'src/profiling/test')
-rw-r--r-- | src/profiling/test/ProfilingTests.cpp | 8 | ||||
-rw-r--r-- | src/profiling/test/SendCounterPacketTests.cpp | 20 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp index b32a55cc6d..50af75eeea 100644 --- a/src/profiling/test/ProfilingTests.cpp +++ b/src/profiling/test/ProfilingTests.cpp @@ -2119,10 +2119,10 @@ BOOST_AUTO_TEST_CASE(CheckPeriodicCounterCaptureThread) uint32_t headerWord0 = ReadUint32(buffer, 0); uint32_t headerWord1 = ReadUint32(buffer, 4); - BOOST_TEST(((headerWord0 >> 26) & 0x3F) == 1); // packet family - BOOST_TEST(((headerWord0 >> 19) & 0x3F) == 0); // packet class - BOOST_TEST(((headerWord0 >> 16) & 0x3) == 0); // packet type - BOOST_TEST(headerWord1 == 20); // data length + BOOST_TEST(((headerWord0 >> 26) & 0x0000003F) == 1); // packet family + BOOST_TEST(((headerWord0 >> 19) & 0x0000007F) == 0); // packet class + BOOST_TEST(((headerWord0 >> 16) & 0x00000007) == 0); // packet type + BOOST_TEST(headerWord1 == 20); uint32_t offset = 16; uint16_t readIndex = ReadUint16(buffer, offset); diff --git a/src/profiling/test/SendCounterPacketTests.cpp b/src/profiling/test/SendCounterPacketTests.cpp index 00dad38078..f0ba34778c 100644 --- a/src/profiling/test/SendCounterPacketTests.cpp +++ b/src/profiling/test/SendCounterPacketTests.cpp @@ -217,11 +217,11 @@ BOOST_AUTO_TEST_CASE(SendPeriodicCounterCapturePacketTest) uint32_t headerWord1 = ReadUint32(readBuffer2, 4); uint64_t readTimestamp = ReadUint64(readBuffer2, 8); - BOOST_TEST(((headerWord0 >> 26) & 0x3F) == 1); // packet family - BOOST_TEST(((headerWord0 >> 19) & 0x3F) == 0); // packet class - BOOST_TEST(((headerWord0 >> 16) & 0x3) == 0); // packet type - BOOST_TEST(headerWord1 == 8); // data length - BOOST_TEST(time == readTimestamp); // capture period + BOOST_TEST(((headerWord0 >> 26) & 0x0000003F) == 1); // packet family + BOOST_TEST(((headerWord0 >> 19) & 0x0000007F) == 0); // packet class + BOOST_TEST(((headerWord0 >> 16) & 0x00000007) == 0); // packet type + BOOST_TEST(headerWord1 == 8); // data length + BOOST_TEST(time == readTimestamp); // capture period // Full packet message MockBufferManager mockBuffer3(512); @@ -240,11 +240,11 @@ BOOST_AUTO_TEST_CASE(SendPeriodicCounterCapturePacketTest) headerWord1 = ReadUint32(readBuffer3, 4); uint64_t readTimestamp2 = ReadUint64(readBuffer3, 8); - BOOST_TEST(((headerWord0 >> 26) & 0x3F) == 1); // packet family - BOOST_TEST(((headerWord0 >> 19) & 0x3F) == 0); // packet class - BOOST_TEST(((headerWord0 >> 16) & 0x3) == 0); // packet type - BOOST_TEST(headerWord1 == 38); // data length - BOOST_TEST(time == readTimestamp2); // capture period + BOOST_TEST(((headerWord0 >> 26) & 0x0000003F) == 1); // packet family + BOOST_TEST(((headerWord0 >> 19) & 0x0000007F) == 0); // packet class + BOOST_TEST(((headerWord0 >> 16) & 0x00000007) == 0); // packet type + BOOST_TEST(headerWord1 == 38); // data length + BOOST_TEST(time == readTimestamp2); // capture period uint16_t counterIndex = 0; uint32_t counterValue = 100; |