From 06a453ed477936c099a1e5565b01404e9503a07c Mon Sep 17 00:00:00 2001 From: Johannes Schneider Date: Thu, 22 May 2025 14:37:24 +0200 Subject: [PATCH] Small improvements of tests (#496) * Remove unnecessary cache flush * Check return value of vmaCopyMemoryToAllocation in tests --- src/Tests.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Tests.cpp b/src/Tests.cpp index b568009..9c9c7bb 100644 --- a/src/Tests.cpp +++ b/src/Tests.cpp @@ -6181,7 +6181,8 @@ static void TestDataUploadingWithStagingBuffer() TEST(result == VK_SUCCESS); TEST(stagingBufferAllocInfo.pMappedData != nullptr); - vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), stagingBufferAlloc, 0, bufferData.size()); + result = vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), stagingBufferAlloc, 0, bufferData.size()); + TEST(result == VK_SUCCESS); BeginSingleTimeCommands(); @@ -6251,7 +6252,8 @@ static void TestDataUploadingWithMappedMemory() { TEST(memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); TEST(uniformBufferAllocInfo.pMappedData != nullptr); - vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), uniformBufferAlloc, 0, bufferData.size()); + result = vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), uniformBufferAlloc, 0, bufferData.size()); + TEST(result == VK_SUCCESS); BeginSingleTimeCommands(); @@ -6303,7 +6305,8 @@ static void TestAdvancedDataUploading() { if (memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { // The allocation ended up as mapped memory. TEST(uniformBufferAllocInfo.pMappedData != nullptr); - vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), uniformBufferAlloc, 0, bufferData.size()); + result = vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), uniformBufferAlloc, 0, bufferData.size()); + TEST(result == VK_SUCCESS); BeginSingleTimeCommands(); @@ -6338,9 +6341,7 @@ static void TestAdvancedDataUploading() { TEST(result == VK_SUCCESS); TEST(stagingBufferAllocInfo.pMappedData != nullptr); - vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), stagingBufferAlloc, 0, bufferData.size()); - - result = vmaFlushAllocation(g_hAllocator, uniformBufferAlloc, 0, VK_WHOLE_SIZE); + result = vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), stagingBufferAlloc, 0, bufferData.size()); TEST(result == VK_SUCCESS); BeginSingleTimeCommands();