SHA256
1
0
forked from pool/icu

Accepting request 884350 from home:Andreas_Schwab:Factory

- 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
This commit is contained in:
Jan Engelhardt 2021-04-10 22:31:50 +00:00 committed by Git OBS Bridge
parent 2e1a67e1fb
commit 84391f734d
4 changed files with 38 additions and 68 deletions

View File

@ -1,59 +0,0 @@
--- icu/source/test/intltest/units_test.cpp.orig 2021-03-31 18:16:45.625488752 +0200
+++ icu/source/test/intltest/units_test.cpp 2021-03-31 18:26:44.059315511 +0200
@@ -50,7 +50,6 @@ class UnitsTest : public IntlTest {
void testPreferences();
void testSiPrefixes();
void testMass();
- void testTemperature();
void testArea();
};
@@ -69,7 +68,6 @@ void UnitsTest::runIndexedTest(int32_t i
TESTCASE_AUTO(testPreferences);
TESTCASE_AUTO(testSiPrefixes);
TESTCASE_AUTO(testMass);
- TESTCASE_AUTO(testTemperature);
TESTCASE_AUTO(testArea);
TESTCASE_AUTO_END;
}
@@ -224,40 +222,6 @@ void UnitsTest::testMass() {
}
}
-void UnitsTest::testTemperature() {
- IcuTestErrorCode status(*this, "Units testTemperature");
- // Test Cases
- struct TestCase {
- const char *source;
- const char *target;
- const double inputValue;
- const double expectedValue;
- } testCases[]{
- {"celsius", "fahrenheit", 0.0, 32.0}, //
- {"celsius", "fahrenheit", 10.0, 50.0}, //
- {"fahrenheit", "celsius", 32.0, 0.0}, //
- {"fahrenheit", "celsius", 89.6, 32}, //
- {"kelvin", "fahrenheit", 0.0, -459.67}, //
- {"kelvin", "fahrenheit", 300, 80.33}, //
- {"kelvin", "celsius", 0.0, -273.15}, //
- {"kelvin", "celsius", 300.0, 26.85} //
- };
-
- for (const auto &testCase : testCases) {
- UErrorCode status = U_ZERO_ERROR;
-
- MeasureUnitImpl source = MeasureUnitImpl::forIdentifier(testCase.source, status);
- MeasureUnitImpl target = MeasureUnitImpl::forIdentifier(testCase.target, status);
-
- ConversionRates conversionRates(status);
- UnitConverter converter(source, target, conversionRates, status);
-
- assertEqualsNear(UnicodeString("testTemperature: ") + testCase.source + " to " + testCase.target,
- testCase.expectedValue, converter.convert(testCase.inputValue),
- 0.0001 * uprv_fabs(testCase.expectedValue));
- }
-}
-
void UnitsTest::testArea() {
IcuTestErrorCode status(*this, "Units Area");

View File

@ -0,0 +1,30 @@
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);
}
}

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Sat Apr 10 21:27:58 UTC 2021 - Andreas Schwab <schwab@suse.de>
- icu-drop-testTemperature.patch: Remove
- icu-fix-testTemperature.patch: Backport ICU-21366 (bsc#1182645)
- Don't disable testsuite under qemu-linux-user
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Mar 31 16:19:02 UTC 2021 - Guillaume GARDET <guillaume.gardet@opensuse.org> Wed Mar 31 16:19:02 UTC 2021 - Guillaume GARDET <guillaume.gardet@opensuse.org>

View File

@ -46,7 +46,7 @@ Patch7: icu-avoid-x87-excess-precision.diff
Patch8: locale.diff Patch8: locale.diff
Patch9: icu-1618.patch Patch9: icu-1618.patch
# boo#1182645 # boo#1182645
Patch10: icu-drop-testTemperature.patch Patch10: icu-fix-testTemperature.patch
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: pkg-config BuildRequires: pkg-config
@ -135,9 +135,6 @@ This package contains the HTML documentation.
%prep %prep
%autosetup -p1 -n icu %autosetup -p1 -n icu
%ifnarch aarch64 ppc64 ppc64le
%patch -P 10 -R -p1
%endif
# docs are special # docs are special
mkdir html mkdir html
@ -219,12 +216,7 @@ rm -Rf "%buildroot/%_datadir/icu/%version/unidata/" \
%check %check
# s390x see: https://ssl.icu-project.org/trac/ticket/13095 # s390x see: https://ssl.icu-project.org/trac/ticket/13095
cd source cd source
%if !0%{?qemu_user_space_build:1}
# Checks disabled in qemu because of races happening when we emulate
# multi-threaded programs, and some check tests atomic instructions in
# multi-threaded icu invocations
ICU_DATA="%buildroot/%_datadir/icu/%version" make check %{?_smp_mflags} VERBOSE=1 ICU_DATA="%buildroot/%_datadir/icu/%version" make check %{?_smp_mflags} VERBOSE=1
%endif
%post -n %lname -p /sbin/ldconfig %post -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig %postun -n %lname -p /sbin/ldconfig