Skip to content

Commit

Permalink
Add handle checking to test instance & device creation
Browse files Browse the repository at this point in the history
Change-Id: I8b278f8425ac463817d952113d20c6cf92c8d727
  • Loading branch information
charles-lunarg committed Nov 6, 2024
1 parent 11f2281 commit fd4f323
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/framework/test_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit fd4f323

Please sign in to comment.