| OLD | NEW |
| 1 /******************************************************************** | 1 /******************************************************************** |
| 2 * Copyright (c) 2011-2013, International Business Machines Corporation | 2 * Copyright (c) 2011-2014, International Business Machines Corporation |
| 3 * and others. All Rights Reserved. | 3 * and others. All Rights Reserved. |
| 4 ********************************************************************/ | 4 ********************************************************************/ |
| 5 /* C API TEST FOR PLURAL RULES */ | 5 /* C API TEST FOR PLURAL RULES */ |
| 6 | 6 |
| 7 #include "unicode/utypes.h" | 7 #include "unicode/utypes.h" |
| 8 | 8 |
| 9 #if !UCONFIG_NO_FORMATTING | 9 #if !UCONFIG_NO_FORMATTING |
| 10 | 10 |
| 11 #include "unicode/upluralrules.h" | 11 #include "unicode/upluralrules.h" |
| 12 #include "unicode/ustring.h" | 12 #include "unicode/ustring.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 41 { "en", 2, "other" }, | 41 { "en", 2, "other" }, |
| 42 { "fr", 0, "one" }, | 42 { "fr", 0, "one" }, |
| 43 { "fr", 0.5, "one" }, | 43 { "fr", 0.5, "one" }, |
| 44 { "fr", 1, "one" }, | 44 { "fr", 1, "one" }, |
| 45 { "fr", 1.5, "one" }, | 45 { "fr", 1.5, "one" }, |
| 46 { "fr", 2, "other" }, | 46 { "fr", 2, "other" }, |
| 47 { "ru", 0, "many" }, | 47 { "ru", 0, "many" }, |
| 48 { "ru", 0.5, "other" }, | 48 { "ru", 0.5, "other" }, |
| 49 { "ru", 1, "one" }, | 49 { "ru", 1, "one" }, |
| 50 { "ru", 1.5, "other" }, | 50 { "ru", 1.5, "other" }, |
| 51 { "ru", 2, "other" }, | 51 { "ru", 2, "few" }, |
| 52 { "ru", 5, "many" }, | 52 { "ru", 5, "many" }, |
| 53 { "ru", 10, "many" }, | 53 { "ru", 10, "many" }, |
| 54 { "ru", 11, "many" }, | 54 { "ru", 11, "many" }, |
| 55 { NULL, 0, NULL } | 55 { NULL, 0, NULL } |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 enum { | 58 enum { |
| 59 kKeywordBufLen = 32 | 59 kKeywordBufLen = 32 |
| 60 }; | 60 }; |
| 61 | 61 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 103 } |
| 104 U_STRING_INIT(two, "two", 3); | 104 U_STRING_INIT(two, "two", 3); |
| 105 length = uplrules_select(upr, 2., keyword, 8, &errorCode); | 105 length = uplrules_select(upr, 2., keyword, 8, &errorCode); |
| 106 if (U_FAILURE(errorCode) || u_strCompare(keyword, length, two, 3, FALSE) !=
0) { | 106 if (U_FAILURE(errorCode) || u_strCompare(keyword, length, two, 3, FALSE) !=
0) { |
| 107 log_data_err("uplrules_select(en-ordinal, 2) failed - %s\n", u_errorName
(errorCode)); | 107 log_data_err("uplrules_select(en-ordinal, 2) failed - %s\n", u_errorName
(errorCode)); |
| 108 } | 108 } |
| 109 uplrules_close(upr); | 109 uplrules_close(upr); |
| 110 } | 110 } |
| 111 | 111 |
| 112 #endif /* #if !UCONFIG_NO_FORMATTING */ | 112 #endif /* #if !UCONFIG_NO_FORMATTING */ |
| OLD | NEW |