Commit Graph

4111 Commits

Author SHA1 Message Date
Markus Scherer
2982d6c233 ICU-13081 test self-move without clang warning 2019-02-06 18:11:00 -08:00
Markus Scherer
0f7c4c8ed9 ICU-13081 remove C++ moveFrom() functions: still draft, but obsolete since we require C++11 which has std::move() 2019-02-06 13:36:53 -08:00
Shane F. Carr
9bb910b8d0 ICU-20138 Implementing ufmtval_nextPosition and additional test infra.
- Adds test infra for multi-category formatted values.
- Adds helper method ConstrainedFieldPosition#matchesField, currently internal.
2019-02-05 22:54:13 -08:00
Peter Edberg
ff04436fe5 ICU-20374 Formattable::internalGetCharString should produce int string for types kLong or kInt64 2019-02-05 14:42:21 -08:00
Jeff Genovy
654278627a ICU-20388 ICU4C: intltest fails with a "Debug Assertion Break" on MSVC when compiled for Debug.
Need to use free() with malloc() instead of uprv_free().
2019-02-05 14:04:10 -08:00
Jeff Genovy
00596d3027 ICU-13847 ICU-20381 Improve handling of errors (Out-of-Memory) in DecimalFormat class.
- Use move assignment for fields->formatter (LocalizedNumberFormatter) instead of creating new heap object every time.
- Add test cases for DecimalFormat object in invalid state.
- Protect against self-assignment in assignment operator.
- Fix segmentation fault when attempting to compare valid and invalid DecimalFormat objects.
- Changes based on review feedback from Shane.
- Fix minor typos in the public header file.
2019-02-05 14:00:40 -08:00
Shane F. Carr
19407640f8 ICU-20357 Adding std::unique_ptr conversions to LocalXyzPointer macro. 2019-01-28 21:23:35 -08:00
Shane Carr
1f85e94068 ICU-13839 Adding FormattedNumber API to PluralRules.
- Makes new dependency class for PluralRules+FormattedNumber.
2019-01-28 11:46:00 -08:00
Shane Carr
db94f46377 ICU-13800 Adding clone() on [Un]LocalizedNumber[Range]Formatter.
- Returns a LocalPointer that can be converted to std::unique_ptr.
2019-01-25 15:29:21 -08:00
Jeff Genovy
5c8960e59e ICU-20074 Revise UPRV_UNREACHABLE macro to always call abort().
Moved the macro from platform.h to uassert.h.
Removed any "unreachable" code that previously occurred after the UPRV_UNREACHABLE macro is used.
Changes based on review from Andy.

Co-authored-by: Daniel Ju <daju@microsoft.com>
2019-01-24 18:50:04 -08:00
Shane Carr
b7a3571b21 ICU-20357 Adding LocalPointer conversion methods to/from std::unique_ptr
- Requires the right side to be an rvalue reference.
- Includes move constructor, move operator, and conversion operator.
2019-01-24 17:51:07 -08:00
Frank Tang
4104d33501 ICU-20355 Fixing Java currency long name field.
- Adds test in ICU4C and ICU4J.
2019-01-24 17:33:27 -08:00
Shane Carr
7507f5322f ICU-13657 Adding NumberFormatter skeleton factory method with UParseError.
- Includes small fixes to StringSegment and to tests.
2019-01-24 16:33:00 -08:00
Shane Carr
c31fec6b14 ICU-13746 Removing number formatting APIs deprecated in ICU 62.
Includes both ICU4C and ICU4J.
2019-01-24 14:50:03 -08:00
Shane Carr
1f7d8ababe ICU-20358 Clean up grouping resolution in DecimalFormat#toPattern(). 2019-01-18 17:40:49 -08:00
Shane Carr
c0a64b5ea1 ICU-20183 Adding CurrencyUnit StringPiece constructor.
- Adds function uprv_memchr.
2019-01-17 15:41:56 -08:00
Shane F. Carr
ac359112a1 ICU-20348 Fixing DecimalFormat set affix currency behavior.
- Includes minor changes to tests.
2019-01-17 11:32:38 -08:00
Jeff Genovy
33d7868d45 ICU-20351 Warning cleanup changes for ICU4C under MSVC. 2019-01-16 16:43:02 -08:00
Daniel Ju
7453181fff ICU-20074 Define UPRV_UNREACHABLE macro for unreachable code
Replaced occurrences of U_ASSERT(FALSE) with new UPRV_UNREACHABLE macro.
2019-01-14 14:16:26 -08:00
Shane Carr
768b577e6a ICU-20138 Adding FormattedValue APIs in C, C++, and Java.
- Wires up FormattedNumber[Range] in applicable languages.
- Adds new header files and tests, with minor cleanup to old tests.
- Adds code to guarantee terminating NUL in FormattedNumber[Range].
- Cleanup of API docs for inherited methods in FormattedNumber[Range].
2019-01-10 17:02:49 -06:00
Andy Heninger
58786f5cbe ICU-12079 Full width digits become numeric for word break. 2018-12-18 16:36:06 -08:00
Shane Carr
7ec3357d70 ICU-10923 Adding --filterDir option to genrb.
- Reads, parses, and applies the filter file syntax.
- Removes unused keys from the resource bundle.
- Adds sample filter txt file with test in intltest.
2018-12-13 16:18:47 -08:00
Mihai Nita
2666d18e54 ICU-9622 Adding support for date/time skeletons 2018-12-13 13:20:33 -08:00
Shane Carr
a2a39e69d0 ICU-10923 Adding initial version of data file filtering.
- Reads filters.json or .hjson from ICU_DATA_FILTER_FILE environment variable
- Adds DepTarget for dependency semantics, and warns for missing deps.
- Fixes certain tests that crash with sliced locale data.
- Includes support for 4 filter types.
2018-12-07 16:51:18 -08:00
Frank Tang
de4031b783 ICU-11053 Fix locale parsing which has _ timezone 2018-12-05 19:16:13 -08:00
Shane Carr
bb2b390b87 ICU-20186 Adding test for leading and trailing spaces in DecimalFormat. 2018-12-05 15:37:38 -08:00
Shane Carr
1e4a8d3c29 ICU-20186 Adding test for semicolon behavior and spacing in DecimalFormat. 2018-11-26 18:49:32 -06:00
Fredrik Roubert
6f932b744d ICU-20276 Accept empty strings in Locale::setUnicodeKeywordValue().
The API documentation is perfectly clear about this, an empty string for
the value means that the keyword should be removed:

  @param keywordValue value of the keyword to be set. If 0-length or
   NULL, will result in the keyword being removed. No error is given if
   that keyword does not exist.
2018-11-20 19:24:33 +01:00
Andy Heninger
47d455a725 ICU-20179 Remove platform-specific mutex and atomics implementations.
Remove all POSIX and Win32 specific mutex, atomic and threading implementations
in favor of C++11 std library functions.

Move the related (internal) ICU types and functions into the icu namespace.
2018-11-19 17:17:09 -08:00
Shane Carr
c0799c141b ICU-20230 Implementing COMPACT field.
Adds some plumbing to allow MutablePatternModifier to set fields, and otherwise builds upon the infrastructure from the previous commit to add the MEASURE_UNIT field.
2018-11-19 16:21:36 -07:00
Shane Carr
74bbf9e381 ICU-13267 Implementing MEASURE_UNIT field.
Adds plumbing to trim whitespace near the FormattedNumber API boundary.
That plumbing requires a change to dependencies.txt.
2018-11-15 21:37:32 -07:00
Dongyuan Liu
46a888be87 ICU-13441 For zh/ja, tailor linebreak classes for quotations such as “ 201C and ” 201D 2018-11-14 19:53:12 -08:00
Andy Heninger
d6c3b271fe ICU-20084 IntlTest, add WHERE macro; remove redundant TEST macros. 2018-11-13 11:08:35 -08:00
Markus Scherer
98f9170004 ICU-20250 make UnicodeSet(intprop=value) faster
- fastpath for UnicodeSet.add(new last range)
- fewer UnicodeSet memory allocations:
  initial internal list array, exponential array growth,
  allocate strings list/set only when first one is added
- faster CodePointTrie.getRange(): fewer calls to filter function
- revert UnicodeSet(intprop=value) from trie ranges to range starts + lookup
- cache per-int-prop range starts: fewer lookups
2018-11-12 16:05:57 -08:00
Shane Carr
e2882d961f ICU-13267 Minor documentation and test changes. 2018-11-08 17:13:39 -07:00
Shane Carr
11a559f319 ICU-13267 Refactoring field position testing logic into helper function.
Makes future field position logic easier to test.
2018-11-08 17:13:29 -07:00
Shane Carr
ba21ff79c4 ICU-13701 Syncs C and J increment rounding. Checks for nickel sooner. 2018-11-08 17:13:17 -07:00
Shane Carr
a1cc16ccd3 ICU-13701 Refactoring DecimalQuantity: removing lOptPos/rOptPos.
Combined ICU4C and ICU4J.
2018-11-08 02:43:31 -07:00
Jeff Genovy
9a5b7af83d ICU-13180 Support skiping building the UWP projects with a command line MSBuild option. 2018-11-06 16:02:03 -08:00
Shane Carr
53d8c8f3d1 ICU-20246 Fixing another integer overflow in number parsing. 2018-10-31 13:37:09 -07:00
Shane Carr
f8c09f776a ICU-20231 Adding tests for accounting with variable currency widths. 2018-10-29 16:29:06 -07:00
Shane Carr
fd5faeb48b ICU-20159 Fixing gcc warnings in project and test code. 2018-10-29 16:28:54 -07:00
Shane Carr
8018eb84e7 ICU-13701 Adding custom logic for nickel rounding, C and J.
Avoids expensive arithmetic when performing nickel rounding for currencies such as CAD, CHF, and DKK.
2018-10-29 16:28:42 -07:00
Jeff Genovy
5a34bfb151 ICU-20209 Fix build failures on Windows with std::atomic not in enclosing namespace std
Also: Change to use the ICU namespace macro instead, and skip doxygen as well.
2018-10-29 15:07:05 -07:00
Fredrik Roubert
10e79698d7 ICU-20228 Fix common typos for "language". 2018-10-24 20:54:10 +02:00
Fredrik Roubert
0da942bd52 ICU-20080 Avoid strange compiler behaviour in ASSERT_EQUAL() macro.
Using temporary variables for the two values to be compared here makes
GCC compile the code just like we expect it to. (What it really is that
it otherwise does on some architechtures remains a mystery.)

This will make the tests pass as expected also on IA-32 with GCC.

It'll also make it possible to revert the old workaround for SPARC
introduced by commit 5b0592af79.

Tested:

Linux gcc45 3.16.0-5-686-pae #1 SMP Debian 3.16.51-3+deb8u1 (2018-01-08) i686 GNU/Linux

Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0)
g++ (Debian 4.9.2-10+deb8u1) 4.9.2

Linux gcc202 4.16.0-1-sparc64-smp #1 SMP Debian 4.16.5-1 (2018-04-29) sparc64 GNU/Linux

clang version 4.0.1-10+sparc64 (tags/RELEASE_401/final)
g++ (Debian 8.2.0-7) 8.2.0
2018-10-19 11:45:09 +02:00
Andy Heninger
e509105c9b
ICU-20205 RelativeDateTimeFormatter pt data fix, improved error handling and test. (#210)
* ICU-20205 Add locale test for RelativeDateTimeFormatter.

* ICU-20205 Fix error in pt relative date data. Improve error handling in code.

* ICU-20205 Add instantiation test & regen data from ICU4C

* ICU-20205 Added DateFormatSymbols error check per jefgen's comments.
2018-10-12 16:19:14 -07:00
pedberg-icu
bac4c96020
ICU-20119 cldr release-34-alpha3 integration (#181)
ICU-20119 cldr release-34-alpha3 integration (PR #181):
* ICU-20119 63rc BRS, cldr 34-alpha3: add ku,xh; fixes for de/it CompactDec, availFmts yw amd MW patterns
* ICU-20119 Skip & log_knownIssue for Windows LCID mapping problem with ckb/ku
2018-09-28 16:09:15 -07:00
gnrunge
1b62e2c851
ICU-20119 Fixes for run-without-data BRS test. In all cases an error (#177)
check was needed in the test cases to prevent a segmentation fault.
2018-09-27 14:27:42 -07:00
Steven R. Loomis
53986cc57d
ICU-13685 Revert c: add @preview (retry) (#172)
This reverts commit 25f1589466c8b74ce36d762d4e9f3a72b3007eaf from  #8
2018-09-27 14:27:42 -07:00