Tests: add missing swapchain destruction

In the swapchain recreation tests, the tests forgot to clean up the old
swapchains.
This commit is contained in:
Charles Giessen 2023-01-09 11:49:58 -07:00 committed by Charles Giessen
parent b36ede0f36
commit 9b3e648141

View File

@ -335,6 +335,7 @@ TEST_CASE("Swapchain", "[VkBootstrap.bootstrap]") {
auto recreated_swapchain_ret = swapchain_builder.set_old_swapchain(swapchain).build(); auto recreated_swapchain_ret = swapchain_builder.set_old_swapchain(swapchain).build();
REQUIRE(recreated_swapchain_ret.has_value()); REQUIRE(recreated_swapchain_ret.has_value());
vkb::destroy_swapchain(swapchain_ret.value());
vkb::destroy_swapchain(recreated_swapchain_ret.value()); vkb::destroy_swapchain(recreated_swapchain_ret.value());
} }
AND_THEN("Swapchain can be created from individual handles") { AND_THEN("Swapchain can be created from individual handles") {
@ -348,6 +349,7 @@ TEST_CASE("Swapchain", "[VkBootstrap.bootstrap]") {
auto recreated_swapchain_ret = swapchain_builder.set_old_swapchain(swapchain).build(); auto recreated_swapchain_ret = swapchain_builder.set_old_swapchain(swapchain).build();
REQUIRE(recreated_swapchain_ret.has_value()); REQUIRE(recreated_swapchain_ret.has_value());
vkb::destroy_swapchain(swapchain_ret.value());
vkb::destroy_swapchain(recreated_swapchain_ret.value()); vkb::destroy_swapchain(recreated_swapchain_ret.value());
} }
AND_THEN("Swapchain can be create with default gotten handles") { AND_THEN("Swapchain can be create with default gotten handles") {
@ -360,6 +362,7 @@ TEST_CASE("Swapchain", "[VkBootstrap.bootstrap]") {
auto recreated_swapchain_ret = swapchain_builder.set_old_swapchain(swapchain).build(); auto recreated_swapchain_ret = swapchain_builder.set_old_swapchain(swapchain).build();
REQUIRE(recreated_swapchain_ret.has_value()); REQUIRE(recreated_swapchain_ret.has_value());
vkb::destroy_swapchain(swapchain_ret.value());
vkb::destroy_swapchain(recreated_swapchain_ret.value()); vkb::destroy_swapchain(recreated_swapchain_ret.value());
} }
@ -626,4 +629,4 @@ TEST_CASE("Querying Vulkan 1.1 and 1.2 features", "[VkBootstrap.version]") {
} }
} }
#endif #endif