| OLD | NEW |
| 1 /******************************************************************** | 1 /******************************************************************** |
| 2 * COPYRIGHT: | 2 * COPYRIGHT: |
| 3 * Copyright (c) 1997-2009, International Business Machines Corporation and | 3 * Copyright (c) 1997-2014, International Business Machines Corporation and |
| 4 * others. All Rights Reserved. | 4 * others. All Rights Reserved. |
| 5 ********************************************************************/ | 5 ********************************************************************/ |
| 6 | 6 |
| 7 #include "unicode/utypes.h" | 7 #include "unicode/utypes.h" |
| 8 | 8 |
| 9 #include "cstring.h" | 9 #include "cstring.h" |
| 10 #include "unicode/unistr.h" | 10 #include "unicode/unistr.h" |
| 11 #include "unicode/uniset.h" | 11 #include "unicode/uniset.h" |
| 12 #include "unicode/resbund.h" | 12 #include "unicode/resbund.h" |
| 13 #include "restest.h" | 13 #include "restest.h" |
| 14 | 14 |
| 15 #include <stdlib.h> | 15 #include <stdlib.h> |
| 16 #include <time.h> | 16 #include <time.h> |
| 17 #include <string.h> | 17 #include <string.h> |
| 18 #include <limits.h> | 18 #include <limits.h> |
| 19 | 19 |
| 20 //******************************************************************************
********* | 20 //******************************************************************************
********* |
| 21 | 21 |
| 22 static const UChar kErrorUChars[] = { 0x45, 0x52, 0x52, 0x4f, 0x52, 0 }; | 22 static const UChar kErrorUChars[] = { 0x45, 0x52, 0x52, 0x4f, 0x52, 0 }; |
| 23 static const int32_t kErrorLength = 5; | 23 static const int32_t kErrorLength = 5; |
| 24 static const int32_t kERROR_COUNT = -1234567; | |
| 25 | 24 |
| 26 //******************************************************************************
********* | 25 //******************************************************************************
********* |
| 27 | 26 |
| 28 enum E_Where | 27 enum E_Where |
| 29 { | 28 { |
| 30 e_Root, | 29 e_Root, |
| 31 e_te, | 30 e_te, |
| 32 e_te_IN, | 31 e_te_IN, |
| 33 e_Where_count | 32 e_Where_count |
| 34 }; | 33 }; |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 continue; | 605 continue; |
| 607 } | 606 } |
| 608 | 607 |
| 609 ResourceBundle res = rb.get(test[i].resourceKey, status); | 608 ResourceBundle res = rb.get(test[i].resourceKey, status); |
| 610 if(U_FAILURE(status)) | 609 if(U_FAILURE(status)) |
| 611 { | 610 { |
| 612 err("Couldn't find the key %s. Error: %s\n", test[i].resourceKey, u_
errorName(status)); | 611 err("Couldn't find the key %s. Error: %s\n", test[i].resourceKey, u_
errorName(status)); |
| 613 status = U_ZERO_ERROR; | 612 status = U_ZERO_ERROR; |
| 614 continue; | 613 continue; |
| 615 } | 614 } |
| 616 | 615 |
| 617 locale = res.getLocale(ULOC_REQUESTED_LOCALE, status); | 616 locale = res.getLocale(ULOC_REQUESTED_LOCALE, status); |
| 618 if(locale != Locale::getDefault()) { | 617 if(U_SUCCESS(status) && locale != Locale::getDefault()) { |
| 619 err("Expected requested locale to be %s. Got %s\n", test[i].requeste
dLocale, locale.getName()); | 618 err("Expected requested locale to be %s. Got %s\n", test[i].requeste
dLocale, locale.getName()); |
| 620 } | 619 } |
| 620 status = U_ZERO_ERROR; |
| 621 locale = res.getLocale(ULOC_VALID_LOCALE, status); | 621 locale = res.getLocale(ULOC_VALID_LOCALE, status); |
| 622 if(strcmp(locale.getName(), test[i].validLocale) != 0) { | 622 if(strcmp(locale.getName(), test[i].validLocale) != 0) { |
| 623 err("Expected valid locale to be %s. Got %s\n", test[i].requestedLoc
ale, locale.getName()); | 623 err("Expected valid locale to be %s. Got %s\n", test[i].requestedLoc
ale, locale.getName()); |
| 624 } | 624 } |
| 625 locale = res.getLocale(ULOC_ACTUAL_LOCALE, status); | 625 locale = res.getLocale(ULOC_ACTUAL_LOCALE, status); |
| 626 if(strcmp(locale.getName(), test[i].actualLocale) != 0) { | 626 if(strcmp(locale.getName(), test[i].actualLocale) != 0) { |
| 627 err("Expected actual locale to be %s. Got %s\n", test[i].requestedLo
cale, locale.getName()); | 627 err("Expected actual locale to be %s. Got %s\n", test[i].requestedLo
cale, locale.getName()); |
| 628 } | 628 } |
| 629 } | 629 } |
| 630 } | 630 } |
| 631 | |
| 632 //eof | |
| 633 | |
| OLD | NEW |