MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / TEST_F

Function TEST_F

tests/unit/buffer.cpp:21–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19class NegativeBuffer : public VkLayerTest {};
20
21TEST_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
52TEST_F(NegativeBuffer, FillBufferAlignmentAndSize) {
53 TEST_DESCRIPTION("Check alignment and size parameters for vkCmdFillBuffer");

Callers

nothing calls this directly

Calls 15

CmdUpdateBufferFunction · 0.85
CmdFillBufferFunction · 0.85
CreateBufferViewFunction · 0.85
UpdateDescriptorSetsFunction · 0.85
DestroyBufferViewFunction · 0.85
CmdBindIndexBufferFunction · 0.85
DestroyBufferFunction · 0.85
BindBufferMemoryFunction · 0.85
CmdBindVertexBuffersFunction · 0.85
CmdBindIndexBuffer2KHRFunction · 0.85

Tested by

no test coverage detected