Fix problem in test.

- when pointer overlaps 2 pages then fragment count will be 2 not 1.
- Limit the size to 1 byte to ensure only 1 page.

Change-Id: I21c1e07037a99ff3e48909605cb4e2444e499d60
This commit is contained in:
Mrozek, Michal
2018-07-12 09:31:43 +02:00
committed by sys_ocldev
parent 8604128d3c
commit ebc16baa00

View File

@ -254,8 +254,8 @@ TEST(MemoryManagerTest, givenForced32BitAndEnabled64kbPagesWhenGraphicsMemoryMus
TEST(MemoryManagerTest, givenEnabled64kbPagesWhenGraphicsMemoryIsAllocatedWithHostPtrForBufferThenExistingMemoryIsUsedForAllocation) {
OsAgnosticMemoryManager memoryManager(true);
AllocationData allocData;
char memory[10];
MockOsAgnosticMemoryManager::getAllocationData(allocData, true, false, false, false, &memory, 10, GraphicsAllocation::AllocationType::BUFFER);
char memory[1];
MockOsAgnosticMemoryManager::getAllocationData(allocData, true, false, false, false, &memory, 1, GraphicsAllocation::AllocationType::BUFFER);
auto allocation = memoryManager.allocateGraphicsMemory(allocData);
ASSERT_NE(nullptr, allocation);