From fd4f323bbfdd6ac9801a7175c7b84b75f8f55f3b Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Wed, 6 Nov 2024 08:49:36 -0600 Subject: [PATCH] Add handle checking to test instance & device creation Change-Id: I8b278f8425ac463817d952113d20c6cf92c8d727 --- tests/framework/test_environment.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/framework/test_environment.cpp b/tests/framework/test_environment.cpp index 1f8a02a23..40980cf6e 100644 --- a/tests/framework/test_environment.cpp +++ b/tests/framework/test_environment.cpp @@ -198,11 +198,13 @@ InstWrapper& InstWrapper::operator=(InstWrapper&& other) noexcept { } void InstWrapper::CheckCreate(VkResult result_to_check) { + handle_assert_null(inst); ASSERT_EQ(result_to_check, functions->vkCreateInstance(create_info.get(), callbacks, &inst)); functions->load_instance_functions(inst); } void InstWrapper::CheckCreateWithInfo(InstanceCreateInfo& create_info, VkResult result_to_check) { + handle_assert_null(inst); ASSERT_EQ(result_to_check, functions->vkCreateInstance(create_info.get(), callbacks, &inst)); functions->load_instance_functions(inst); } @@ -297,10 +299,12 @@ DeviceWrapper& DeviceWrapper::operator=(DeviceWrapper&& other) noexcept { } void DeviceWrapper::CheckCreate(VkPhysicalDevice phys_dev, VkResult result_to_check) { + handle_assert_null(dev); ASSERT_EQ(result_to_check, functions->vkCreateDevice(phys_dev, create_info.get(), callbacks, &dev)); } VkResult CreateDebugUtilsMessenger(DebugUtilsWrapper& debug_utils) { + handle_assert_null(debug_utils.messenger); return debug_utils.local_vkCreateDebugUtilsMessengerEXT(debug_utils.inst, debug_utils.get(), debug_utils.callbacks, &debug_utils.messenger); }