Small improvements of tests (#496)

* Remove unnecessary cache flush

* Check return value of vmaCopyMemoryToAllocation in tests
This commit is contained in:
Johannes Schneider 2025-05-22 14:37:24 +02:00 committed by GitHub
parent f0969e908b
commit 06a453ed47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6181,7 +6181,8 @@ static void TestDataUploadingWithStagingBuffer()
TEST(result == VK_SUCCESS); TEST(result == VK_SUCCESS);
TEST(stagingBufferAllocInfo.pMappedData != nullptr); 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(); BeginSingleTimeCommands();
@ -6251,7 +6252,8 @@ static void TestDataUploadingWithMappedMemory() {
TEST(memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); TEST(memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
TEST(uniformBufferAllocInfo.pMappedData != nullptr); 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(); BeginSingleTimeCommands();
@ -6303,7 +6305,8 @@ static void TestAdvancedDataUploading() {
if (memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { if (memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
// The allocation ended up as mapped memory. // The allocation ended up as mapped memory.
TEST(uniformBufferAllocInfo.pMappedData != nullptr); 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(); BeginSingleTimeCommands();
@ -6338,9 +6341,7 @@ static void TestAdvancedDataUploading() {
TEST(result == VK_SUCCESS); TEST(result == VK_SUCCESS);
TEST(stagingBufferAllocInfo.pMappedData != nullptr); TEST(stagingBufferAllocInfo.pMappedData != nullptr);
vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), stagingBufferAlloc, 0, bufferData.size()); result = vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), stagingBufferAlloc, 0, bufferData.size());
result = vmaFlushAllocation(g_hAllocator, uniformBufferAlloc, 0, VK_WHOLE_SIZE);
TEST(result == VK_SUCCESS); TEST(result == VK_SUCCESS);
BeginSingleTimeCommands(); BeginSingleTimeCommands();