From 947afe55c0a0206644d67e33d501dbeddfedc1e1 Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Mon, 26 Oct 2020 13:21:59 -0600 Subject: [PATCH] Add default gotten queues test for swapchain builder --- tests/bootstrap_tests.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/bootstrap_tests.cpp b/tests/bootstrap_tests.cpp index 40e5fa7..f6fe1b3 100644 --- a/tests/bootstrap_tests.cpp +++ b/tests/bootstrap_tests.cpp @@ -127,7 +127,7 @@ TEST_CASE ("Device Configuration", "[VkBootstrap.bootstrap]") { auto window = create_window_glfw ("Device Configuration"); vkb::InstanceBuilder builder; - auto instance_ret = builder.request_validation_layers ().require_api_version(1,1).build (); + auto instance_ret = builder.request_validation_layers ().require_api_version (1, 1).build (); REQUIRE (instance_ret.has_value ()); auto surface = create_surface_glfw (instance_ret.value ().instance, window); @@ -279,6 +279,19 @@ TEST_CASE ("Swapchain", "[VkBootstrap.bootstrap]") { vkb::destroy_swapchain (recreated_swapchain_ret.value ()); } + AND_THEN ("Swapchain can be create with default gotten handles") { + vkb::SwapchainBuilder swapchain_builder ( + device.physical_device.physical_device, device.device, surface); + auto swapchain_ret = swapchain_builder.build (); + REQUIRE (swapchain_ret.has_value ()); + + auto swapchain = swapchain_ret.value (); + + auto recreated_swapchain_ret = swapchain_builder.set_old_swapchain (swapchain).build (); + REQUIRE (recreated_swapchain_ret.has_value ()); + + vkb::destroy_swapchain (recreated_swapchain_ret.value ()); + } vkb::destroy_device (device_ret.value ()); destroy_surface (instance_ret, surface);