@@ -59,16 +59,23 @@ struct CommandStreamReceiverTest : public DeviceFixture,
59
59
DeviceFixture::TearDown ();
60
60
}
61
61
62
- CommandStreamReceiver *commandStreamReceiver;
63
- MemoryManager *memoryManager;
64
- InternalAllocationStorage *internalAllocationStorage;
62
+ CommandStreamReceiver *commandStreamReceiver = nullptr ;
63
+ MemoryManager *memoryManager = nullptr ;
64
+ InternalAllocationStorage *internalAllocationStorage = nullptr ;
65
65
};
66
66
67
- TEST_F (CommandStreamReceiverTest, givenOsAgnosticCsrWhenGettingCompletionValueOrAddressThenZeroIsReturned) {
68
- EXPECT_EQ (0u , commandStreamReceiver->getCompletionAddress ());
69
-
67
+ TEST_F (CommandStreamReceiverTest, givenOsAgnosticCsrWhenGettingCompletionValueThenProperTaskCountIsReturned) {
70
68
MockGraphicsAllocation allocation{};
71
- EXPECT_EQ (0u , commandStreamReceiver->getCompletionValue (allocation));
69
+ uint32_t expectedValue = 0x1234 ;
70
+
71
+ auto &osContext = commandStreamReceiver->getOsContext ();
72
+ allocation.updateTaskCount (expectedValue, osContext.getContextId ());
73
+ EXPECT_EQ (expectedValue, commandStreamReceiver->getCompletionValue (allocation));
74
+ }
75
+
76
+ TEST_F (CommandStreamReceiverTest, givenOsAgnosticCsrWhenGettingCompletionAddressThenProperAddressIsReturned) {
77
+ auto expectedAddress = castToUint64 (const_cast <uint32_t *>(commandStreamReceiver->getTagAddress ()));
78
+ EXPECT_EQ (expectedAddress, commandStreamReceiver->getCompletionAddress ());
72
79
}
73
80
74
81
HWTEST_F (CommandStreamReceiverTest, WhenCreatingCsrThenDefaultValuesAreSet) {
0 commit comments