OLD | NEW |
1 /*********************************************************************** | 1 /*********************************************************************** |
2 * Copyright (c) 1997-2013, International Business Machines Corporation | 2 * Copyright (c) 1997-2014, International Business Machines Corporation |
3 * and others. All Rights Reserved. | 3 * and others. All Rights Reserved. |
4 ***********************************************************************/ | 4 ***********************************************************************/ |
5 | 5 |
6 #include "unicode/utypes.h" | 6 #include "unicode/utypes.h" |
7 | 7 |
8 #if !UCONFIG_NO_FORMATTING | 8 #if !UCONFIG_NO_FORMATTING |
9 | 9 |
10 #include "numrgts.h" | 10 #include "numrgts.h" |
11 | 11 |
12 #include <float.h> // DBL_MIN, DBL_MAX | 12 #include <float.h> // DBL_MIN, DBL_MAX |
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 | 1030 |
1031 /* @bug 4071014 | 1031 /* @bug 4071014 |
1032 * Data rounding errors for German (Germany) locale | 1032 * Data rounding errors for German (Germany) locale |
1033 */ | 1033 */ |
1034 void NumberFormatRegressionTest::Test4071014 (void) | 1034 void NumberFormatRegressionTest::Test4071014 (void) |
1035 { | 1035 { |
1036 NumberFormat *formatter; | 1036 NumberFormat *formatter; |
1037 UnicodeString tempString; | 1037 UnicodeString tempString; |
1038 /* user error : | 1038 /* user error : |
1039 String expectedDefault = "-5.789,987"; | 1039 String expectedDefault = "-5.789,987"; |
1040 String expectedCurrency = "5.789,98 DEM"; | 1040 String expectedCurrency = "5.789,98 DM"; |
1041 String expectedPercent = "-578.998%"; | 1041 String expectedPercent = "-578.998%"; |
1042 */ | 1042 */ |
1043 UnicodeString expectedDefault("-5.789,988"); | 1043 UnicodeString expectedDefault("-5.789,988"); |
1044 UnicodeString expectedCurrency("5.789,99\\u00A0DEM"); | 1044 UnicodeString expectedCurrency("5.789,99\\u00A0DM"); |
1045 UnicodeString expectedPercent("-578.999\\u00A0%"); | 1045 UnicodeString expectedPercent("-578.999\\u00A0%"); |
1046 | 1046 |
1047 expectedCurrency = expectedCurrency.unescape(); | 1047 expectedCurrency = expectedCurrency.unescape(); |
1048 expectedPercent = expectedPercent.unescape(); | 1048 expectedPercent = expectedPercent.unescape(); |
1049 | 1049 |
1050 UErrorCode status = U_ZERO_ERROR; | 1050 UErrorCode status = U_ZERO_ERROR; |
1051 char loc[256]={0}; | 1051 char loc[256]={0}; |
1052 uloc_canonicalize("de_DE_PREEURO", loc, 256, &status); | 1052 uloc_canonicalize("de_DE_PREEURO", loc, 256, &status); |
1053 formatter = NumberFormat::createInstance(Locale(loc), status); | 1053 formatter = NumberFormat::createInstance(Locale(loc), status); |
1054 if (failure(status, "NumberFormat::createNumberInstance", loc, TRUE)){ | 1054 if (failure(status, "NumberFormat::createNumberInstance", loc, TRUE)){ |
(...skipping 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3018 TEST_ASSERT(999999 == s.length()); | 3018 TEST_ASSERT(999999 == s.length()); |
3019 TEST_ASSERT(999997 == pos.getBeginIndex()); | 3019 TEST_ASSERT(999997 == pos.getBeginIndex()); |
3020 TEST_ASSERT(999998 == pos.getEndIndex()); | 3020 TEST_ASSERT(999998 == pos.getEndIndex()); |
3021 | 3021 |
3022 UnicodeString expected(num, -1, US_INV); | 3022 UnicodeString expected(num, -1, US_INV); |
3023 TEST_ASSERT(expected == s); | 3023 TEST_ASSERT(expected == s); |
3024 delete [] num; | 3024 delete [] num; |
3025 } | 3025 } |
3026 | 3026 |
3027 #endif /* #if !UCONFIG_NO_FORMATTING */ | 3027 #endif /* #if !UCONFIG_NO_FORMATTING */ |
OLD | NEW |