mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Abort execution when registering invalid sharing object
Change-Id: Ie6091eb659c423ffe5deb4a3ffe55ae0ef66797d
This commit is contained in:

committed by
sys_ocldev

parent
cf1f60a1b4
commit
eead3ec683
@ -299,6 +299,12 @@ TEST_F(ContextTest, givenContextWhenSharingTableEmptyThenReturnsNullptr) {
|
||||
EXPECT_EQ(sharingF, nullptr);
|
||||
}
|
||||
|
||||
TEST_F(ContextTest, givenNullptrWhenRegisteringSharingToContextThenAbortExecution) {
|
||||
MockContext context;
|
||||
context.clearSharingFunctions();
|
||||
EXPECT_THROW(context.registerSharing<MockSharingFunctions>(nullptr), std::exception);
|
||||
}
|
||||
|
||||
TEST_F(ContextTest, givenContextWhenSharingTableIsNotEmptyThenReturnsSharingFunctionPointer) {
|
||||
MockContext context;
|
||||
MockSharingFunctions *sharingFunctions = new MockSharingFunctions;
|
||||
|
Reference in New Issue
Block a user