Jan Engelhardt
84391f734d
- icu-drop-testTemperature.patch: Remove - icu-fix-testTemperature.patch: Backport ICU-21366 (bsc#1182645) - Don't disable testsuite under qemu-linux-user OBS-URL: https://build.opensuse.org/request/show/884350 OBS-URL: https://build.opensuse.org/package/show/X11:common:Factory/icu?expand=0&rev=146
31 lines
1.3 KiB
Diff
31 lines
1.3 KiB
Diff
From 7c9bad02d26a59466c760a28989f7045c8f133ad Mon Sep 17 00:00:00 2001
|
|
From: Hugo van der Merwe <17109322+hugovdm@users.noreply.github.com>
|
|
Date: Fri, 6 Nov 2020 17:55:21 +0000
|
|
Subject: [PATCH] ICU-21366 testConverter: allow some double-precision error
|
|
for 0.0
|
|
|
|
See #1443
|
|
---
|
|
icu4c/source/test/intltest/units_test.cpp | 7 +++++--
|
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
|
Index: icu/source/test/intltest/units_test.cpp
|
|
===================================================================
|
|
--- icu.orig/source/test/intltest/units_test.cpp
|
|
+++ icu/source/test/intltest/units_test.cpp
|
|
@@ -252,9 +252,12 @@ void UnitsTest::testTemperature() {
|
|
ConversionRates conversionRates(status);
|
|
UnitConverter converter(source, target, conversionRates, status);
|
|
|
|
+ double maxDelta = 1e-6 * uprv_fabs(testCase.expectedValue);
|
|
+ if (testCase.expectedValue == 0) {
|
|
+ maxDelta = 1e-12;
|
|
+ }
|
|
assertEqualsNear(UnicodeString("testTemperature: ") + testCase.source + " to " + testCase.target,
|
|
- testCase.expectedValue, converter.convert(testCase.inputValue),
|
|
- 0.0001 * uprv_fabs(testCase.expectedValue));
|
|
+ testCase.expectedValue, converter.convert(testCase.inputValue), maxDelta);
|
|
}
|
|
}
|
|
|