Files
Sunshine/tests/unit/test_nvprefs_configuration.cpp
T
ReenigneArcher 15b06f1707 refactor(config): inject owned settings into runtime services
Replace namespace configuration state with an application-owned store. Pass immutable startup settings into services, platform capture and encoder contexts, network helpers, CLI commands, and tray callbacks. Keep runtime credentials in synchronized snapshots and gamepad policy in its input owner.

Validation: UCRT64 sunshine, test_sunshine, audio-info, and sunshinesvc builds with tray support; 566 regression tests passed and 5 device/workflow tests skipped; strict production Doxygen, required clang-format, and CLI smoke checks passed. Full Linux/macOS builds, hardware coverage, and hosted Sonar reanalysis remain CI validation.
2026-10-11 14:37:32 -04:00

25 lines
973 B
C++

/**
* @file tests/unit/test_nvprefs_configuration.cpp
* @brief Test per-host NVIDIA profile policy.
*/
#include "../tests_common.h"
#ifdef _WIN32
#include <src/platform/windows/nvprefs/nvprefs_common.h>
TEST(NvPrefsConfigurationTest, IndependentHostsUseOnlyTheirOwnProfilePolicy) {
config::settings_t first;
first.video.nv_opengl_vulkan_on_dxgi = false;
first.video.nv_sunshine_high_power_mode = true;
config::settings_t second;
second.video.nv_opengl_vulkan_on_dxgi = true;
second.video.nv_sunshine_high_power_mode = false;
const auto first_policy = nvprefs::get_nvprefs_options(first);
const auto second_policy = nvprefs::get_nvprefs_options(second);
EXPECT_FALSE(first_policy.opengl_vulkan_on_dxgi);
EXPECT_TRUE(first_policy.sunshine_high_power_mode);
EXPECT_TRUE(second_policy.opengl_vulkan_on_dxgi);
EXPECT_FALSE(second_policy.sunshine_high_power_mode);
EXPECT_FALSE(nvprefs::get_nvprefs_options(first).opengl_vulkan_on_dxgi);
}
#endif