/*
******************************************************************************
* *
-* Copyright (C) 2003-2012, International Business Machines *
+* Copyright (C) 2003-2013, International Business Machines *
* Corporation and others. All Rights Reserved. *
* *
******************************************************************************
static const char* const exemplarSetTypes[] = { "ExemplarCharacters",
"AuxExemplarCharacters",
- "ExemplarCharactersIndex"};
+ "ExemplarCharactersIndex",
+ "ExemplarCharactersPunctuation"};
const UChar *exemplarChars = NULL;
int32_t len = 0;
UErrorCode localStatus = U_ZERO_ERROR;
/*
******************************************************************************
* *
-* Copyright (C) 2003-2012, International Business Machines *
+* Copyright (C) 2003-2013, International Business Machines *
* Corporation and others. All Rights Reserved. *
* *
******************************************************************************
ULOCDATA_ES_AUXILIARY=1,
/** Index Character set @stable ICU 4.8 */
ULOCDATA_ES_INDEX=2,
+ /** Punctuation set @draft ICU 51 */
+ ULOCDATA_ES_PUNCTUATION=3,
/** One higher than the last valid type @stable ICU 3.4 */
- ULOCDATA_ES_COUNT=3
+ ULOCDATA_ES_COUNT=4
} ULocaleDataExemplarSetType;
/** The possible types of delimiters.
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2012, International Business Machines Corporation and
+ * Copyright (c) 1997-2013, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/*****************************************************************************
TESTCASE(TestForLanguageTag);
TESTCASE(TestTrailingNull);
TESTCASE(TestUnicodeDefines);
+ TESTCASE(TestEnglishExemplarCharacters);
}
}
#endif
}
+static void TestEnglishExemplarCharacters(void) {
+ UErrorCode status = U_ZERO_ERROR;
+ int i;
+ USet *exSet = NULL;
+ UChar testChars[] = {
+ 0x61, /* standard */
+ 0xE1, /* auxiliary */
+ 0x41, /* index */
+ 0x2D /* punctuation */
+ };
+ ULocaleData *uld = ulocdata_open("en", &status);
+ if (U_FAILURE(status)) {
+ log_err("ulocdata_open() failed\n");
+ return;
+ }
+
+ for (i = 0; i < ULOCDATA_ES_COUNT; i++) {
+ exSet = ulocdata_getExemplarSet(uld, exSet, 0, (ULocaleDataExemplarSetType)i, &status);
+ if (U_FAILURE(status)) {
+ /* until pucntuation data problem is resolved */
+ /* log_err_status(status, "ulocdata_getExemplarSet() for type %d failed\n", i); */
+ log_verbose("ulocdata_getExemplarSet() for type %d failed\n", i);
+ status = U_ZERO_ERROR;
+ continue;
+ }
+ if (!uset_contains(exSet, (UChar32)testChars[i])) {
+ log_err("Character U+%04X is not included in exemplar type %d\n", testChars[i], i);
+ }
+ }
+
+ uset_close(exSet);
+ ulocdata_close(uld);
+}
static void TestNonexistentLanguageExemplars(void) {
/* JB 4068 - Nonexistent language */
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2010, International Business Machines Corporation and
+ * Copyright (c) 1997-2013, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/********************************************************************************
*/
static void TestForLanguageTag(void);
static void TestToLanguageTag(void);
+
+/**
+ * locale data
+ */
+static void TestEnglishExemplarCharacters(void);
+
#endif