Skip to content

Commit 9fa22e7

Browse files
Add missing test for createSharedBuffer.
Change-Id: I1aefac11ba078d1d6cebe3b76c3fcd7d36972199 Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
1 parent bf799d9 commit 9fa22e7

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!groovy
22
neoDependenciesRev='755799-928'
33
strategy='EQUAL'
4-
allowedF=1
4+
allowedF=0
55
allowedCD=301

unit_tests/mem_obj/buffer_tests.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,17 @@ TEST(Buffers64on32Tests, given32BitBufferThatIsCreatedWithUseHostPtrButIsNotZero
752752
}
753753
}
754754

755+
TEST(SharedBuffersTest, whenBuffersIsCreatedWithSharingHandlerThenItIsSharedBuffer) {
756+
MockContext context;
757+
auto memoryManager = context.getDevice(0)->getMemoryManager();
758+
auto handler = new SharingHandler();
759+
auto graphicsAlloaction = memoryManager->allocateGraphicsMemory(4096);
760+
auto buffer = Buffer::createSharedBuffer(&context, CL_MEM_READ_ONLY, handler, graphicsAlloaction);
761+
ASSERT_NE(nullptr, buffer);
762+
EXPECT_EQ(handler, buffer->peekSharingHandler());
763+
buffer->release();
764+
}
765+
755766
class BufferTests : public ::testing::Test {
756767
protected:
757768
void SetUp() override {

0 commit comments

Comments
 (0)