diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..030e294 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,18 @@ +# Copyright 2023 The Khronos Group Inc. +# Copyright 2023 Valve Corporation +# Copyright 2023 LunarG, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +Checks: "-*,\ +google*,\ +readability-identifier-naming,\ +-google-readability-todo,\ +-google-readability-avoid-underscore-in-googletest-name,\ +-google-runtime-references,\ +" +WarningsAsErrors: "*" +HeaderFilterRegex: ".*" +CheckOptions: + - { key: readability-identifier-naming.VariableCase, value: lower_case } + - { key: readability-identifier-naming.GlobalConstantCase, value: CamelCase } + - { key: readability-identifier-naming.GlobalConstantPrefix, value: k } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9e7d0c..cb2b6f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,23 @@ on: - main jobs: + clang_tidy: + runs-on: ${{matrix.os}} + strategy: + matrix: + os: [ ubuntu-22.04, windows-2022 ] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.8' + - uses: ilammy/msvc-dev-cmd@v1 + - uses: lukka/get-cmake@latest + - name: Configure + run: cmake -S. -B build -D VUL_CLANG_TIDY=ON -D VUL_WERROR=ON -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Release -D UPDATE_DEPS=ON -G "Ninja" + - name: Build + run: cmake --build build --verbose + build_and_test: runs-on: ${{matrix.os}} strategy: diff --git a/BUILD.md b/BUILD.md index 85e420a..45b472a 100644 --- a/BUILD.md +++ b/BUILD.md @@ -42,8 +42,6 @@ cd build/ ctest -C Debug --parallel 8 --output-on-failure ``` -## CMake - ### Warnings as errors off by default! By default `VUL_WERROR` is `OFF` @@ -55,3 +53,9 @@ System package managers, and language package managers have to build on multiple By defaulting to `ON` we cause issues for package managers since there is no standard way to disable warnings until CMake 3.24 Add `-D VUL_WERROR=ON` to your workflow. Or use the `dev` preset shown below which will also enabling warnings as errors. + +### clang-tidy + +By default clang-tidy checking is disabled by default. + +To enable it set `VUL_CLANG_TIDY` to `ON`. clang-tidy is required to pass CI. diff --git a/CMakeLists.txt b/CMakeLists.txt index 30a688f..7f5ca8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,15 @@ if (VUL_WERROR) endif() endif() +option(VVL_CLANG_TIDY "Use clang-tidy") +if (VUL_CLANG_TIDY) + find_program(CLANG_TIDY NAMES clang-tidy) + if(NOT CLANG_TIDY) + message(FATAL_ERROR "clang-tidy not found!") + endif() + set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY}") +endif() + if(${CMAKE_CXX_COMPILER_ID} MATCHES "(GNU|Clang)") add_compile_options( -Wall diff --git a/include/vulkan/utility/vul_dispatch_table.h b/include/vulkan/utility/vul_dispatch_table.h index 11eb5b3..95cbba3 100644 --- a/include/vulkan/utility/vul_dispatch_table.h +++ b/include/vulkan/utility/vul_dispatch_table.h @@ -12,6 +12,8 @@ #include +// NOLINTBEGIN(google-readability-casting) + typedef PFN_vkVoidFunction(VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char *pName); // Instance function pointer dispatch table @@ -1573,3 +1575,4 @@ static inline void vulInitInstanceDispatchTable(VkInstance instance, VulInstance #endif // VK_USE_PLATFORM_SCREEN_QNX table->GetPhysicalDeviceOpticalFlowImageFormatsNV = (PFN_vkGetPhysicalDeviceOpticalFlowImageFormatsNV)gipa(instance, "vkGetPhysicalDeviceOpticalFlowImageFormatsNV"); } +// NOLINTEND(google-readability-casting) diff --git a/scripts/generators/dispatch_table_generator.py b/scripts/generators/dispatch_table_generator.py index 95e0680..8d3b4b5 100644 --- a/scripts/generators/dispatch_table_generator.py +++ b/scripts/generators/dispatch_table_generator.py @@ -31,6 +31,8 @@ def generate(self): #include +// NOLINTBEGIN(google-readability-casting) + typedef PFN_vkVoidFunction(VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char *pName); ''') out.append(''' @@ -88,6 +90,8 @@ def generate(self): out.extend([f'#ifdef {command.protect}\n'] if command.protect else []) out.append(f' table->{command.name[2:]} = (PFN_{command.name})gipa(instance, "{command.name}");\n') out.extend([f'#endif // {command.protect}\n'] if command.protect else []) - out.append('}') + out.append('}\n') + + out.append("// NOLINTEND(google-readability-casting)") self.write("".join(out)) diff --git a/src/layer/layer_settings_manager.cpp b/src/layer/layer_settings_manager.cpp index b80b3cc..861a9af 100644 --- a/src/layer/layer_settings_manager.cpp +++ b/src/layer/layer_settings_manager.cpp @@ -79,7 +79,7 @@ static inline bool IsHighIntegrity() { DWORD buffer_size; if (GetTokenInformation(process_token, TokenIntegrityLevel, mandatory_label_buffer, sizeof(mandatory_label_buffer), &buffer_size) != 0) { - const TOKEN_MANDATORY_LABEL *mandatory_label = (const TOKEN_MANDATORY_LABEL *)mandatory_label_buffer; + const TOKEN_MANDATORY_LABEL *mandatory_label = reinterpret_cast(mandatory_label_buffer); const DWORD sub_authority_count = *GetSidSubAuthorityCount(mandatory_label->Label.Sid); const DWORD integrity_level = *GetSidSubAuthority(mandatory_label->Label.Sid, sub_authority_count - 1); @@ -150,17 +150,17 @@ std::filesystem::path LayerSettings::FindSettingsFile() { LSTATUS err = RegOpenKeyEx(hives[hive_index], TEXT("Software\\Khronos\\Vulkan\\Settings"), 0, KEY_READ, &key); if (err == ERROR_SUCCESS) { TCHAR name[2048]; - DWORD i = 0, name_size, type, pValues, value_size; + DWORD i = 0, name_size, type, p_values, value_size; while (ERROR_SUCCESS == RegEnumValue(key, i++, name, &(name_size = sizeof(name)), nullptr, &type, - reinterpret_cast(&pValues), &(value_size = sizeof(pValues)))) { + reinterpret_cast(&p_values), &(value_size = sizeof(p_values)))) { // Check if the registry entry is a dword with a value of zero - if (type != REG_DWORD || pValues != 0) { + if (type != REG_DWORD || p_values != 0) { continue; } // Check if this actually points to a file - DWORD fileAttrib = GetFileAttributes(name); - if ((fileAttrib == INVALID_FILE_ATTRIBUTES) || (fileAttrib & FILE_ATTRIBUTE_DIRECTORY)) { + DWORD file_attrib = GetFileAttributes(name); + if ((file_attrib == INVALID_FILE_ATTRIBUTES) || (file_attrib & FILE_ATTRIBUTE_DIRECTORY)) { continue; } diff --git a/src/layer/layer_settings_util.cpp b/src/layer/layer_settings_util.cpp index d475406..47b1459 100644 --- a/src/layer/layer_settings_util.cpp +++ b/src/layer/layer_settings_util.cpp @@ -41,10 +41,10 @@ std::string GetFileSettingName(const char *pLayerName, const char *pSettingName) assert(pLayerName != nullptr); assert(pSettingName != nullptr); - std::stringstream settingName; - settingName << vl::ToLower(TrimPrefix(pLayerName)) << "." << pSettingName; + std::stringstream setting_name; + setting_name << vl::ToLower(TrimPrefix(pLayerName)) << "." << pSettingName; - return settingName.str(); + return setting_name.str(); } std::string GetEnvSettingName(const char *layer_key, const char *setting_key, TrimMode trim_mode) { @@ -145,7 +145,7 @@ std::string TrimVendor(const std::string &layer_key) { std::string ToLower(const std::string &s) { std::string result = s; for (auto &c : result) { - c = (char)std::tolower(c); + c = static_cast(std::tolower(c)); } return result; } @@ -153,7 +153,7 @@ std::string ToLower(const std::string &s) { std::string ToUpper(const std::string &s) { std::string result = s; for (auto &c : result) { - c = (char)std::toupper(c); + c = static_cast(std::toupper(c)); } return result; } @@ -230,34 +230,34 @@ std::vector ToFrameSets(const std::string &s) { } bool IsFrameSets(const std::string &s) { - static const std::regex FRAME_REGEX("^([0-9]+([-][0-9]+){0,2})(,([0-9]+([-][0-9]+){0,2}))*$"); + static const std::regex frame_regex("^([0-9]+([-][0-9]+){0,2})(,([0-9]+([-][0-9]+){0,2}))*$"); - return std::regex_search(s, FRAME_REGEX); + return std::regex_search(s, frame_regex); } bool IsInteger(const std::string &s) { - static const std::regex FRAME_REGEX("^-?([0-9]*|0x[0-9|a-z|A-Z]*)$"); + static const std::regex frame_regex("^-?([0-9]*|0x[0-9|a-z|A-Z]*)$"); - return std::regex_search(s, FRAME_REGEX); + return std::regex_search(s, frame_regex); } bool IsFloat(const std::string &s) { - static const std::regex FRAME_REGEX("^-?[0-9]*([.][0-9]*f?)?$"); + static const std::regex frame_regex("^-?[0-9]*([.][0-9]*f?)?$"); - return std::regex_search(s, FRAME_REGEX); + return std::regex_search(s, frame_regex); } std::string FormatString(const char *message, ...) { - std::size_t const STRING_BUFFER(4096); + std::size_t const string_buffer(4096); assert(message != nullptr); - assert(strlen(message) >= 1 && strlen(message) < STRING_BUFFER); + assert(strlen(message) >= 1 && strlen(message) < string_buffer); - char buffer[STRING_BUFFER]; + char buffer[string_buffer]; va_list list; va_start(list, message); - vsnprintf(buffer, STRING_BUFFER, message, list); + vsnprintf(buffer, string_buffer, message, list); va_end(list); return buffer; diff --git a/src/layer/vk_layer_settings.cpp b/src/layer/vk_layer_settings.cpp index 6fd652f..3200234 100644 --- a/src/layer/vk_layer_settings.cpp +++ b/src/layer/vk_layer_settings.cpp @@ -25,7 +25,7 @@ void test_helper_SetLayerSetting(VlLayerSettingSet layerSettingSet, const char * assert(pSettingName != nullptr); assert(pValue != nullptr); - vl::LayerSettings *layer_setting_set = (vl::LayerSettings *)layerSettingSet; + vl::LayerSettings *layer_setting_set = reinterpret_cast(layerSettingSet); layer_setting_set->SetFileSetting(pSettingName, pValue); } @@ -36,7 +36,7 @@ VkResult vlCreateLayerSettingSet(const char *pLayerName, const VkLayerSettingsCr (void)pAllocator; vl::LayerSettings* layer_setting_set = new vl::LayerSettings(pLayerName, pCreateInfo, pAllocator, pCallback); - *pLayerSettingSet = (VlLayerSettingSet)layer_setting_set; + *pLayerSettingSet = reinterpret_cast(layer_setting_set); return VK_SUCCESS; } @@ -44,7 +44,7 @@ VkResult vlCreateLayerSettingSet(const char *pLayerName, const VkLayerSettingsCr void vlDestroyLayerSettingSet(VlLayerSettingSet layerSettingSet, const VkAllocationCallbacks *pAllocator) { (void)pAllocator; - vl::LayerSettings *layer_setting_set = (vl::LayerSettings*)layerSettingSet; + vl::LayerSettings *layer_setting_set = reinterpret_cast(layerSettingSet); delete layer_setting_set; } @@ -53,7 +53,7 @@ VkBool32 vlHasLayerSetting(VlLayerSettingSet layerSettingSet, const char *pSetti assert(pSettingName); assert(!std::string(pSettingName).empty()); - vl::LayerSettings *layer_setting_set = (vl::LayerSettings *)layerSettingSet; + vl::LayerSettings *layer_setting_set = reinterpret_cast(layerSettingSet); const bool has_env_setting = layer_setting_set->HasEnvSetting(pSettingName); const bool has_file_setting = layer_setting_set->HasFileSetting(pSettingName); @@ -79,7 +79,7 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * return VK_ERROR_UNKNOWN; } - vl::LayerSettings *layer_setting_set = (vl::LayerSettings *)layerSettingSet; + vl::LayerSettings *layer_setting_set = reinterpret_cast(layerSettingSet); // First: search in the environment variables const std::string &env_setting_list = layer_setting_set->GetEnvSetting(pSettingName); @@ -589,9 +589,9 @@ VkResult vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char * break; case VK_LAYER_SETTING_TYPE_UINT32_EXT: for (std::size_t i = 0, n = settings_cache.size(); i < n; ++i) { - const VlFrameset *asFramesets = static_cast(api_setting->pValues); - settings_cache[i] = vl::FormatString("%d-%d-%d", - asFramesets[i].first, asFramesets[i].count, asFramesets[i].step); + const VlFrameset *as_framesets = static_cast(api_setting->pValues); + settings_cache[i] = vl::FormatString("%d-%d-%d", as_framesets[i].first, as_framesets[i].count, + as_framesets[i].step); } break; default: diff --git a/src/layer/vk_layer_settings_helper.cpp b/src/layer/vk_layer_settings_helper.cpp index 910cf32..43de8fc 100644 --- a/src/layer/vk_layer_settings_helper.cpp +++ b/src/layer/vk_layer_settings_helper.cpp @@ -23,9 +23,9 @@ static std::string Merge(const std::vector &strings) { void vlGetLayerSettingValue(VlLayerSettingSet layerSettingSet, const char *pSettingName, bool &settingValue) { uint32_t value_count = 1; - VkBool32 pValues; - vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &pValues); - settingValue = pValues == VK_TRUE; + VkBool32 p_values; + vlGetLayerSettingValues(layerSettingSet, pSettingName, VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &p_values); + settingValue = p_values == VK_TRUE; } void vlGetLayerSettingValues(VlLayerSettingSet layerSettingSet, const char *pSettingName, std::vector &settingValues) { diff --git a/tests/layer/test_setting_api.cpp b/tests/layer/test_setting_api.cpp index eecb9a9..238aa81 100644 --- a/tests/layer/test_setting_api.cpp +++ b/tests/layer/test_setting_api.cpp @@ -11,24 +11,24 @@ #include "vulkan/layer/vk_layer_settings.h" TEST(test_layer_setting_api, vlHasLayerSetting_NotFound) { - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - EXPECT_FALSE(vlHasLayerSetting(layerSettingSet, "setting_key")); + EXPECT_FALSE(vlHasLayerSetting(layer_setting_set, "setting_key")); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_api, vlHasLayerSetting_Found) { - std::int32_t pValues = 76; + std::int32_t p_values = 76; VkLayerSettingEXT my_setting; my_setting.pLayerName = "VK_LAYER_LUNARG_test"; my_setting.pSettingName = "my_setting"; my_setting.type = VK_LAYER_SETTING_TYPE_INT32_EXT; my_setting.count = 1; - my_setting.pValues = &pValues; + my_setting.pValues = &p_values; std::vector settings; settings.push_back(my_setting); @@ -36,12 +36,12 @@ TEST(test_layer_setting_api, vlHasLayerSetting_Found) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_api, vlHasLayerSetting) { @@ -127,20 +127,20 @@ TEST(test_layer_setting_api, vlHasLayerSetting) { layer_settings_create_info.pSettings = &settings[0]; // The expected layer code side: - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); - - EXPECT_FALSE(vlHasLayerSetting(layerSettingSet, "setting0")); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "bool_value")); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "int32_value")); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "int64_value")); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "uint32_value")); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "uint64_value")); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "float_value")); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "double_value")); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "frameset_value")); - - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); + + EXPECT_FALSE(vlHasLayerSetting(layer_setting_set, "setting0")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "bool_value")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "int32_value")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "int64_value")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "uint32_value")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "uint64_value")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "float_value")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "double_value")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "frameset_value")); + + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_api, vlGetLayerSettingValues_Bool) { @@ -152,14 +152,14 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Bool) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -167,7 +167,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Bool) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(VK_TRUE, values[0]); EXPECT_EQ(VK_FALSE, values[1]); @@ -175,13 +175,13 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Bool) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(VK_TRUE, values[0]); EXPECT_EQ(VK_FALSE, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_api, vlGetLayerSettingValues_Int32) { @@ -193,14 +193,14 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Int32) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 2; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -208,7 +208,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Int32) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -216,13 +216,13 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Int32) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_api, vlGetLayerSettingValues_Int64) { @@ -234,14 +234,14 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Int64) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 2; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -249,7 +249,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Int64) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -257,13 +257,13 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Int64) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_api, vlGetLayerSettingValues_Uint32) { @@ -276,14 +276,14 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Uint32) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -291,7 +291,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Uint32) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -299,13 +299,13 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Uint32) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_api, vlGetLayerSettingValues_Uint64) { @@ -318,14 +318,14 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Uint64) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -333,7 +333,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Uint64) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -341,13 +341,13 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Uint64) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_api, vlGetLayerSettingValues_Float) { @@ -360,14 +360,14 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Float) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -375,20 +375,20 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Float) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); EXPECT_EQ(1, value_count); value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); EXPECT_TRUE(std::abs(values[1] - -82.5f) <= 0.0001f); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_api, vlGetLayerSettingValues_Double) { @@ -401,14 +401,14 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Double) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -416,20 +416,20 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Double) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_EQ(1, value_count); value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_TRUE(std::abs(values[1] - -82.5) <= 0.0001); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_api, vlGetLayerSettingValues_Frameset) { @@ -446,14 +446,14 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Frameset) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(std::size(settings)), settings}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -461,7 +461,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Frameset) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -470,7 +470,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Frameset) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -480,7 +480,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_Frameset) { EXPECT_EQ(1, values[1].step); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_api, vlGetLayerSettingValues_String) { @@ -492,14 +492,14 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_String) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -507,7 +507,7 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_String) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_STREQ("VALUE_A", values[0]); EXPECT_STREQ(nullptr, values[1]); @@ -515,11 +515,11 @@ TEST(test_layer_setting_api, vlGetLayerSettingValues_String) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_STREQ("VALUE_A", values[0]); EXPECT_STREQ("VALUE_B", values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } diff --git a/tests/layer/test_setting_cast.cpp b/tests/layer/test_setting_cast.cpp index d6d7aa2..17f4699 100644 --- a/tests/layer/test_setting_cast.cpp +++ b/tests/layer/test_setting_cast.cpp @@ -21,16 +21,16 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Bool) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values(input_values.size()); uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_EQ(VK_TRUE, values[0]); @@ -39,13 +39,13 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Bool) { std::vector string_values(input_values.size()); result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_STREQ("true", string_values[0]); EXPECT_STREQ("false", string_values[1]); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cast, vlGetLayerSettingValues_Int32) { @@ -57,16 +57,16 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Int32) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values(input_values.size()); uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); @@ -75,13 +75,13 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Int32) { std::vector string_values(input_values.size()); result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_STREQ("76", string_values[0]); EXPECT_STREQ("-82", string_values[1]); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cast, vlGetLayerSettingValues_Int64) { @@ -93,16 +93,16 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Int64) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values(input_values.size()); uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); @@ -111,13 +111,13 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Int64) { std::vector string_values(input_values.size()); result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_STREQ("76", string_values[0]); EXPECT_STREQ("-82", string_values[1]); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cast, vlGetLayerSettingValues_Uint32) { @@ -130,16 +130,16 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Uint32) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values(input_values.size()); uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); @@ -148,13 +148,13 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Uint32) { std::vector string_values(input_values.size()); result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_STREQ("76", string_values[0]); EXPECT_STREQ("82", string_values[1]); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cast, vlGetLayerSettingValues_Uint64) { @@ -167,16 +167,16 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Uint64) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values(input_values.size()); uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_EQ(76, values[0]); @@ -185,13 +185,13 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Uint64) { std::vector string_values(input_values.size()); result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_STREQ("76", string_values[0]); EXPECT_STREQ("82", string_values[1]); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cast, vlGetLayerSettingValues_Float) { @@ -204,16 +204,16 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Float) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values(input_values.size()); uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); @@ -222,13 +222,13 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Float) { std::vector string_values(input_values.size()); result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_TRUE(std::strstr(string_values[0], "76.") != nullptr); EXPECT_TRUE(std::strstr(string_values[1], "-82.5") != nullptr); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cast, vlGetLayerSettingValues_Double) { @@ -241,16 +241,16 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Double) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values(input_values.size()); uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_TRUE(std::abs(values[1] - -82.5) <= 0.0001); @@ -259,13 +259,13 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Double) { std::vector string_values(input_values.size()); result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_TRUE(std::strstr(string_values[0], "76.") != nullptr); EXPECT_TRUE(std::strstr(string_values[1], "-82.5") != nullptr); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cast, vlGetLayerSettingValues_Frameset) { @@ -282,16 +282,16 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Frameset) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values(input_values.size()); uint32_t value_count = 2 * frameset_size; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -302,20 +302,21 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_Frameset) { EXPECT_EQ(6, value_count); value_count = 0; - result_complete = vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET_STRING, &value_count, nullptr); + result_complete = + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET_STRING, &value_count, nullptr); EXPECT_EQ(2, value_count); std::vector string_values(input_values.size()); value_count = 2; - result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET_STRING, &value_count, &string_values[0]); + result_complete = vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET_STRING, &value_count, + &string_values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(2, value_count); EXPECT_STREQ("76-100-10", string_values[0]); EXPECT_STREQ("1-100-1", string_values[1]); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cast, vlGetLayerSettingValues_String) { @@ -327,20 +328,20 @@ TEST(test_layer_setting_cast, vlGetLayerSettingValues_String) { VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, static_cast(settings.size()), &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values(input_values.size()); uint32_t value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_STREQ("VALUE_A", values[0]); EXPECT_STREQ("VALUE_B", values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } diff --git a/tests/layer/test_setting_cpp.cpp b/tests/layer/test_setting_cpp.cpp index 2fbfd1f..e87c0c6 100644 --- a/tests/layer/test_setting_cpp.cpp +++ b/tests/layer/test_setting_cpp.cpp @@ -20,17 +20,17 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Bool) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, 1, &setting}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); - bool pValues = true; - vlGetLayerSettingValue(layerSettingSet, "my_setting", pValues); + bool p_values = true; + vlGetLayerSettingValue(layer_setting_set, "my_setting", p_values); - EXPECT_EQ(true, pValues); + EXPECT_EQ(true, p_values); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Bool) { @@ -45,19 +45,19 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Bool) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, settings_size, settings}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values; - vlGetLayerSettingValues(layerSettingSet, "my_setting", values); + vlGetLayerSettingValues(layer_setting_set, "my_setting", values); EXPECT_EQ(true, values[0]); EXPECT_EQ(false, values[1]); EXPECT_EQ(2, values.size()); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Int32) { @@ -68,17 +68,17 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Int32) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, 1, &setting}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); - std::int32_t pValues; - vlGetLayerSettingValue(layerSettingSet, "my_setting", pValues); + std::int32_t p_values; + vlGetLayerSettingValue(layer_setting_set, "my_setting", p_values); - EXPECT_EQ(76, pValues); + EXPECT_EQ(76, p_values); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Int32) { @@ -93,19 +93,19 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Int32) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, settings_size, settings}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values; - vlGetLayerSettingValues(layerSettingSet, "my_setting", values); + vlGetLayerSettingValues(layer_setting_set, "my_setting", values); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); EXPECT_EQ(2, values.size()); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Uint32) { @@ -116,17 +116,17 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Uint32) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, 1, &setting}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); - std::uint32_t pValues; - vlGetLayerSettingValue(layerSettingSet, "my_setting", pValues); + std::uint32_t p_values; + vlGetLayerSettingValue(layer_setting_set, "my_setting", p_values); - EXPECT_EQ(76, pValues); + EXPECT_EQ(76, p_values); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Uint32) { @@ -141,19 +141,19 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Uint32) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, settings_size, settings}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values; - vlGetLayerSettingValues(layerSettingSet, "my_setting", values); + vlGetLayerSettingValues(layer_setting_set, "my_setting", values); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); EXPECT_EQ(2, values.size()); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Int64) { @@ -164,17 +164,17 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Int64) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, 1, &setting}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); - std::int64_t pValues; - vlGetLayerSettingValue(layerSettingSet, "my_setting", pValues); + std::int64_t p_values; + vlGetLayerSettingValue(layer_setting_set, "my_setting", p_values); - EXPECT_EQ(76, pValues); + EXPECT_EQ(76, p_values); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Int64) { @@ -189,19 +189,19 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Int64) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, settings_size, &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values; - vlGetLayerSettingValues(layerSettingSet, "my_setting", values); + vlGetLayerSettingValues(layer_setting_set, "my_setting", values); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); EXPECT_EQ(2, values.size()); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Uint64) { @@ -212,17 +212,17 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Uint64) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, 1, &setting}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); - std::uint64_t pValues; - vlGetLayerSettingValue(layerSettingSet, "my_setting", pValues); + std::uint64_t p_values; + vlGetLayerSettingValue(layer_setting_set, "my_setting", p_values); - EXPECT_EQ(76, pValues); + EXPECT_EQ(76, p_values); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Uint64) { @@ -237,19 +237,19 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Uint64) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, settings_size, settings}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values; - vlGetLayerSettingValues(layerSettingSet, "my_setting", values); + vlGetLayerSettingValues(layer_setting_set, "my_setting", values); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); EXPECT_EQ(2, values.size()); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Float) { @@ -260,17 +260,17 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Float) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, 1, &setting}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); - float pValues; - vlGetLayerSettingValue(layerSettingSet, "my_setting", pValues); + float p_values; + vlGetLayerSettingValue(layer_setting_set, "my_setting", p_values); - EXPECT_TRUE(std::abs(pValues - -82.5f) <= 0.0001f); + EXPECT_TRUE(std::abs(p_values - -82.5f) <= 0.0001f); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Float) { @@ -285,19 +285,19 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Float) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, settings_size, settings}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values; - vlGetLayerSettingValues(layerSettingSet, "my_setting", values); + vlGetLayerSettingValues(layer_setting_set, "my_setting", values); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); EXPECT_TRUE(std::abs(values[1] - -82.5f) <= 0.0001f); EXPECT_EQ(2, values.size()); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Double) { @@ -308,17 +308,17 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Double) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, 1, &setting}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); - double pValues; - vlGetLayerSettingValue(layerSettingSet, "my_setting", pValues); + double p_values; + vlGetLayerSettingValue(layer_setting_set, "my_setting", p_values); - EXPECT_TRUE(std::abs(pValues - -82.5) <= 0.0001); + EXPECT_TRUE(std::abs(p_values - -82.5) <= 0.0001); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Double) { @@ -333,19 +333,19 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Double) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, settings_size, settings}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values; - vlGetLayerSettingValues(layerSettingSet, "my_setting", values); + vlGetLayerSettingValues(layer_setting_set, "my_setting", values); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_TRUE(std::abs(values[1] - -82.5) <= 0.0001); EXPECT_EQ(2, values.size()); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValue_String) { @@ -356,14 +356,14 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValue_String) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, 1, &setting}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - std::string pValues; - vlGetLayerSettingValue(layerSettingSet, "my_setting", pValues); - EXPECT_STREQ("VALUE_A", pValues.c_str()); + std::string p_values; + vlGetLayerSettingValue(layer_setting_set, "my_setting", p_values); + EXPECT_STREQ("VALUE_A", p_values.c_str()); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Strings) { @@ -378,14 +378,14 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Strings) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, settings_size, settings}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - std::string pValues; - vlGetLayerSettingValue(layerSettingSet, "my_setting", pValues); - EXPECT_STREQ("VALUE_A,VALUE_B", pValues.c_str()); + std::string p_values; + vlGetLayerSettingValue(layer_setting_set, "my_setting", p_values); + EXPECT_STREQ("VALUE_A,VALUE_B", p_values.c_str()); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValues_String) { @@ -400,18 +400,18 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValues_String) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, settings_size, settings}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values; - vlGetLayerSettingValues(layerSettingSet, "my_setting", values); + vlGetLayerSettingValues(layer_setting_set, "my_setting", values); EXPECT_STREQ("VALUE_A", values[0].c_str()); EXPECT_STREQ("VALUE_B", values[1].c_str()); EXPECT_EQ(2, values.size()); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Frameset) { @@ -422,19 +422,19 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValue_Frameset) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, 1, &setting}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); - VlFrameset pValues; - vlGetLayerSettingValue(layerSettingSet, "my_setting", pValues); + VlFrameset p_values; + vlGetLayerSettingValue(layer_setting_set, "my_setting", p_values); - EXPECT_EQ(76, pValues.first); - EXPECT_EQ(100, pValues.count); - EXPECT_EQ(10, pValues.step); + EXPECT_EQ(76, p_values.first); + EXPECT_EQ(100, p_values.count); + EXPECT_EQ(10, p_values.step); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Frameset) { @@ -451,13 +451,13 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Frameset) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, settings_size, settings}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values; - vlGetLayerSettingValues(layerSettingSet, "my_setting", values); + vlGetLayerSettingValues(layer_setting_set, "my_setting", values); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -467,7 +467,7 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValues_Frameset) { EXPECT_EQ(1, values[1].step); EXPECT_EQ(2, values.size()); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_cpp, vlGetLayerSettingValues_VlCustomSTypeInfo) { @@ -482,17 +482,17 @@ TEST(test_layer_setting_cpp, vlGetLayerSettingValues_VlCustomSTypeInfo) { const VkLayerSettingsCreateInfoEXT layer_settings_create_info{ VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, settings_size, &settings[0]}; - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", &layer_settings_create_info, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); std::vector values; - vlGetLayerSettingValues(layerSettingSet, "my_setting", values); + vlGetLayerSettingValues(layer_setting_set, "my_setting", values); EXPECT_EQ(0x76, values[0].first); EXPECT_EQ(0x82, values[0].second); EXPECT_EQ(76, values[1].first); EXPECT_EQ(82, values[1].second); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } diff --git a/tests/layer/test_setting_env.cpp b/tests/layer/test_setting_env.cpp index 227e54b..7fbca95 100644 --- a/tests/layer/test_setting_env.cpp +++ b/tests/layer/test_setting_env.cpp @@ -15,89 +15,89 @@ TEST(test_layer_setting_env, EnvVar_TrimNone) { putenv(const_cast("VK_LUNARG_TEST_MY_SETTING_A=true,false")); - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting_a")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting_a")); uint32_t value_count_a = 0; VkResult result_count_a = - vlGetLayerSettingValues(layerSettingSet, "my_setting_a", VL_LAYER_SETTING_TYPE_BOOL32, &value_count_a, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting_a", VL_LAYER_SETTING_TYPE_BOOL32, &value_count_a, nullptr); EXPECT_EQ(VK_SUCCESS, result_count_a); EXPECT_EQ(2, value_count_a); std::vector values_a(static_cast(value_count_a)); VkResult result_complete_a = - vlGetLayerSettingValues(layerSettingSet, "my_setting_a", VL_LAYER_SETTING_TYPE_BOOL32, &value_count_a, &values_a[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting_a", VL_LAYER_SETTING_TYPE_BOOL32, &value_count_a, &values_a[0]); EXPECT_EQ(VK_SUCCESS, result_complete_a); EXPECT_EQ(VK_TRUE, values_a[0]); EXPECT_EQ(VK_FALSE, values_a[1]); EXPECT_EQ(2, value_count_a); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_env, EnvVar_TrimVendor) { putenv(const_cast("VK_TEST_MY_SETTING_B=true,false")); - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting_b")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting_b")); uint32_t value_count_b = 0; VkResult result_count_b = - vlGetLayerSettingValues(layerSettingSet, "my_setting_b", VL_LAYER_SETTING_TYPE_BOOL32, &value_count_b, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting_b", VL_LAYER_SETTING_TYPE_BOOL32, &value_count_b, nullptr); EXPECT_EQ(VK_SUCCESS, result_count_b); EXPECT_EQ(2, value_count_b); std::vector values_b(static_cast(value_count_b)); VkResult result_complete_b = - vlGetLayerSettingValues(layerSettingSet, "my_setting_b", VL_LAYER_SETTING_TYPE_BOOL32, &value_count_b, &values_b[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting_b", VL_LAYER_SETTING_TYPE_BOOL32, &value_count_b, &values_b[0]); EXPECT_EQ(VK_SUCCESS, result_complete_b); EXPECT_EQ(VK_TRUE, values_b[0]); EXPECT_EQ(VK_FALSE, values_b[1]); EXPECT_EQ(2, value_count_b); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_env, EnvVar_TrimNamespace) { putenv(const_cast("VK_MY_SETTING_C=true,false")); - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting_c")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting_c")); uint32_t value_count_c = 0; VkResult result_count_c = - vlGetLayerSettingValues(layerSettingSet, "my_setting_c", VL_LAYER_SETTING_TYPE_BOOL32, &value_count_c, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting_c", VL_LAYER_SETTING_TYPE_BOOL32, &value_count_c, nullptr); EXPECT_EQ(VK_SUCCESS, result_count_c); EXPECT_EQ(2, value_count_c); std::vector values_c(static_cast(value_count_c)); VkResult result_complete_c = - vlGetLayerSettingValues(layerSettingSet, "my_setting_c", VL_LAYER_SETTING_TYPE_BOOL32, &value_count_c, &values_c[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting_c", VL_LAYER_SETTING_TYPE_BOOL32, &value_count_c, &values_c[0]); EXPECT_EQ(VK_SUCCESS, result_complete_c); EXPECT_EQ(VK_TRUE, values_c[0]); EXPECT_EQ(VK_FALSE, values_c[1]); EXPECT_EQ(2, value_count_c); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_env, vlGetLayerSettingValues_Bool) { putenv(const_cast("VK_LUNARG_TEST_MY_SETTING=true,false")); - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -105,7 +105,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Bool) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(VK_TRUE, values[0]); EXPECT_EQ(VK_FALSE, values[1]); @@ -113,26 +113,26 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Bool) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(VK_TRUE, values[0]); EXPECT_EQ(VK_FALSE, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_env, vlGetLayerSettingValues_Int32) { putenv(const_cast("VK_LUNARG_TEST_MY_SETTING=76,-82")); - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 2; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -140,7 +140,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Int32) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -148,26 +148,26 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Int32) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_env, vlGetLayerSettingValues_Int64) { putenv(const_cast("VK_LUNARG_TEST_MY_SETTING=76,-82")); - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 2; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -175,7 +175,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Int64) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -183,26 +183,26 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Int64) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_env, vlGetLayerSettingValues_Uint32) { putenv(const_cast("VK_LUNARG_TEST_MY_SETTING=76,82")); - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -210,7 +210,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Uint32) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -218,26 +218,26 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Uint32) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_env, vlGetLayerSettingValues_Uint64) { putenv(const_cast("VK_LUNARG_TEST_MY_SETTING=76,82")); - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -245,7 +245,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Uint64) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -253,26 +253,26 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Uint64) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_env, vlGetLayerSettingValues_Float) { putenv(const_cast("VK_LUNARG_TEST_MY_SETTING=76.1f,-82.5f")); - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -280,33 +280,33 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Float) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); EXPECT_EQ(1, value_count); value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); EXPECT_TRUE(std::abs(values[1] - -82.5f) <= 0.0001f); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_env, vlGetLayerSettingValues_Double) { putenv(const_cast("VK_LUNARG_TEST_MY_SETTING=76.1,-82.5")); - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -314,33 +314,33 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Double) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_EQ(1, value_count); value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_TRUE(std::abs(values[1] - -82.5) <= 0.0001); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_env, vlGetLayerSettingValues_Frameset) { putenv(const_cast("VK_LUNARG_TEST_MY_SETTING=76-100-10,1-100-1")); - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -348,7 +348,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Frameset) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -357,7 +357,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Frameset) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -367,20 +367,20 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_Frameset) { EXPECT_EQ(1, values[1].step); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_env, vlGetLayerSettingValues_String) { putenv(const_cast("VK_LUNARG_TEST_MY_SETTING=VALUE_A,VALUE_B")); - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -388,7 +388,7 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_String) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_STREQ("VALUE_A", values[0]); EXPECT_STREQ(nullptr, values[1]); @@ -396,11 +396,11 @@ TEST(test_layer_setting_env, vlGetLayerSettingValues_String) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_STREQ("VALUE_A", values[0]); EXPECT_STREQ("VALUE_B", values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } diff --git a/tests/layer/test_setting_file.cpp b/tests/layer/test_setting_file.cpp index c6f17fc..61f7dde 100644 --- a/tests/layer/test_setting_file.cpp +++ b/tests/layer/test_setting_file.cpp @@ -14,16 +14,16 @@ void test_helper_SetLayerSetting(VlLayerSettingSet layerSettingSet, const char *pSettingName, const char *pValue); TEST(test_layer_setting_file, vlGetLayerSettingValues_Bool) { - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - test_helper_SetLayerSetting(layerSettingSet, "lunarg_test.my_setting", "true,false"); + test_helper_SetLayerSetting(layer_setting_set, "lunarg_test.my_setting", "true,false"); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -31,7 +31,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Bool) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(VK_TRUE, values[0]); EXPECT_EQ(VK_FALSE, values[1]); @@ -39,26 +39,26 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Bool) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_BOOL32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(VK_TRUE, values[0]); EXPECT_EQ(VK_FALSE, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_file, vlGetLayerSettingValues_Int32) { - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - test_helper_SetLayerSetting(layerSettingSet, "lunarg_test.my_setting", "76,-82"); + test_helper_SetLayerSetting(layer_setting_set, "lunarg_test.my_setting", "76,-82"); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 2; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -66,7 +66,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Int32) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -74,26 +74,26 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Int32) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_file, vlGetLayerSettingValues_Int64) { - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - test_helper_SetLayerSetting(layerSettingSet, "lunarg_test.my_setting", "76,-82"); + test_helper_SetLayerSetting(layer_setting_set, "lunarg_test.my_setting", "76,-82"); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 2; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -101,7 +101,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Int64) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -109,26 +109,26 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Int64) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_INT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(-82, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_file, vlGetLayerSettingValues_Uint32) { - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - test_helper_SetLayerSetting(layerSettingSet, "lunarg_test.my_setting", "76,82"); + test_helper_SetLayerSetting(layer_setting_set, "lunarg_test.my_setting", "76,82"); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -136,7 +136,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Uint32) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -144,26 +144,26 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Uint32) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_file, vlGetLayerSettingValues_Uint64) { - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - test_helper_SetLayerSetting(layerSettingSet, "lunarg_test.my_setting", "76,82"); + test_helper_SetLayerSetting(layer_setting_set, "lunarg_test.my_setting", "76,82"); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -171,7 +171,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Uint64) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0]); EXPECT_EQ(0, values[1]); @@ -179,26 +179,26 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Uint64) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_UINT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0]); EXPECT_EQ(82, values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_file, vlGetLayerSettingValues_Float) { - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - test_helper_SetLayerSetting(layerSettingSet, "lunarg_test.my_setting", "76.1f,-82.5f"); + test_helper_SetLayerSetting(layer_setting_set, "lunarg_test.my_setting", "76.1f,-82.5f"); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -206,33 +206,33 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Float) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); EXPECT_EQ(1, value_count); value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT32, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_TRUE(std::abs(values[0] - 76.1f) <= 0.0001f); EXPECT_TRUE(std::abs(values[1] - -82.5f) <= 0.0001f); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_file, vlGetLayerSettingValues_Double) { - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - test_helper_SetLayerSetting(layerSettingSet, "lunarg_test.my_setting", "76.1,-82.5"); + test_helper_SetLayerSetting(layer_setting_set, "lunarg_test.my_setting", "76.1,-82.5"); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -240,33 +240,33 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Double) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_EQ(1, value_count); value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FLOAT64, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_TRUE(std::abs(values[0] - 76.1) <= 0.0001); EXPECT_TRUE(std::abs(values[1] - -82.5) <= 0.0001); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_file, vlGetLayerSettingValues_Frameset) { - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - test_helper_SetLayerSetting(layerSettingSet, "lunarg_test.my_setting", "76-100-10,1-100-1"); + test_helper_SetLayerSetting(layer_setting_set, "lunarg_test.my_setting", "76-100-10,1-100-1"); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -274,7 +274,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Frameset) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -283,7 +283,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Frameset) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_FRAMESET, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_EQ(76, values[0].first); EXPECT_EQ(100, values[0].count); @@ -293,20 +293,20 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_Frameset) { EXPECT_EQ(1, values[1].step); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } TEST(test_layer_setting_file, vlGetLayerSettingValues_String) { - VlLayerSettingSet layerSettingSet = VK_NULL_HANDLE; - vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layerSettingSet); + VlLayerSettingSet layer_setting_set = VK_NULL_HANDLE; + vlCreateLayerSettingSet("VK_LAYER_LUNARG_test", nullptr, nullptr, nullptr, &layer_setting_set); - test_helper_SetLayerSetting(layerSettingSet, "lunarg_test.my_setting", "VALUE_A,VALUE_B"); + test_helper_SetLayerSetting(layer_setting_set, "lunarg_test.my_setting", "VALUE_A,VALUE_B"); - EXPECT_TRUE(vlHasLayerSetting(layerSettingSet, "my_setting")); + EXPECT_TRUE(vlHasLayerSetting(layer_setting_set, "my_setting")); uint32_t value_count = 0; VkResult result_count = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, nullptr); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, nullptr); EXPECT_EQ(VK_SUCCESS, result_count); EXPECT_EQ(2, value_count); @@ -314,7 +314,7 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_String) { value_count = 1; VkResult result_incomplete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); EXPECT_EQ(VK_INCOMPLETE, result_incomplete); EXPECT_STREQ("VALUE_A", values[0]); EXPECT_STREQ(nullptr, values[1]); @@ -322,11 +322,11 @@ TEST(test_layer_setting_file, vlGetLayerSettingValues_String) { value_count = 2; VkResult result_complete = - vlGetLayerSettingValues(layerSettingSet, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); + vlGetLayerSettingValues(layer_setting_set, "my_setting", VL_LAYER_SETTING_TYPE_STRING, &value_count, &values[0]); EXPECT_EQ(VK_SUCCESS, result_complete); EXPECT_STREQ("VALUE_A", values[0]); EXPECT_STREQ("VALUE_B", values[1]); EXPECT_EQ(2, value_count); - vlDestroyLayerSettingSet(layerSettingSet, nullptr); + vlDestroyLayerSettingSet(layer_setting_set, nullptr); } diff --git a/tests/layer/test_setting_util.cpp b/tests/layer/test_setting_util.cpp index 024dde5..9025009 100644 --- a/tests/layer/test_setting_util.cpp +++ b/tests/layer/test_setting_util.cpp @@ -12,56 +12,56 @@ #include TEST(test_layer_settings_util, FindSettingsInChain_found_first) { - VkDebugReportCallbackCreateInfoEXT debugReportCallbackCreateInfo{}; - debugReportCallbackCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT; + VkDebugReportCallbackCreateInfoEXT debug_report_callback_create_info{}; + debug_report_callback_create_info.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT; - VkLayerSettingsCreateInfoEXT layerSettingsCreateInfo{}; - layerSettingsCreateInfo.sType = VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT; - layerSettingsCreateInfo.pNext = &debugReportCallbackCreateInfo; + VkLayerSettingsCreateInfoEXT layer_settings_create_info{}; + layer_settings_create_info.sType = VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT; + layer_settings_create_info.pNext = &debug_report_callback_create_info; - VkInstanceCreateInfo instanceCreateInfo{}; - instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; - instanceCreateInfo.pNext = &layerSettingsCreateInfo; + VkInstanceCreateInfo instance_create_info{}; + instance_create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; + instance_create_info.pNext = &layer_settings_create_info; - EXPECT_EQ(&layerSettingsCreateInfo, vlFindLayerSettingsCreateInfo(&instanceCreateInfo)); + EXPECT_EQ(&layer_settings_create_info, vlFindLayerSettingsCreateInfo(&instance_create_info)); } TEST(test_layer_settings_util, FindSettingsInChain_found_last) { - VkLayerSettingsCreateInfoEXT layerSettingsCreateInfo{}; - layerSettingsCreateInfo.sType = VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT; + VkLayerSettingsCreateInfoEXT layer_settings_create_info{}; + layer_settings_create_info.sType = VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT; - VkDebugReportCallbackCreateInfoEXT debugReportCallbackCreateInfo{}; - debugReportCallbackCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT; - debugReportCallbackCreateInfo.pNext = &layerSettingsCreateInfo; + VkDebugReportCallbackCreateInfoEXT debug_report_callback_create_info{}; + debug_report_callback_create_info.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT; + debug_report_callback_create_info.pNext = &layer_settings_create_info; - VkInstanceCreateInfo instanceCreateInfo{}; - instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; - instanceCreateInfo.pNext = &debugReportCallbackCreateInfo; + VkInstanceCreateInfo instance_create_info{}; + instance_create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; + instance_create_info.pNext = &debug_report_callback_create_info; - EXPECT_EQ(&layerSettingsCreateInfo, vlFindLayerSettingsCreateInfo(&instanceCreateInfo)); + EXPECT_EQ(&layer_settings_create_info, vlFindLayerSettingsCreateInfo(&instance_create_info)); } TEST(test_layer_settings_util, FindSettingsInChain_found_not) { - VkDebugReportCallbackCreateInfoEXT debugReportCallbackCreateInfo{}; - debugReportCallbackCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT; + VkDebugReportCallbackCreateInfoEXT debug_report_callback_create_info{}; + debug_report_callback_create_info.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT; - VkInstanceCreateInfo instanceCreateInfo{}; - instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; - instanceCreateInfo.pNext = &debugReportCallbackCreateInfo; + VkInstanceCreateInfo instance_create_info{}; + instance_create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; + instance_create_info.pNext = &debug_report_callback_create_info; - EXPECT_EQ(nullptr, vlFindLayerSettingsCreateInfo(&instanceCreateInfo)); + EXPECT_EQ(nullptr, vlFindLayerSettingsCreateInfo(&instance_create_info)); } TEST(test_layer_settings_util, FindDelimiter) { - char A = vl::FindDelimiter("VALUE_A,VALUE_B"); - EXPECT_EQ(',', A); + char a = vl::FindDelimiter("VALUE_A,VALUE_B"); + EXPECT_EQ(',', a); #ifdef WIN32 char B = vl::FindDelimiter("VALUE_A;VALUE_B"); EXPECT_EQ(';', B); #else - char C = vl::FindDelimiter("VALUE_A:VALUE_B"); - EXPECT_EQ(':', C); + char c = vl::FindDelimiter("VALUE_A:VALUE_B"); + EXPECT_EQ(':', c); #endif EXPECT_EQ(',', vl::FindDelimiter("VALUE_A")); @@ -72,24 +72,24 @@ TEST(test_layer_settings_util, FindDelimiter) { } TEST(test_layer_settings_util, Split_1Value) { - std::string pValues("VALUE_A"); - std::vector reault = vl::Split(pValues, ','); + std::string p_values("VALUE_A"); + std::vector reault = vl::Split(p_values, ','); EXPECT_EQ(1, reault.size()); EXPECT_STREQ("VALUE_A", reault[0].c_str()); } TEST(test_layer_settings_util, Split_1Value_ExtraComma) { - std::string pValues("VALUE_A,"); - std::vector reault = vl::Split(pValues, ','); + std::string p_values("VALUE_A,"); + std::vector reault = vl::Split(p_values, ','); EXPECT_EQ(1, reault.size()); EXPECT_STREQ("VALUE_A", reault[0].c_str()); } TEST(test_layer_settings_util, Split_2Values) { - std::string pValues("VALUE_A,VALUE_B"); - std::vector reault = vl::Split(pValues, ','); + std::string p_values("VALUE_A,VALUE_B"); + std::vector reault = vl::Split(p_values, ','); EXPECT_EQ(2, reault.size()); EXPECT_STREQ("VALUE_A", reault[0].c_str()); @@ -97,8 +97,8 @@ TEST(test_layer_settings_util, Split_2Values) { } TEST(test_layer_settings_util, Split_2Values_ExtraComma) { - std::string pValues("VALUE_A,VALUE_B,"); - std::vector reault = vl::Split(pValues, ','); + std::string p_values("VALUE_A,VALUE_B,"); + std::vector reault = vl::Split(p_values, ','); EXPECT_EQ(2, reault.size()); EXPECT_STREQ("VALUE_A", reault[0].c_str()); @@ -106,59 +106,59 @@ TEST(test_layer_settings_util, Split_2Values_ExtraComma) { } TEST(test_layer_settings_util, Split_2Values_WrongSeparator) { - std::string pValues("VALUE_A,VALUE_B"); - std::vector reault = vl::Split(pValues, ';'); + std::string p_values("VALUE_A,VALUE_B"); + std::vector reault = vl::Split(p_values, ';'); EXPECT_EQ(1, reault.size()); EXPECT_STREQ("VALUE_A,VALUE_B", reault[0].c_str()); } TEST(test_layer_settings_util, Split_0Value) { - std::string pValues(""); - std::vector result = vl::Split(pValues, ','); + std::string p_values(""); + std::vector result = vl::Split(p_values, ','); EXPECT_EQ(0, result.size()); } TEST(test_layer_settings_util, TrimWhitespace_NoWhitespace) { - std::string pValues("VALUE_A-VALUE_B"); - std::string result = vl::TrimWhitespace(pValues); + std::string p_values("VALUE_A-VALUE_B"); + std::string result = vl::TrimWhitespace(p_values); EXPECT_STREQ("VALUE_A-VALUE_B", result.c_str()); } TEST(test_layer_settings_util, TrimWhitespace_space) { { - const std::string pValues("VALUE_A "); - const std::string result = vl::TrimWhitespace(pValues); + const std::string p_values("VALUE_A "); + const std::string result = vl::TrimWhitespace(p_values); EXPECT_STREQ("VALUE_A", result.c_str()); } { - const std::string pValues(" VALUE_A"); - const std::string result = vl::TrimWhitespace(pValues); + const std::string p_values(" VALUE_A"); + const std::string result = vl::TrimWhitespace(p_values); EXPECT_STREQ("VALUE_A", result.c_str()); } { - const std::string pValues(" VALUE_A "); - const std::string result = vl::TrimWhitespace(pValues); + const std::string p_values(" VALUE_A "); + const std::string result = vl::TrimWhitespace(p_values); EXPECT_STREQ("VALUE_A", result.c_str()); } { - const std::string pValues("VALUE A"); - const std::string result = vl::TrimWhitespace(pValues); + const std::string p_values("VALUE A"); + const std::string result = vl::TrimWhitespace(p_values); EXPECT_STREQ("VALUE A", result.c_str()); } { - const std::string pValues(" VALUE A "); - const std::string result = vl::TrimWhitespace(pValues); + const std::string p_values(" VALUE A "); + const std::string result = vl::TrimWhitespace(p_values); EXPECT_STREQ("VALUE A", result.c_str()); } @@ -166,36 +166,36 @@ TEST(test_layer_settings_util, TrimWhitespace_space) { TEST(test_layer_settings_util, TrimWhitespace_Whitespace) { { - const std::string pValues("VALUE_A\n"); - const std::string result = vl::TrimWhitespace(pValues); + const std::string p_values("VALUE_A\n"); + const std::string result = vl::TrimWhitespace(p_values); EXPECT_STREQ("VALUE_A", result.c_str()); } { - const std::string pValues("\f\tVALUE_A"); - const std::string result = vl::TrimWhitespace(pValues); + const std::string p_values("\f\tVALUE_A"); + const std::string result = vl::TrimWhitespace(p_values); EXPECT_STREQ("VALUE_A", result.c_str()); } { - const std::string pValues("\t\vVALUE_A\n\r"); - const std::string result = vl::TrimWhitespace(pValues); + const std::string p_values("\t\vVALUE_A\n\r"); + const std::string result = vl::TrimWhitespace(p_values); EXPECT_STREQ("VALUE_A", result.c_str()); } { - const std::string pValues("VALUE\tA\f"); - const std::string result = vl::TrimWhitespace(pValues); + const std::string p_values("VALUE\tA\f"); + const std::string result = vl::TrimWhitespace(p_values); EXPECT_STREQ("VALUE\tA", result.c_str()); } { - const std::string pValues("\f\tVALUE\tA\t\f"); - const std::string result = vl::TrimWhitespace(pValues); + const std::string p_values("\f\tVALUE\tA\t\f"); + const std::string result = vl::TrimWhitespace(p_values); EXPECT_STREQ("VALUE\tA", result.c_str()); } @@ -203,29 +203,29 @@ TEST(test_layer_settings_util, TrimWhitespace_Whitespace) { TEST(test_layer_settings_util, TrimPrefix) { { - const std::string pValues("VK_LAYER_LUNARG_test"); - const std::string result = vl::TrimPrefix(pValues); + const std::string p_values("VK_LAYER_LUNARG_test"); + const std::string result = vl::TrimPrefix(p_values); EXPECT_STREQ("LUNARG_test", result.c_str()); } { - const std::string pValues("VK_LAYER_LUNARG_test_pouet"); - const std::string result = vl::TrimPrefix(pValues); + const std::string p_values("VK_LAYER_LUNARG_test_pouet"); + const std::string result = vl::TrimPrefix(p_values); EXPECT_STREQ("LUNARG_test_pouet", result.c_str()); } { - const std::string pValues("VK_LAYER_LUNARG_test_POUET"); - const std::string result = vl::TrimPrefix(pValues); + const std::string p_values("VK_LAYER_LUNARG_test_POUET"); + const std::string result = vl::TrimPrefix(p_values); EXPECT_STREQ("LUNARG_test_POUET", result.c_str()); } { - const std::string pValues("VK_LAYER_lunarg_test_POUET"); - const std::string result = vl::TrimPrefix(pValues); + const std::string p_values("VK_LAYER_lunarg_test_POUET"); + const std::string result = vl::TrimPrefix(p_values); EXPECT_STREQ("lunarg_test_POUET", result.c_str()); } @@ -233,29 +233,29 @@ TEST(test_layer_settings_util, TrimPrefix) { TEST(test_layer_settings_util, TrimVendor) { { - const std::string pValues("VK_LAYER_LUNARG_test"); - const std::string result = vl::TrimVendor(pValues); + const std::string p_values("VK_LAYER_LUNARG_test"); + const std::string result = vl::TrimVendor(p_values); EXPECT_STREQ("test", result.c_str()); } { - const std::string pValues("VK_LAYER_LUNARG_test_pouet"); - const std::string result = vl::TrimVendor(pValues); + const std::string p_values("VK_LAYER_LUNARG_test_pouet"); + const std::string result = vl::TrimVendor(p_values); EXPECT_STREQ("test_pouet", result.c_str()); } { - const std::string pValues("VK_LAYER_LUNARG_test_POUET"); - const std::string result = vl::TrimVendor(pValues); + const std::string p_values("VK_LAYER_LUNARG_test_POUET"); + const std::string result = vl::TrimVendor(p_values); EXPECT_STREQ("test_POUET", result.c_str()); } { - const std::string pValues("VK_LAYER_lunarg_test_POUET"); - const std::string result = vl::TrimVendor(pValues); + const std::string p_values("VK_LAYER_lunarg_test_POUET"); + const std::string result = vl::TrimVendor(p_values); EXPECT_STREQ("test_POUET", result.c_str()); }