ScalingSettings::MinPartiality: validate the argument, not the value it replaces

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu
(cherry picked from commit df5f2ae22f979a5569f4d569fe2a8cdd5999d242)
This commit is contained in:
leonarski_f committed 2026-10-25 07:20:21 +01:00
1 parent 2dbb9d5951
commit 925701a1ce
2 files changed
+10 -1

No files matched your search

+9
View File
@@ -1143,3 +1143,12 @@ TEST_CASE("MergeOnTheFly_CaptureTermDownweightsPartials") {
CHECK(with < without);
CHECK(with < 1.08f);
}
// The setter checks the value it is given, not the one it replaces.
TEST_CASE("ScalingSettings_MinPartialityRange") {
ScalingSettings s;
CHECK_THROWS(s.MinPartiality(1.5));
CHECK_THROWS(s.MinPartiality(-0.1));
CHECK_NOTHROW(s.MinPartiality(0.5));
CHECK(s.GetMinPartiality() == 0.5);
}