Add changes requested in code review
diff --git a/src/Tests.cpp b/src/Tests.cpp
index a4f29f1..86b181f 100644
--- a/src/Tests.cpp
+++ b/src/Tests.cpp
@@ -6161,7 +6161,7 @@
     const VkDeviceSize bufferSize = 65536;
     std::vector<std::uint8_t> bufferData(bufferSize);
     for (auto& bufferByte : bufferData) {
-        bufferByte = static_cast<std::uint8_t>(rand() % 256);
+        bufferByte = static_cast<std::uint8_t>(rand());
     }
 
     VkBufferCreateInfo uniformBufferCI = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
@@ -6170,20 +6170,14 @@
 
     VmaAllocationCreateInfo uniformBufferAllocCI = {};
     uniformBufferAllocCI.usage = VMA_MEMORY_USAGE_AUTO;
-    uniformBufferAllocCI.flags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
 
     VkBuffer uniformBuffer = VK_NULL_HANDLE;
-    VmaAllocation uniformBufferAlloc = {};
+    VmaAllocation uniformBufferAlloc = VK_NULL_HANDLE;
     VmaAllocationInfo uniformBufferAllocInfo = {};
 
     VkResult result = vmaCreateBuffer(g_hAllocator, &uniformBufferCI, &uniformBufferAllocCI, &uniformBuffer, &uniformBufferAlloc, &uniformBufferAllocInfo);
     TEST(result == VK_SUCCESS);
 
-    // We need to check if the uniform buffer really ended NOT up in mappable memory.
-    VkMemoryPropertyFlags memPropFlags;
-    vmaGetAllocationMemoryProperties(g_hAllocator, uniformBufferAlloc, &memPropFlags);
-    TEST(!(memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT));
-
     VkBufferCreateInfo stagingBufferCI = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
     stagingBufferCI.size = bufferSize;
     stagingBufferCI.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
@@ -6200,10 +6194,7 @@
     TEST(result == VK_SUCCESS);
 
     TEST(stagingBufferAllocInfo.pMappedData != nullptr);
-    std::memcpy(stagingBufferAllocInfo.pMappedData, bufferData.data(), bufferData.size());
-
-    result = vmaFlushAllocation(g_hAllocator, uniformBufferAlloc, 0, VK_WHOLE_SIZE);
-    TEST(result == VK_SUCCESS);
+    vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), stagingBufferAlloc, 0, bufferData.size());
 
     BeginSingleTimeCommands();
 
@@ -6243,7 +6234,7 @@
 }
 
 static void TestDataUploadingWithMappedMemory() {
-    wprintf(L"Testing data uploading with mapped memory and memcpy...\n");
+    wprintf(L"Testing data uploading with mapped memory...\n");
 
     // Generate some random data to fill the uniform buffer with.
     const VkDeviceSize bufferSize = 65536;
@@ -6258,10 +6249,10 @@
 
     VmaAllocationCreateInfo uniformBufferAllocCI = {};
     uniformBufferAllocCI.usage = VMA_MEMORY_USAGE_AUTO;
-    uniformBufferAllocCI.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT; // We want memory to be mapped so we can use memcpy to update it
+    uniformBufferAllocCI.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT; // We want memory to be mapped.
 
     VkBuffer uniformBuffer = VK_NULL_HANDLE;
-    VmaAllocation uniformBufferAlloc = {};
+    VmaAllocation uniformBufferAlloc = VK_NULL_HANDLE;
     VmaAllocationInfo uniformBufferAllocInfo = {};
 
     VkResult result = vmaCreateBuffer(g_hAllocator, &uniformBufferCI, &uniformBufferAllocCI, &uniformBuffer, &uniformBufferAlloc, &uniformBufferAllocInfo);
@@ -6273,11 +6264,7 @@
     TEST(memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
 
     TEST(uniformBufferAllocInfo.pMappedData != nullptr);
-    std::memcpy(uniformBufferAllocInfo.pMappedData, bufferData.data(), bufferData.size());
-
-    // We don't need to check for VK_MEMORY_PROPERTY_HOST_COHERENT_BIT because both vmaFlushAllocation and vmaInvalidateAllocation check for this internally.
-    result = vmaFlushAllocation(g_hAllocator, uniformBufferAlloc, 0, VK_WHOLE_SIZE);
-    TEST(result == VK_SUCCESS);
+    vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), uniformBufferAlloc, 0, bufferData.size());
 
     BeginSingleTimeCommands();
 
@@ -6313,7 +6300,8 @@
 
     VmaAllocationCreateInfo uniformBufferAllocCI = {};
     uniformBufferAllocCI.usage = VMA_MEMORY_USAGE_AUTO;
-    uniformBufferAllocCI.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT;
+    uniformBufferAllocCI.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT
+                                    | VMA_ALLOCATION_CREATE_MAPPED_BIT;
 
     VkBuffer uniformBuffer = VK_NULL_HANDLE;
     VmaAllocation uniformBufferAlloc = {};
@@ -6326,13 +6314,9 @@
     vmaGetAllocationMemoryProperties(g_hAllocator, uniformBufferAlloc, &memPropFlags);
 
     if (memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
-        // The allocation ended up as mapped memory, meaning we can update it simply by using std::memcpy.
+        // The allocation ended up as mapped memory.
         TEST(uniformBufferAllocInfo.pMappedData != nullptr);
-        std::memcpy(uniformBufferAllocInfo.pMappedData, bufferData.data(), bufferData.size());
-
-        // We don't need to check for VK_MEMORY_PROPERTY_HOST_COHERENT_BIT because both vmaFlushAllocation and vmaInvalidateAllocation check for this internally.
-        result = vmaFlushAllocation(g_hAllocator, uniformBufferAlloc, 0, VK_WHOLE_SIZE);
-        TEST(result == VK_SUCCESS);
+        vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), uniformBufferAlloc, 0, bufferData.size());
 
         BeginSingleTimeCommands();
 
@@ -6367,7 +6351,7 @@
         TEST(result == VK_SUCCESS);
 
         TEST(stagingBufferAllocInfo.pMappedData != nullptr);
-        std::memcpy(stagingBufferAllocInfo.pMappedData, bufferData.data(), bufferData.size());
+        vmaCopyMemoryToAllocation(g_hAllocator, bufferData.data(), stagingBufferAlloc, 0, bufferData.size());
 
         result = vmaFlushAllocation(g_hAllocator, uniformBufferAlloc, 0, VK_WHOLE_SIZE);
         TEST(result == VK_SUCCESS);