| 19 | class NegativeBuffer : public VkLayerTest {}; |
| 20 | |
| 21 | TEST_F(NegativeBuffer, UpdateBufferAlignment) { |
| 22 | TEST_DESCRIPTION("Check alignment parameters for vkCmdUpdateBuffer"); |
| 23 | uint32_t updateData[] = {1, 2, 3, 4, 5, 6, 7, 8}; |
| 24 | |
| 25 | RETURN_IF_SKIP(Init()); |
| 26 | vkt::Buffer buffer(*m_device, 20, VK_BUFFER_USAGE_TRANSFER_DST_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); |
| 27 | |
| 28 | m_command_buffer.Begin(); |
| 29 | // Introduce failure by using dstOffset that is not a multiple of 4 |
| 30 | m_errorMonitor->SetDesiredError(" is not a multiple of 4"); |
| 31 | vk::CmdUpdateBuffer(m_command_buffer, buffer, 1, 4, updateData); |
| 32 | m_errorMonitor->VerifyFound(); |
| 33 | |
| 34 | // Introduce failure by using dataSize that is not a multiple of 4 |
| 35 | m_errorMonitor->SetDesiredError(" is not a multiple of 4"); |
| 36 | vk::CmdUpdateBuffer(m_command_buffer, buffer, 0, 6, updateData); |
| 37 | m_errorMonitor->VerifyFound(); |
| 38 | |
| 39 | // Introduce failure by using dataSize that is < 0 |
| 40 | m_errorMonitor->SetDesiredError("must be greater than zero and less than or equal to 65536"); |
| 41 | vk::CmdUpdateBuffer(m_command_buffer, buffer, 0, (VkDeviceSize)-44, updateData); |
| 42 | m_errorMonitor->VerifyFound(); |
| 43 | |
| 44 | // Introduce failure by using dataSize that is > 65536 |
| 45 | m_errorMonitor->SetDesiredError("must be greater than zero and less than or equal to 65536"); |
| 46 | vk::CmdUpdateBuffer(m_command_buffer, buffer, 0, (VkDeviceSize)80000, updateData); |
| 47 | m_errorMonitor->VerifyFound(); |
| 48 | |
| 49 | m_command_buffer.End(); |
| 50 | } |
| 51 | |
| 52 | TEST_F(NegativeBuffer, FillBufferAlignmentAndSize) { |
| 53 | TEST_DESCRIPTION("Check alignment and size parameters for vkCmdFillBuffer"); |
nothing calls this directly
no test coverage detected