Skip to content

Commit

Permalink
ICU-21900 MeasureUnit update; just marks mg-ofGlucose-perDeciliter as…
Browse files Browse the repository at this point in the history
… stable
  • Loading branch information
pedberg-icu committed Feb 8, 2022
1 parent 2f8749a commit 205144e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
6 changes: 2 additions & 4 deletions icu4c/source/i18n/unicode/measunit.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion icu4c/source/test/intltest/measfmttest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
MeasureUnit measureUnitValue;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public int compareTo(OrderedPair<F, S> other) {
}
}

private static final String[] DRAFT_VERSIONS = {"68", "69"};
private static final String[] DRAFT_VERSIONS = {"70", "71"};

private static final HashSet<String> DRAFT_VERSION_SET = new HashSet<>();

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 205144e

Please sign in to comment.