From 46f091ab0dee565e05ce257c0c5cf95d266cd1b1 Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Fri, 9 May 2003 18:22:40 +0000 Subject: [PATCH] ICU-2439 fix test to work with short Asian language names X-SVN-Rev: 11863 --- icu4c/source/test/cintltst/cloctst.c | 2 +- icu4c/source/test/intltest/loctest.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/icu4c/source/test/cintltst/cloctst.c b/icu4c/source/test/cintltst/cloctst.c index b6fcd7110c8..fd6489f4f8f 100644 --- a/icu4c/source/test/cintltst/cloctst.c +++ b/icu4c/source/test/cintltst/cloctst.c @@ -443,7 +443,7 @@ static void TestDisplayNames() /* test that the default locale has a display name for its own language */ errorCode=U_ZERO_ERROR; length=uloc_getDisplayLanguage(NULL, NULL, buffer, LENGTHOF(buffer), &errorCode); - if(U_FAILURE(errorCode) || length<=3) { + if(U_FAILURE(errorCode) || (length<=3 && buffer[0]<=0x7f)) { /* check <=3 to reject getting the language code as a display name */ log_err("unable to get a display string for the language of the default locale - %s\n", u_errorName(errorCode)); } diff --git a/icu4c/source/test/intltest/loctest.cpp b/icu4c/source/test/intltest/loctest.cpp index fc3fec08cbe..52e45de6456 100644 --- a/icu4c/source/test/intltest/loctest.cpp +++ b/icu4c/source/test/intltest/loctest.cpp @@ -396,8 +396,8 @@ LocaleTest::TestDisplayNames() /* test that the default locale has a display name for its own language */ UnicodeString s; - Locale().getDisplayName(Locale(), s); - if(s.length()<=3) { + Locale().getDisplayLanguage(Locale(), s); + if(s.length()<=3 && s.charAt(0)<=0x7f) { /* check <=3 to reject getting the language code as a display name */ errln("unable to get a display string for the language of the default locale\n"); }