Skip to content

ICU-20568 Read unitsTest.txt, prepare to run unit tests. - #20

Merged
sffc merged 6 commits into
sffc:units-stagingfrom
hugovdm:units-staging
Mar 6, 2020
Merged

sffc merged 6 commits into
sffc:units-stagingfrom
hugovdm:units-staging

Conversation

@hugovdm

@hugovdm hugovdm commented Mar 5, 2020 •

Copy link
Copy Markdown
Collaborator

I'm using "WIP" to flag "Work In Progress". There are no "WIP"s in the codebase yet. :-)

This Pull Request disables unit tests whose identifiers aren't supported yet: to be re-enabled once MeasureUnit is updated.

Checklist

@hugovdm
hugovdm requested review from sffc and younies March 5, 2020 15:41

@sffc sffc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good milestone; just a couple things


u_parseDelimitedFile(path.data(), ';', fields, kNumFields,
unitsTestDataLineFn, this, errorCode);
if (U_FAILURE(errorCode)) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errorCode is an IcuTestErrorCode. You can use errIfFailureAndReset

UnicodeString uExpected = UnicodeString::fromUTF8(utf8Expected);
double expected = unum_parseDouble(nf, uExpected.getBuffer(),
uExpected.length(), 0, pErrorCode);
unum_close(nf);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this works, but please use the following to convert a string to a double…

DecimalQuantity expected;
expected.setToDecNumber({uExpected.getBuffer(), uExpected.length()}, *pErrorCode);
double expectedDouble = expected.toDouble();

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm currently still parsing "1,000.00". When I do this with DecimalQuantity, it gives U_DECIMAL_NUMBER_SYNTAX_ERROR. Is it better to use DecimalQuantity and manually strip out the thousands separators? It seemed reasonable to me to simply treat "1,000.00" as a localised number format.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Fine to leave it as-is.

@sffc
sffc merged commit 9f65f41 into sffc:units-staging Mar 6, 2020
hugovdm added a commit to hugovdm/icu that referenced this pull request Jul 15, 2020
PR: sffc#20
Commit: 9f65f41
ICU-20568 Read unitsTest.txt, prepare to run unit tests.

PR: sffc#25
Commit: 4be0a2b
No-op/cosmetic: reformat with clang-format ident:4 line-length:105.

PR: sffc#26
Commit: 9e021f9
Parse unitPreferencesTest.txt preparing to run data-driven tests

PR: sffc#34
Commit: 12a5289
Improve test output: no more fprintfs.

PR: sffc#33
Commit: 44e9afb
Update to latest CLDR test files: b7a23f3f41 CLDR-13587.

PR: sffc#31
Commit: ca34233
Add unitsdata.cpp, getConversionRatesInfo, and unit tests.

PR: sffc#41
Commit: be7f699
Update unitsTest.txt and unitPreferencesTest.txt from current CLDR master
hugovdm added a commit to hugovdm/icu that referenced this pull request Jul 23, 2020
PR: sffc#20
Commit: 9f65f41
ICU-20568 Read unitsTest.txt, prepare to run unit tests.

PR: sffc#25
Commit: 4be0a2b
No-op/cosmetic: reformat with clang-format ident:4 line-length:105.

PR: sffc#26
Commit: 9e021f9
Parse unitPreferencesTest.txt preparing to run data-driven tests

PR: sffc#34
Commit: 12a5289
Improve test output: no more fprintfs.

PR: sffc#33
Commit: 44e9afb
Update to latest CLDR test files: b7a23f3f41 CLDR-13587.

PR: sffc#31
Commit: ca34233
Add unitsdata.cpp, getConversionRatesInfo, and unit tests.

PR: sffc#41
Commit: be7f699
Update unitsTest.txt and unitPreferencesTest.txt from current CLDR master
hugovdm added a commit to hugovdm/icu that referenced this pull request Aug 3, 2020
PR: sffc#20
Commit: 9f65f41
ICU-20568 Read unitsTest.txt, prepare to run unit tests.

PR: sffc#25
Commit: 4be0a2b
No-op/cosmetic: reformat with clang-format ident:4 line-length:105.

PR: sffc#26
Commit: 9e021f9
Parse unitPreferencesTest.txt preparing to run data-driven tests

PR: sffc#34
Commit: 12a5289
Improve test output: no more fprintfs.

PR: sffc#33
Commit: 44e9afb
Update to latest CLDR test files: b7a23f3f41 CLDR-13587.

PR: sffc#31
Commit: ca34233
Add unitsdata.cpp, getConversionRatesInfo, and unit tests.

PR: sffc#41
Commit: be7f699
Update unitsTest.txt and unitPreferencesTest.txt from current CLDR master
hugovdm added a commit to hugovdm/icu that referenced this pull request Aug 3, 2020
PR: sffc#20
Commit: 9f65f41
ICU-20568 Read unitsTest.txt, prepare to run unit tests.

PR: sffc#25
Commit: 4be0a2b
No-op/cosmetic: reformat with clang-format ident:4 line-length:105.

PR: sffc#26
Commit: 9e021f9
Parse unitPreferencesTest.txt preparing to run data-driven tests

PR: sffc#34
Commit: 12a5289
Improve test output: no more fprintfs.

PR: sffc#33
Commit: 44e9afb
Update to latest CLDR test files: b7a23f3f41 CLDR-13587.

PR: sffc#31
Commit: ca34233
Add unitsdata.cpp, getConversionRatesInfo, and unit tests.

PR: sffc#41
Commit: be7f699
Update unitsTest.txt and unitPreferencesTest.txt from current CLDR master
hugovdm added a commit to hugovdm/icu that referenced this pull request Aug 15, 2020
PR: sffc#20
Commit: 9f65f41
ICU-20568 Read unitsTest.txt, prepare to run unit tests.

PR: sffc#25
Commit: 4be0a2b
No-op/cosmetic: reformat with clang-format ident:4 line-length:105.

PR: sffc#26
Commit: 9e021f9
Parse unitPreferencesTest.txt preparing to run data-driven tests

PR: sffc#34
Commit: 12a5289
Improve test output: no more fprintfs.

PR: sffc#33
Commit: 44e9afb
Update to latest CLDR test files: b7a23f3f41 CLDR-13587.

PR: sffc#31
Commit: ca34233
Add unitsdata.cpp, getConversionRatesInfo, and unit tests.

PR: sffc#41
Commit: be7f699
Update unitsTest.txt and unitPreferencesTest.txt from current CLDR master
hugovdm added a commit to hugovdm/icu that referenced this pull request Aug 28, 2020
PR: sffc#20
Commit: 9f65f41
ICU-20568 Read unitsTest.txt, prepare to run unit tests.

PR: sffc#25
Commit: 4be0a2b
No-op/cosmetic: reformat with clang-format ident:4 line-length:105.

PR: sffc#26
Commit: 9e021f9
Parse unitPreferencesTest.txt preparing to run data-driven tests

PR: sffc#34
Commit: 12a5289
Improve test output: no more fprintfs.

PR: sffc#33
Commit: 44e9afb
Update to latest CLDR test files: b7a23f3f41 CLDR-13587.

PR: sffc#31
Commit: ca34233
Add unitsdata.cpp, getConversionRatesInfo, and unit tests.

PR: sffc#41
Commit: be7f699
Update unitsTest.txt and unitPreferencesTest.txt from current CLDR master
hugovdm added a commit to hugovdm/icu that referenced this pull request Sep 1, 2020
PR: sffc#20
Commit: 9f65f41
ICU-20568 Read unitsTest.txt, prepare to run unit tests.

PR: sffc#25
Commit: 4be0a2b
No-op/cosmetic: reformat with clang-format ident:4 line-length:105.

PR: sffc#26
Commit: 9e021f9
Parse unitPreferencesTest.txt preparing to run data-driven tests

PR: sffc#34
Commit: 12a5289
Improve test output: no more fprintfs.

PR: sffc#33
Commit: 44e9afb
Update to latest CLDR test files: b7a23f3f41 CLDR-13587.

PR: sffc#31
Commit: ca34233
Add unitsdata.cpp, getConversionRatesInfo, and unit tests.

PR: sffc#41
Commit: be7f699
Update unitsTest.txt and unitPreferencesTest.txt from current CLDR master
hugovdm added a commit to hugovdm/icu that referenced this pull request Sep 9, 2020
Read unitsTest.txt, prepare to run unit tests.
PR: sffc#20
Commit: 9f65f41

No-op/cosmetic: reformat with clang-format ident:4 line-length:105.
PR: sffc#25
Commit: 4be0a2b

Parse unitPreferencesTest.txt preparing to run data-driven tests
PR: sffc#26
Commit: 9e021f9

Improve test output: no more fprintfs.
PR: sffc#34
Commit: 12a5289

Update to latest CLDR test files: b7a23f3f41 CLDR-13587.
PR: sffc#33
Commit: 44e9afb

Add unitsdata.cpp, getConversionRatesInfo, and unit tests.
PR: sffc#31
Commit: ca34233

Update unitsTest.txt and unitPreferencesTest.txt from current CLDR master
PR: sffc#41
Commit: be7f699
hugovdm added a commit to unicode-org/icu that referenced this pull request Sep 10, 2020
Read unitsTest.txt, prepare to run unit tests.
PR: sffc#20
Commit: 9f65f41

No-op/cosmetic: reformat with clang-format ident:4 line-length:105.
PR: sffc#25
Commit: 4be0a2b

Parse unitPreferencesTest.txt preparing to run data-driven tests
PR: sffc#26
Commit: 9e021f9

Improve test output: no more fprintfs.
PR: sffc#34
Commit: 12a5289

Update to latest CLDR test files: b7a23f3f41 CLDR-13587.
PR: sffc#33
Commit: 44e9afb

Add unitsdata.cpp, getConversionRatesInfo, and unit tests.
PR: sffc#31
Commit: ca34233

Update unitsTest.txt and unitPreferencesTest.txt from current CLDR master
PR: sffc#41
Commit: be7f699
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants