From 7b349257e2b471a09f1509b77ceb7cf7115cc81c Mon Sep 17 00:00:00 2001 From: Peter Edberg Date: Mon, 7 Feb 2022 23:57:16 -0800 Subject: [PATCH] ICU-21900 MeasureUnit update; just marks mg-ofGlucose-perDeciliter as stable --- icu4c/source/i18n/unicode/measunit.h | 6 ++---- icu4c/source/test/intltest/measfmttest.cpp | 5 ++++- .../core/src/com/ibm/icu/util/MeasureUnit.java | 2 +- .../icu/dev/test/format/MeasureUnitTest.java | 17 ++++++++++------- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/icu4c/source/i18n/unicode/measunit.h b/icu4c/source/i18n/unicode/measunit.h index 61da62e71f22..0bd79c67778f 100644 --- a/icu4c/source/i18n/unicode/measunit.h +++ b/icu4c/source/i18n/unicode/measunit.h @@ -989,23 +989,21 @@ class U_I18N_API MeasureUnit: public UObject { */ static MeasureUnit getKarat(); -#ifndef U_HIDE_DRAFT_API /** * Returns by pointer, unit of concentr: milligram-ofglucose-per-deciliter. * Caller owns returned value and must free it. * Also see {@link #getMilligramOfglucosePerDeciliter()}. * @param status ICU error code. - * @draft ICU 69 + * @stable ICU 69 */ static MeasureUnit *createMilligramOfglucosePerDeciliter(UErrorCode &status); /** * Returns by value, unit of concentr: milligram-ofglucose-per-deciliter. * Also see {@link #createMilligramOfglucosePerDeciliter()}. - * @draft ICU 69 + * @stable ICU 69 */ static MeasureUnit getMilligramOfglucosePerDeciliter(); -#endif /* U_HIDE_DRAFT_API */ /** * Returns by pointer, unit of concentr: milligram-per-deciliter. diff --git a/icu4c/source/test/intltest/measfmttest.cpp b/icu4c/source/test/intltest/measfmttest.cpp index 003804db9a4e..05488b7c360f 100644 --- a/icu4c/source/test/intltest/measfmttest.cpp +++ b/icu4c/source/test/intltest/measfmttest.cpp @@ -2683,7 +2683,7 @@ void MeasureFormatTest::TestCompatible69() { assertSuccess("", status); } -void MeasureFormatTest::TestCompatible70() { +void MeasureFormatTest::TestCompatible70() { // TestCompatible71 would be identical UErrorCode status = U_ZERO_ERROR; LocalPointer measureUnit; MeasureUnit measureUnitValue; @@ -3064,6 +3064,9 @@ void MeasureFormatTest::TestCompatible70() { assertSuccess("", status); } +// TestCompatible71 would be identical to TestCompatible70, +// no need to add it + void MeasureFormatTest::TestBasic() { UErrorCode status = U_ZERO_ERROR; MeasureUnit *ptr1 = MeasureUnit::createArcMinute(status); diff --git a/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java b/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java index d6bbd8bca721..85f15c437ec1 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java @@ -1007,7 +1007,7 @@ protected synchronized static MeasureUnit addUnit(String type, String unitName, /** * Constant for unit of concentr: milligram-ofglucose-per-deciliter - * @draft ICU 69 + * @stable ICU 69 */ public static final MeasureUnit MILLIGRAM_OFGLUCOSE_PER_DECILITER = MeasureUnit.internalGetInstance("concentr", "milligram-ofglucose-per-deciliter"); diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java index 5a6aef116373..cfce623955c1 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java @@ -85,7 +85,7 @@ public int compareTo(OrderedPair other) { } } - private static final String[] DRAFT_VERSIONS = {"68", "69"}; + private static final String[] DRAFT_VERSIONS = {"70", "71"}; private static final HashSet DRAFT_VERSION_SET = new HashSet<>(); @@ -322,12 +322,12 @@ public void testZZZ() { // various generateXXX calls go here, see // docs/processes/release/tasks/updating-measure-unit.md // use this test to run each of the ollowing in succession - //generateConstants("70"); // for MeasureUnit.java, update generated MeasureUnit constants - //generateBackwardCompatibilityTest("70"); // for MeasureUnitTest.java, create TestCompatible70 - //generateCXXHConstants("70"); // for measunit.h, update generated createXXX methods + //generateConstants("71"); // for MeasureUnit.java, update generated MeasureUnit constants + //generateBackwardCompatibilityTest("71"); // for MeasureUnitTest.java, create TestCompatible70 + //generateCXXHConstants("71"); // for measunit.h, update generated createXXX methods //generateCXXConstants(); // for measunit.cpp, update generated code - //generateCXXBackwardCompatibilityTest("70"); // for measfmttest.cpp, create TestCompatible70 - //updateJAVAVersions("70"); // for MeasureUnitTest.java, JAVA_VERSIONS + //generateCXXBackwardCompatibilityTest("71"); // for measfmttest.cpp, create TestCompatible70 + //updateJAVAVersions("71"); // for MeasureUnitTest.java, JAVA_VERSIONS } @Test @@ -2084,7 +2084,7 @@ public void TestCompatible69() { } @Test - public void TestCompatible70() { + public void TestCompatible70() { // TestCompatible71 would be identical MeasureUnit[] units = { MeasureUnit.G_FORCE, MeasureUnit.METER_PER_SECOND_SQUARED, @@ -2277,6 +2277,9 @@ public void TestCompatible70() { assertEquals("", 187, units.length); } + // TestCompatible71 would be identical to TestCompatible70, + // no need to add it + @Test public void TestExamplesInDocs() { MeasureFormat fmtFr = MeasureFormat.getInstance(