Commit Graph

7976 Commits

Author SHA1 Message Date
Hugo van der Merwe
e3123c83a4 ICU-20568 Support smart units / unit contexts / preferences
Explore Usage-related error codes, address icu-units/icu#36.
PR: https://github.com/icu-units/icu/pull/56
Commit: d5d7fdccfef887bb1af180bba3e2a0286dc32135

Implement Precision handling in UsagePrefsHandler::processQuantity
PR: https://github.com/icu-units/icu/pull/61
Commit: 16547f32986600a46e4adf20a6870c1708dd1c75

Support Mixed Units in NumberFormatter when using usage()
PR: https://github.com/icu-units/icu/pull/52
Commit: cc5a12202133855e15ffba889acffc10aad2d46b

For MixedUnits, use the correct ListFormatter styles.
PR: https://github.com/icu-units/icu/pull/66
Commit: 77bb747002d36626386f18e45c68c44b276cf575

Read the CLDR testData test files from the new location.
PR: https://github.com/icu-units/icu/pull/68
Commit: 6eb992e2b3c0bbe4870b554a5aa855b3636566d4

Fix double-precision maths in unit conversions
PR: https://github.com/icu-units/icu/pull/71
Commit: 78e88fbddef0f6817654d58c9c5dfeb6606324b9

Support .unit(MIXED_UNIT) without .usage(...).
PR: https://github.com/icu-units/icu/pull/72
Commit: 56ac7959375b8c9363ff022185165e52490c6c00

More commits:
- Reorder numbertest_api.cpp tests for consistent order.
- NumberFormatterApiTest: fold unitPipeline() into unitCompoundMeasure()
- Add some 'template class' instantiations for MSVC.
- Make trimField handle all whitespace, improve test messages
- Drop templated 'appendAll': it requires copy constructor
- Add protected MaybeStackArray::copyFrom()
- Add TODO(icu-units#67) and commented-out test case: use kUndefinedField for now
- Provide correct output order for units like "inch-and-foot"
- MSVC: export MaybeStackVector<MeasureUnit>
- Code review feedback: dependencies.txt and doc comments
- Consistent naming for code files: units_*
2020-09-10 22:39:18 +02:00
younies
1b853904cd ICU-20568 Use Impl libraries, add precision UnitsRouter#route output
Add precision to the output of UnitsRouter#route
PR: https://github.com/icu-units/icu/pull/10
Commit: 030bda3ec86a02b190a83798a7c9be530a335067

Use `Impl` libraries for all internal libraries
PR: https://github.com/icu-units/icu/pull/15
Commit: cc786cfb3bee3c72e78a928da8b9a6fd58f31b04

Sort the units in ComplexUnitConverter
PR: https://github.com/icu-units/icu/pull/6
Commit: f65b181c4447bb4eb9eef5dc20ea1b296d053ffa
2020-09-10 22:39:18 +02:00
Hugo van der Merwe
7ed2a2d233 ICU-20568 Implement Usage "Glue Code" and skeleton support. Tests.
CLDR-13488: Samples of intermediate source/data/misc/units.txt
PR: https://github.com/icu-units/icu/pull/5
Commit: 08132e7a3388e055590e5ba60ba37c9b5a87b900

Unit test improvements (the rest of PR already upstreamed).
PR: https://github.com/sffc/icu/pull/40
Commit: e92a2fcffbbcb92868954f28e3366568e6b3cc7c

Use namespace ::icu::units::impl for units-related code.
PR: https://github.com/icu-units/icu/pull/16
Commit: 57b35a8a93e751aa73a190e63da494d24fd67bef

Export addSingleFactorConstant in header file
PR: https://github.com/icu-units/icu/pull/17
Commit: f357b5558ebc2f0aab53886492beae7f17d9c3cc

Fix MeasureUnit identifiers to be spec-compliant.
PR: https://github.com/icu-units/icu/pull/18
Commit: 69c087154b871b53fdba978bfa1b1ba4c4e71594

Cleanup: IWYU headers (with some exceptions), SigNum -> Signum
PR: https://github.com/icu-units/icu/pull/19
Commit: 1c29a6bcc74c113a7d51b008a93cd7986437c841

Test that addSingleFactorConstant knowns all unitConstants.
PR: https://github.com/icu-units/icu/pull/20
Commit: 6c0c3bb64080354ea109d1356b98ac7a3a97f443

Add Unit Usage support to Number Skeletons.
PR: https://github.com/icu-units/icu/pull/33
Commit: 3cf23222ca8c7fa394e3ed37ec8333f5e86c6807

Fix some compiler warnings
PR: https://github.com/icu-units/icu/pull/43
Commit: be11edb0bd70a6857ea24e7427725b803263481d
2020-09-10 22:39:18 +02:00
younies
72056d4df2 ICU-20568 UnitsRouter, ComplexUnitConverter, numberformatter.h
add usage to number formatter settings header
PR: https://github.com/sffc/icu/pull/23
Commit: 6d78a95d6dbe0ef946624e7253f57d414168c77a

Implementation of UnitsRouter and ComplexUnitConverter.
PR: https://github.com/sffc/icu/pull/30
Commit: 1ae7190d1950377d5fdab822bb65eb67a8891104
2020-09-10 22:39:18 +02:00
Hugo van der Merwe
65bbf92f78 ICU-20568 getPreferencesFor() and getUnitCategory()
UnitPreferences class in unitsdata.cpp
PR: https://github.com/sffc/icu/pull/42
Commit: 24494d985e1eeb60e5daa450e26f7f0c3437a246

Add getUnitCategory()
PR: https://github.com/sffc/icu/pull/43
Commit: d406b915c4985e541b0d4cd8c324bcfdb0b7f194

Support usage component dropping, and more
PR: https://github.com/sffc/icu/pull/45
Commit: 6b14d7f1a0fa16fc6f80ca4fc87f17a8c687cb28

Add six more unit tests for getPreferencesFor.
PR: https://github.com/sffc/icu/pull/46
Commit: 5e4f8d4fe490ab82682ba233e0e6d38e8bf570a0

Change getPreferencesFor parameters from char* to StringPiece.
PR: https://github.com/sffc/icu/pull/47
Commit: a7ca496f9e60ad22dc9526259873b6f2bf52dd86
2020-09-10 22:39:18 +02:00
younies
cdb028edf5 ICU-20568 Add unit converter.
Add unit converter.
PR: https://github.com/sffc/icu/pull/21
Commit: 9bcc4b698ff4b2afbf321188bceff809a27342f2

add comment about ratesInfo param in UnitConverter
PR: https://github.com/icu-units/icu/pull/55
Commit: cbed63622771dfc3b3e3c44346f1e530f1b86b65
2020-09-10 22:39:18 +02:00
Hugo van der Merwe
4d07e3b10f ICU-20568 testConversions: test convertibility of unitsTest.txt test cases.
PR: https://github.com/sffc/icu/pull/39
Commit: 3202693e542e300e235096557777d4892548d676
2020-09-10 22:39:18 +02:00
younies
c49cb73509 ICU-20568 Check convertible units
PR: https://github.com/sffc/icu/pull/32
Commit: 3bf35258f42f8aca893f6ebfb9a019c2e1ee5563
2020-09-10 22:39:18 +02:00
Hugo van der Merwe
cf46b4136e ICU-20568 unitsdata.cpp/.h and associated tests
Read unitsTest.txt, prepare to run unit tests.
PR: https://github.com/sffc/icu/pull/20
Commit: 9f65f41f183ded57efdf4f7c0cdf56c02e441024

No-op/cosmetic: reformat with clang-format ident:4 line-length:105.
PR: https://github.com/sffc/icu/pull/25
Commit: 4be0a2bc55fc3567f790a53cc988abd4c3508419

Parse unitPreferencesTest.txt preparing to run data-driven tests
PR: https://github.com/sffc/icu/pull/26
Commit: 9e021f9b6fbee06283ef4c45dbfe5c7b3abd2dbf

Improve test output: no more fprintfs.
PR: https://github.com/sffc/icu/pull/34
Commit: 12a5289238d68e3aa184727d7d7af55d386613c7

Update to latest CLDR test files: b7a23f3f41 CLDR-13587.
PR: https://github.com/sffc/icu/pull/33
Commit: 44e9afb32187529a4599548c42f70c7deb3e46bf

Add unitsdata.cpp, getConversionRatesInfo, and unit tests.
PR: https://github.com/sffc/icu/pull/31
Commit: ca34233e0804c1175f210e5557bb984da2eab244

Update unitsTest.txt and unitPreferencesTest.txt from current CLDR master
PR: https://github.com/sffc/icu/pull/41
Commit: be7f69941ddf4373e9d66149e95f5b8345d7de5d
2020-09-10 22:39:18 +02:00
younies
adcc646e51 ICU-20568 Skeleton for Testing Units
PR: https://github.com/sffc/icu/pull/6
Commit: 9b3ca66937c40044055bf9a8e13db57bcdc75fec
2020-09-10 22:39:18 +02:00
Markus Scherer
18c4a69f80 ICU-9961 replace U_DRAFT/U_STABLE/U_INTERNAL with U_CAPI 2020-09-10 11:23:44 -07:00
Frank Tang
35dfdf1d02 ICU-21043 Fix calendar problems
This PR fixes
ICU-21043 Erroneous date display in indian calendar of all dates prior to 0001-01-01.
ICU-21044 Hebrew Calendar calculation is incorrect when the year < 1
ICU-21045 Erroneous date display in islamic and islamic-rgsa calendars of all dates prior to 0622-07-18.
ICU-21046 Erroneous date display in islamic-umalqura calendar of all dates prior to  -195366-07-23.

The problem in the indiancal.cpp is
* ICU-21043 the gregorian/julain convesion is wrong. Swith to use
i18n/gregoimp.h fix the problem.

The problem in the hebrwcal.cpp is
* ICU-21044 Use ClockMath::floorDivid to replace x / y for x maybe <  0
also need to fix incorrect value in test file

The problem in the islamcal.cpp:
* ICU-21045: The math of % negative number for year and month is wrong.
* ICU-21046: Not use int64_t methods and caused int32_t overflow while the year is a
huge negative number. Cast to int64_t to force using the int64_t version
for the math fix the problem.

Also add tests to exhaust test 8000 years for all calendar. In quick
mode, only test 2.5 years.

Switch to 0-based month. fix TZ for test.
2020-09-10 00:21:18 -07:00
gnrunge
9e85ba5690 ICU-21268 Adds NULL string checks to assert statements to prevent
segmentation faults when unit tests run without ICU data.

ICU-21268 Fix value type: char* is not ompatible with u'..' value.
2020-09-09 17:50:45 -07:00
Markus Scherer
c3fe7e09d8 ICU-21267 stop defining & using FALSE & TRUE macros in public headers
See #1282
2020-09-09 15:13:56 -07:00
Peter Edberg
ad043349ed ICU-21106 avoid buffer overflow in u_fopen_u, fix WIN32_API fclose(NULL) 2020-09-09 00:21:15 -07:00
gnrunge
b6ff1393d5 ICU-21268 Add error checks to avoid segmentation faults if tests run with stubdata only.
ICU-21268 Use 'nullptr' instead of NULL when checking for pointer value.

ICU-21268: Fixes error message.

ICU-21268 Style fixes (space before '{').
2020-09-08 18:22:29 -07:00
Jeff Genovy
2361a3258b ICU-21264 Re-enable optimizations for various functions on MSVC for VS2019 and above. 2020-09-08 18:05:02 -07:00
Peter Edberg
b066f65a50 ICU-21249 integrate CLDR release-38-alpha1 to ICU trunk 2020-09-04 15:05:22 -07:00
Markus Scherer
9971c663ff ICU-21257 remove #License fragment from license URLs 2020-09-04 10:02:17 -07:00
Shane F. Carr
4f18ef2ef8 ICU-21258 Refactor code and tests for compact data known issue 2020-09-03 16:17:40 -07:00
Rich Gillam
edaebfa64e ICU-21155 Add support for all hour and day-period skeleton characters to DateIntervalFormat 2020-09-03 16:14:08 -07:00
Shane F. Carr
caadb345e5 ICU-20826 Updating C++ ListFormatter impl to be more like Java 2020-09-03 17:52:03 -05:00
Elango Cheran
cb7f197821 ICU-21254 Add plural rule parsing for exponent operand in C++ 2020-09-03 09:17:15 -07:00
Shane F. Carr
82545ecc2c ICU-21249 Update instructions in StaticUnicodeSetsTest 2020-09-03 12:29:44 +02:00
Shane F. Carr
fcc3bcb43e ICU-21249 Update numberpermutationtest.txt 2020-09-03 00:46:59 +02:00
Jeff Genovy
341608f7b6 ICU-21108 Update to use/support VS2019, and add extra CI builds for VS2017 and VS2019.
Change to use the Windows 10 SDK for Win32 (Win7) builds on the VS2019 ADO images.
The Windows 10 SDK is backwards compatible to Windows 7, if WINVER and
_WIN32_WINNT are set before compiling.

Clean up the vcxproj files from VC7.1
2020-09-02 13:01:27 -07:00
Peter Edberg
e618a1cc2d ICU-21249 integrate CLDR release 38 alpha0 to ICU trunk 2020-09-02 10:23:14 -07:00
Frank Tang
bc864aeac6 ICU-21051 Add copyright Remove License from sh
See #1281
2020-09-01 13:26:41 -05:00
Shane F. Carr
196d5e1182 ICU-20923 Fix compact notation with percent. 2020-09-01 04:36:04 -05:00
Markus Scherer
2f39d33498 ICU-13727 limit length of input for Punycode encode/decode
See #1241
2020-08-31 16:53:07 -07:00
Markus Scherer
f62693aa02 ICU-13416 change Armenian (hy) uppercase/titlecase of և ligature ech-yiwn 2020-08-30 18:19:10 -07:00
Frank Tang
cad3903cc2 ICU-21051 Add Locale::createCanonical performance test 2020-08-29 02:29:58 -07:00
Shane F. Carr
0101e2632c ICU-20164 Make NoUnit a zero-cost abstraction over MeasureUnit.
See #1230
2020-08-29 00:01:49 -05:00
Hugo van der Merwe
35eae09a7c ICU-21246 Handle kilogram SI prefix correctly
Fix kilogram parsing: ignore 'kilogram' as a stem, we have 'gram'.

Failures in the added unit test before the fix: withSIPrefix resulted
in 'microkilogram', and kilogram's prefix was considered to be
"ONE" (i.e. 10^0).
2020-08-29 00:07:08 +02:00
Shane F. Carr
0dbe1ae013 ICU-20927 Adding French narrow duration unit test. 2020-08-28 15:31:38 -05:00
Craig Cornelius
408cd128fc ICU-21242 rephrase documentation using term master
See #1255
2020-08-28 12:42:20 -07:00
Hugo van der Merwe
66b2458a26 ICU-21066 Copy includelist of CLDR testData with tools/cldr/build.xml 2020-08-28 01:12:12 +02:00
Shane F. Carr
59cdbe1f53 ICU-21232 Improve performance of DecimalFormat#parse on long numbers 2020-08-27 14:33:05 -05:00
Frank Tang
3b188e46a4 ICU-21157 Fix test code
See #1256
2020-08-24 14:37:09 -07:00
Hugo van der Merwe
0387d1b988 ICU-21230 Add status to MaybeStackArray(int32_t newCapacity), plumb it through. 2020-08-24 22:55:26 +02:00
Markus Scherer
c8aa800735 ICU-21035 add & use CharString::extract(dest buffer)
See #1253
2020-08-21 16:29:25 -07:00
Markus Scherer
39da689d30 ICU-21184 rephrase docs/comments using the term grandfathered 2020-08-21 14:13:03 -07:00
Frank Tang
cde54fc5ba ICU-21157 Fix incorrect null termination.
See #1236
2020-08-20 16:22:34 -07:00
Erik Torres
a7a8cc3809 ICU-20808 Add test for the C locale to default to en_US_POSIX 2020-08-20 14:12:09 -07:00
Jeff Genovy
26775d7d13 ICU-21159 Fix memory leaks in cintltst TestUsingDefaultWarning. 2020-08-19 16:50:55 -07:00
Frank Tang
e395e8abcd ICU-21159 Document U_USING_DEFAULT_WARNING in .h
Document the fact
uloc_getDisplay(Language|Script|Country|Variant|Keyword|KeywordValue)
would fallback with the code, case canonicalied in same cases, and
set the status to U_USING_DEFAULT_WARNING.

No change to the implementation behavior. Only complete the missing
comments and tweak line wrap, remove double spaces and add test to
validate this pre-existing behavior that I added the documents now.
2020-08-17 15:18:01 -07:00
Markus Scherer
9279e49d2f ICU-21030 validate ACE label edge cases 2020-08-14 14:32:47 -07:00
Markus Scherer
e19d12997b ICU-21212 full range check for Punycode digits 2020-08-14 11:37:40 -07:00
Shane F. Carr
2ea56b531a ICU-21182 Adding UNumberRangeFormatter (C API).
See #1193
2020-08-12 21:33:38 -05:00
Shane F. Carr
88f092a9fb ICU-21191 Improve configurability of testtagsguards.sh 2020-08-11 21:22:31 -05:00