Update getAllocationTypeString method

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2021-07-16 14:10:17 +00:00
committed by Compute-Runtime-Automation
parent e939e97384
commit abade55c2d
2 changed files with 24 additions and 0 deletions

View File

@ -926,6 +926,22 @@ TEST(AllocationTypeLoggingSingle, givenGraphicsAllocationTypeWhenConvertingToStr
EXPECT_STREQ(result, "ILLEGAL_VALUE");
}
TEST(AllocationTypeLoggingSingle, givenAllocationTypeWhenConvertingToStringThenSupportAll) {
std::string testFile = "testfile";
DebugVariables flags;
FullyEnabledFileLogger fileLogger(testFile, flags);
GraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0ull, 0ull, 0, MemoryPool::MemoryNull);
for (uint32_t i = 0; i < static_cast<uint32_t>(GraphicsAllocation::AllocationType::COUNT); i++) {
graphicsAllocation.setAllocationType(static_cast<GraphicsAllocation::AllocationType>(i));
auto result = fileLogger.getAllocationTypeString(&graphicsAllocation);
EXPECT_STRNE(result, "ILLEGAL_VALUE");
}
}
TEST(AllocationTypeLoggingSingle, givenDisabledDebugFunctionalityWhenGettingGraphicsAllocationTypeThenNullptrReturned) {
std::string testFile = "testfile";
DebugVariables flags;