]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/cintltst/spooftest.c
ICU-551.30.tar.gz
[apple/icu.git] / icuSources / test / cintltst / spooftest.c
index 7096ad263a922fb5f3dafdadd7ea7a57bd5d8551..536754f72f34dcf70e3f7a40edb2478af6c751c3 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 2009-2013, International Business Machines Corporation and
+ * Copyright (c) 2009-2014, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 /********************************************************************************
@@ -132,9 +132,9 @@ static void TestUSpoofCAPI(void) {
     const char *dataSrcDir;
     char       *fileName;
     char       *confusables;
-    int         confusablesLength;
+    int         confusablesLength = 0;
     char       *confusablesWholeScript;
-    int         confusablesWholeScriptLength;
+    int         confusablesWholeScriptLength = 0;
     FILE       *f;
     UParseError pe;
     int32_t     errType;
@@ -148,8 +148,8 @@ static void TestUSpoofCAPI(void) {
     TEST_ASSERT_NE(f, NULL);
     confusables = malloc(3000000);
     if (f != NULL) {
-    confusablesLength = fread(confusables, 1, 3000000, f);
-    fclose(f);
+        confusablesLength = fread(confusables, 1, 3000000, f);
+        fclose(f);
     }
 
     strcpy(fileName, dataSrcDir);
@@ -158,8 +158,8 @@ static void TestUSpoofCAPI(void) {
     TEST_ASSERT_NE(f, NULL);
     confusablesWholeScript = malloc(1000000);
     if (f != NULL) {
-    confusablesWholeScriptLength = fread(confusablesWholeScript, 1, 1000000, f);
-    fclose(f);
+        confusablesWholeScriptLength = fread(confusablesWholeScript, 1, 1000000, f);
+        fclose(f);
     }
 
     rsc = uspoof_openFromSource(confusables, confusablesLength,
@@ -529,6 +529,24 @@ static void TestUSpoofCAPI(void) {
         status = U_ZERO_ERROR;
 
     TEST_TEARDOWN;
+
+    /*
+     * get Inclusion and Recommended sets
+     */
+    TEST_SETUP
+        const USet *inclusions = NULL;
+        const USet *recommended = NULL;
+
+        inclusions = uspoof_getInclusionSet(&status);
+        TEST_ASSERT_SUCCESS(status);
+        TEST_ASSERT_EQ(TRUE, uset_isFrozen(inclusions));
+
+        status = U_ZERO_ERROR;
+        recommended = uspoof_getRecommendedSet(&status);
+        TEST_ASSERT_SUCCESS(status);
+        TEST_ASSERT_EQ(TRUE, uset_isFrozen(recommended));
+    TEST_TEARDOWN;
+
 }
 
 #endif  /* UCONFIG_NO_REGULAR_EXPRESSIONS */