From f3016ceac7fd415ee491bd4e5907f86bc85c92cb Mon Sep 17 00:00:00 2001 From: Dave Houlton <daveh@lunarg.com> Date: Thu, 30 Mar 2017 10:32:10 -0600 Subject: [PATCH] tests: Re-fixed multi-init tests, smaller hammer Change-Id: I61164e4a5714647f70cffab04730034d22b1d4db --- tests/layer_validation_tests.cpp | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp index 071095a4a..7d9fbe5d5 100644 --- a/tests/layer_validation_tests.cpp +++ b/tests/layer_validation_tests.cpp @@ -1364,16 +1364,14 @@ TEST_F(VkLayerTest, SparseResidencyImageCreateUnsupportedTypes) { // Determine which device feature are available VkPhysicalDeviceFeatures device_features = {}; - ASSERT_NO_FATAL_FAILURE(Init()); + ASSERT_NO_FATAL_FAILURE( + InitFramework(instance_layer_names, instance_extension_names, device_extension_names, myDbgFunc, m_errorMonitor)); ASSERT_NO_FATAL_FAILURE(GetPhysicalDeviceFeatures(&device_features)); - // Destroy the first instance - ShutdownFramework(); - - // Mask out device features we don't want and create a new instance + // Mask out device features we don't want and initialize device state device_features.sparseResidencyImage2D = VK_FALSE; device_features.sparseResidencyImage3D = VK_FALSE; - ASSERT_NO_FATAL_FAILURE(Init(&device_features)); + ASSERT_NO_FATAL_FAILURE(InitState(&device_features)); VkImage image = VK_NULL_HANDLE; VkResult result = VK_RESULT_MAX_ENUM; @@ -1433,24 +1431,22 @@ TEST_F(VkLayerTest, SparseResidencyImageCreateUnsupportedSamples) { // Determine which device feature are available VkPhysicalDeviceFeatures device_features = {}; - ASSERT_NO_FATAL_FAILURE(Init()); + ASSERT_NO_FATAL_FAILURE( + InitFramework(instance_layer_names, instance_extension_names, device_extension_names, myDbgFunc, m_errorMonitor)); ASSERT_NO_FATAL_FAILURE(GetPhysicalDeviceFeatures(&device_features)); - // Destroy the first instance - ShutdownFramework(); - // These tests require that the device support sparse residency for 2D images if (VK_TRUE != device_features.sparseResidencyImage2D) { printf(" Test requires unsupported SparseResidencyImage2D feature. Skipped.\n"); return; } - // Mask out device features we don't want and create a new instance + // Mask out device features we don't want and initialize device state device_features.sparseResidency2Samples = VK_FALSE; device_features.sparseResidency4Samples = VK_FALSE; device_features.sparseResidency8Samples = VK_FALSE; device_features.sparseResidency16Samples = VK_FALSE; - ASSERT_NO_FATAL_FAILURE(Init(&device_features)); + ASSERT_NO_FATAL_FAILURE(InitState(&device_features)); VkImage image = VK_NULL_HANDLE; VkResult result = VK_RESULT_MAX_ENUM; @@ -22809,9 +22805,6 @@ TEST_F(VkPositiveLayerTest, Maintenance1Tests) { } } - // Destroy the first instance - ShutdownFramework(); - // Proceed if extension is supported by hardware if (!supports_maintenance1_extension) { printf(" Maintenance1 Extension not supported, skipping tests\n"); @@ -22819,7 +22812,7 @@ TEST_F(VkPositiveLayerTest, Maintenance1Tests) { } m_errorMonitor->ExpectSuccess(); - ASSERT_NO_FATAL_FAILURE(Init()); + ASSERT_NO_FATAL_FAILURE(InitState()); VkCommandBuffer cmd_buf; VkCommandBufferAllocateInfo alloc_info; alloc_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO; -- GitLab