diff --git a/icu4c/source/common/ubrk.cpp b/icu4c/source/common/ubrk.cpp index 27195be3da6..1deb2bb0594 100644 --- a/icu4c/source/common/ubrk.cpp +++ b/icu4c/source/common/ubrk.cpp @@ -62,7 +62,7 @@ ubrk_open(UBreakIteratorType type, break; default: - U_ASSERT(FALSE); + *status = U_ILLEGAL_ARGUMENT_ERROR; } // check for allocation error diff --git a/icu4c/source/test/cintltst/cbiapts.c b/icu4c/source/test/cintltst/cbiapts.c index 45e2389607b..fe597ae1857 100644 --- a/icu4c/source/test/cintltst/cbiapts.c +++ b/icu4c/source/test/cintltst/cbiapts.c @@ -1,6 +1,6 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 1997-2005, International Business Machines Corporation and + * Copyright (c) 1997-2006, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ /******************************************************************************** @@ -190,11 +190,11 @@ static void TestBreakIteratorCAPI() /*trying to open an illegal iterator*/ bogus = ubrk_open((UBreakIteratorType)5, "en_US", text, u_strlen(text), &status); if(U_SUCCESS(status)){ - log_err("FAIL: Error in ubrk_open() for BOGUS breakiterator. Expected U_MEMORY_ALLOCATION_ERROR\n"); + log_err("FAIL: Error in ubrk_open() for BOGUS breakiterator. Expected U_ILLEGAL_ARGUMENT_ERROR\n"); } if(U_FAILURE(status)){ - if(status != U_MEMORY_ALLOCATION_ERROR){ - log_err("FAIL: Error in ubrk_open() for BOGUS breakiterator. Expected U_MEMORY_ALLOCATION_ERROR\n Got %s\n", myErrorName(status)); + if(status != U_ILLEGAL_ARGUMENT_ERROR){ + log_err("FAIL: Error in ubrk_open() for BOGUS breakiterator. Expected U_ILLEGAL_ARGUMENT_ERROR\n Got %s\n", myErrorName(status)); } } status=U_ZERO_ERROR;