Fix completion check for TimestampPacketStorage

Change-Id: If15d2bbc49a1dc2dfb29e3b6cdc3ad1523997cd5
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2019-11-28 21:15:36 +01:00
committed by sys_ocldev
parent 8784491abe
commit b1fbced81f
2 changed files with 20 additions and 1 deletions

View File

@@ -214,6 +214,25 @@ TEST_F(TimestampPacketSimpleTests, whenIsCompletedIsCalledThenItReturnsProperTim
EXPECT_TRUE(timestampPacketStorage.isCompleted());
}
TEST_F(TimestampPacketSimpleTests, givenMultiplePacketsInUseWhenCompletionIsCheckedTheVerifyAllUsedNodes) {
TimestampPacketStorage timestampPacketStorage;
auto &packets = timestampPacketStorage.packets;
timestampPacketStorage.packetsUsed = TimestampPacketSizeControl::preferredPacketCount - 1;
for (uint32_t i = 0; i < timestampPacketStorage.packetsUsed - 1; i++) {
packets[i].contextEnd = 0;
packets[i].globalEnd = 0;
EXPECT_FALSE(timestampPacketStorage.isCompleted());
}
packets[timestampPacketStorage.packetsUsed - 1].contextEnd = 0;
EXPECT_FALSE(timestampPacketStorage.isCompleted());
packets[timestampPacketStorage.packetsUsed - 1].globalEnd = 0;
EXPECT_TRUE(timestampPacketStorage.isCompleted());
}
TEST_F(TimestampPacketSimpleTests, givenImplicitDependencyWhenEndTagIsWrittenThenCantBeReleased) {
TimestampPacketStorage timestampPacketStorage;