25 lines
830 B
Rust
25 lines
830 B
Rust
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
use molotov_bootstrap::fflags::{FastFlagManager, PresetProfile};
|
|
|
|
#[test]
|
|
fn test_low_vram_preset_contains_mip_skip() {
|
|
let manager = FastFlagManager::new();
|
|
let profile = manager.get_preset(PresetProfile::LowVram);
|
|
|
|
assert_eq!(
|
|
profile.get_int("FIntDebugTextureManagerSkipMips"),
|
|
Some(1),
|
|
"Low VRAM preset must set FIntDebugTextureManagerSkipMips to 1"
|
|
);
|
|
}
|
|
|
|
#[test]
|
|
fn test_allowlist_validation_warning() {
|
|
let mut manager = FastFlagManager::new();
|
|
manager.set_flag("FIntDebugTextureManagerSkipMips", 1.into());
|
|
manager.set_flag("FUnknownArbitraryFlagExploit", true.into());
|
|
|
|
let warnings = manager.validate_against_allowlist();
|
|
assert_eq!(warnings.len(), 1);
|
|
assert_eq!(warnings[0], "FUnknownArbitraryFlagExploit");
|
|
}
|