From 84391f734d6b2c24c9334efafe3b37ad7be5a2db55364611542ad8d0b92e2103 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 10 Apr 2021 22:31:50 +0000 Subject: [PATCH] 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 --- icu-drop-testTemperature.patch | 59 ---------------------------------- icu-fix-testTemperature.patch | 30 +++++++++++++++++ icu.changes | 7 ++++ icu.spec | 10 +----- 4 files changed, 38 insertions(+), 68 deletions(-) delete mode 100644 icu-drop-testTemperature.patch create mode 100644 icu-fix-testTemperature.patch diff --git a/icu-drop-testTemperature.patch b/icu-drop-testTemperature.patch deleted file mode 100644 index 7a932bf..0000000 --- a/icu-drop-testTemperature.patch +++ /dev/null @@ -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"); - diff --git a/icu-fix-testTemperature.patch b/icu-fix-testTemperature.patch new file mode 100644 index 0000000..6ffec9c --- /dev/null +++ b/icu-fix-testTemperature.patch @@ -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); + } + } + diff --git a/icu.changes b/icu.changes index 5e65bd1..48210fa 100644 --- a/icu.changes +++ b/icu.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Apr 10 21:27:58 UTC 2021 - Andreas Schwab + +- 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 diff --git a/icu.spec b/icu.spec index f395d09..aa08a32 100644 --- a/icu.spec +++ b/icu.spec @@ -46,7 +46,7 @@ Patch7: icu-avoid-x87-excess-precision.diff Patch8: locale.diff Patch9: icu-1618.patch # boo#1182645 -Patch10: icu-drop-testTemperature.patch +Patch10: icu-fix-testTemperature.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: pkg-config @@ -135,9 +135,6 @@ This package contains the HTML documentation. %prep %autosetup -p1 -n icu -%ifnarch aarch64 ppc64 ppc64le -%patch -P 10 -R -p1 -%endif # docs are special mkdir html @@ -219,12 +216,7 @@ rm -Rf "%buildroot/%_datadir/icu/%version/unidata/" \ %check # s390x see: https://ssl.icu-project.org/trac/ticket/13095 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 -%endif %post -n %lname -p /sbin/ldconfig %postun -n %lname -p /sbin/ldconfig