+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2007, International Business Machines Corporation and
+ * Copyright (c) 1997-2016, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/********************************************************************************
#include "ccolltst.h"
#include "callcoll.h"
#include "cfrtst.h"
+#include "cmemory.h"
#include "unicode/ustring.h"
#include "string.h"
int32_t i;
UErrorCode status = U_ZERO_ERROR;
- myCollation = ucol_open("fr_FR", &status);
+ myCollation = ucol_open("fr_CA", &status);
if(U_FAILURE(status) || !myCollation){
- 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_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
return;
}
- log_verbose("Testing French Collation with Tertiary strength\n");
+ log_verbose("Testing fr_CA Collation with Tertiary strength\n");
ucol_setStrength(myCollation, UCOL_QUATERNARY);
for (i = 0; i < 12 ; i++)
{
int32_t i,j, testAcuteSize;
UCollationResult expected=UCOL_EQUAL;
UErrorCode status = U_ZERO_ERROR;
- myCollation = ucol_open("fr_FR", &status);
+ myCollation = ucol_open("fr_CA", &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_setAttribute(myCollation, UCOL_STRENGTH, UCOL_SECONDARY, &status);
log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
return;
}
- log_verbose("Testing French Collation with Secondary strength\n");
+ log_verbose("Testing fr_CA Collation with Secondary strength\n");
/*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++)
{
int32_t i, j;
UErrorCode status = U_ZERO_ERROR;
- myCollation = ucol_open("fr_FR", &status);
+ myCollation = ucol_open("fr_CA", &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 French Collation extra with secondary strength\n");
+ log_verbose("Testing fr_CA Collation extra with secondary strength\n");
ucol_setStrength(myCollation, UCOL_TERTIARY);
for (i = 0; i < 9 ; i++)
{
pCollator = ucol_openFromShortString("LFR_AN_CX_EX_FO_HX_NX_S3", 0, NULL, &status);
if (U_FAILURE(status)) {
- log_err("error opening collator\n");
+ log_data_err("error opening collator -> %s. (Are you missing data?)\n", u_errorName(status));
return;
}
lenActualSortKey = ucol_getSortKey(pCollator,
(const UChar *)pucUTF16,
- sizeof(pucUTF16) / sizeof(pucUTF16[0]),
+ UPRV_LENGTHOF(pucUTF16),
pucSortKey,
LENSORTKEY);