-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICU-20568 Read unitsTest.txt, prepare to run unit tests. #20
Conversation
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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();
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Fix getConversionRateInfo compound-base-unit calculation bug
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
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
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
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
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
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
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
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
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
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