/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2001, International Business Machines Corporation and
+ * Copyright (c) 1997-2016, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/********************************************************************************
#include "encoll.h"
#include "ccolltst.h"
#include "callcoll.h"
+#include "cmemory.h"
#include "unicode/ustring.h"
static UCollator *myCollation = NULL;
static const UChar testMore[][MAX_TOKEN_LEN] = {
{(UChar)0x0061 /* 'a' */, (UChar)0x0065 /* 'e' */, 0},
- {(UChar)0x0061 /* 'a' */, (UChar)0x0066 /* 'f' */, 0},
{ 0x00E6, 0},
{ 0x00C6, 0},
+ {(UChar)0x0061 /* 'a' */, (UChar)0x0066 /* 'f' */, 0},
{(UChar)0x006F /* 'o' */, (UChar)0x0065 /* 'e' */, 0},
{ 0x0153, 0},
{ 0x0152, 0},
UErrorCode status = U_ZERO_ERROR;
myCollation = ucol_open("en_US", &status);
if(U_FAILURE(status)){
- log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
+ log_err_status(status, "ERROR: in creation of rule based collator: %s\n", myErrorName(status));
return;
}
log_verbose("Testing English Collation with Tertiary strength\n");
}
}
/*test more interesting cases */
- testMoreSize = sizeof(testMore) / sizeof(testMore[0]);
+ testMoreSize = UPRV_LENGTHOF(testMore);
for (i = 0; i < testMoreSize; i++)
{
for (j = 0; j < testMoreSize; j++)
UErrorCode status = U_ZERO_ERROR;
myCollation = ucol_open("en_US", &status);
if(U_FAILURE(status)){
- log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
+ log_err_status(status, "ERROR: in creation of rule based collator: %s\n", myErrorName(status));
return;
}
ucol_setStrength(myCollation, UCOL_PRIMARY);
UErrorCode status = U_ZERO_ERROR;
myCollation = ucol_open("en_US", &status);
if(U_FAILURE(status)){
- log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
+ log_err_status(status, "ERROR: in creation of rule based collator: %s\n", myErrorName(status));
return;
}
ucol_setStrength(myCollation, UCOL_SECONDARY);
/*test acute and grave ordering (compare to french collation) */
- testAcuteSize = sizeof(testAcute) / sizeof(testAcute[0]);
+ testAcuteSize = UPRV_LENGTHOF(testAcute);
for (i = 0; i < testAcuteSize; i++)
{
for (j = 0; j < testAcuteSize; j++)