Jan Engelhardt
4dc49ebbfa
- Add icu-drop-testTemperature.patch to fix boo#1182645 The test has been dropped in master branch OBS-URL: https://build.opensuse.org/request/show/882420 OBS-URL: https://build.opensuse.org/package/show/X11:common:Factory/icu?expand=0&rev=143
60 lines
2.1 KiB
Diff
60 lines
2.1 KiB
Diff
--- 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");
|
|
|