[office/kmymoney] kmymoney/widgets/tests: Fix testcase
Thomas Baumgart <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit bdbb71c2195bbd5d0efde910cdc844f2db8792e7 by Thomas Baumgart.
Committed on 18/07/2026 at 15:23.
Pushed by tbaumgart into branch 'master'.
Fix testcase
AmountValidator sets its locale based on the LC_MONETARY environment
variable so we have to tweak that here, otherwise AmountValidator will
use the system value
M +4 -0 kmymoney/widgets/tests/test-amountvalidator.cpp
https://invent.kde.org/office/kmymoney/-/commit/bdbb71c2195bbd5d0efde910cdc844f2db8792e7
diff --git a/kmymoney/widgets/tests/test-amountvalidator.cpp b/kmymoney/widgets/tests/test-amountvalidator.cpp
index de92de162..01d403eba 100644
--- a/kmymoney/widgets/tests/test-amountvalidator.cpp
+++ b/kmymoney/widgets/tests/test-amountvalidator.cpp
@@ -109,6 +109,10 @@ void AmountValidatorTest::testValidator()
.arg(locale, QLocale().groupSeparator(), groupSeparator);
QSKIP(msg.toLatin1());
}
+
+ // AmountValidator sets its locale based on the LC_MONETARY environment variable
+ // so we have to tweak that here, otherwise AmountValidator will use the system value
+ qputenv("LC_MONETARY", locale.toLatin1());
AmountValidator m(nullptr);
int pos = inputValue.length();
// QCOMPARE(m->validate(inputValue, pos), static_cast<QValidator::State>(result));