Skip to content

Commit 06a453e

Browse files
authored
Small improvements of tests (#496)
* Remove unnecessary cache flush * Check return value of vmaCopyMemoryToAllocation in tests
1 parent f0969e9 commit 06a453e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/Tests.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6181,7 +6181,8 @@ static void TestDataUploadingWithStagingBuffer()
61816181
TEST(result == VK_SUCCESS);
61826182

61836183
TEST(stagingBufferAllocInfo.pMappedData != nullptr);
6184-
vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), stagingBufferAlloc, 0, bufferData.size());
6184+
result = vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), stagingBufferAlloc, 0, bufferData.size());
6185+
TEST(result == VK_SUCCESS);
61856186

61866187
BeginSingleTimeCommands();
61876188

@@ -6251,7 +6252,8 @@ static void TestDataUploadingWithMappedMemory() {
62516252
TEST(memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
62526253

62536254
TEST(uniformBufferAllocInfo.pMappedData != nullptr);
6254-
vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), uniformBufferAlloc, 0, bufferData.size());
6255+
result = vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), uniformBufferAlloc, 0, bufferData.size());
6256+
TEST(result == VK_SUCCESS);
62556257

62566258
BeginSingleTimeCommands();
62576259

@@ -6303,7 +6305,8 @@ static void TestAdvancedDataUploading() {
63036305
if (memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
63046306
// The allocation ended up as mapped memory.
63056307
TEST(uniformBufferAllocInfo.pMappedData != nullptr);
6306-
vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), uniformBufferAlloc, 0, bufferData.size());
6308+
result = vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), uniformBufferAlloc, 0, bufferData.size());
6309+
TEST(result == VK_SUCCESS);
63076310

63086311
BeginSingleTimeCommands();
63096312

@@ -6338,9 +6341,7 @@ static void TestAdvancedDataUploading() {
63386341
TEST(result == VK_SUCCESS);
63396342

63406343
TEST(stagingBufferAllocInfo.pMappedData != nullptr);
6341-
vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), stagingBufferAlloc, 0, bufferData.size());
6342-
6343-
result = vmaFlushAllocation(g_hAllocator, uniformBufferAlloc, 0, VK_WHOLE_SIZE);
6344+
result = vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), stagingBufferAlloc, 0, bufferData.size());
63446345
TEST(result == VK_SUCCESS);
63456346

63466347
BeginSingleTimeCommands();

0 commit comments

Comments
 (0)