addTest(root, &TestFallbackCodes, "tsutil/creststn/TestFallbackCodes");
addTest(root, &TestGetUTF8String, "tsutil/creststn/TestGetUTF8String");
addTest(root, &TestCLDRVersion, "tsutil/creststn/TestCLDRVersion");
+ addTest(root, &TestPreventFallback, "tsutil/creststn/TestPreventFallback");
#endif
addTest(root, &TestFallback, "tsutil/creststn/TestFallback");
addTest(root, &TestGetVersion, "tsutil/creststn/TestGetVersion");
++fail;
}
+static void TestPreventFallback() {
+ UResourceBundle* theBundle = NULL;
+ const char* testdatapath;
+ UErrorCode status = U_ZERO_ERROR;
+ UResourceBundle* res = NULL;
+ int32_t unused_len = 0;
+
+ testdatapath=loadTestData(&status);
+ if(U_FAILURE(status))
+ {
+ log_data_err("Could not load testdata.dat %s \n",myErrorName(status));
+ return;
+ }
+
+ // In te_IN locale, fallback of string_in_te_no_te_IN_fallback is blocked
+ // with the three empty-set (U+2205) chars.
+ theBundle = ures_open(testdatapath, "te_IN_NE", &status);
+ if(U_FAILURE(status))
+ {
+ log_data_err("Could not open resource bundle te_IN_NE %s \n",myErrorName(status));
+ return;
+ }
+
+ // Fallback is blocked
+ ures_getStringByKeyWithFallback(theBundle, "string_in_te_no_te_IN_fallback", &unused_len, &status);
+ if (status != U_MISSING_RESOURCE_ERROR)
+ {
+ log_err("Expected missing resource error for string_in_te_no_te_IN_fallback.");
+ }
+ status = U_ZERO_ERROR;
+
+ // This fallback should succeed
+ ures_getStringByKeyWithFallback(theBundle, "string_only_in_te", &unused_len, &status);
+ if(U_FAILURE(status))
+ {
+ log_err("Expected to find string_only_in_te %s \n",myErrorName(status));
+ }
+ status = U_ZERO_ERROR;
+ ures_close(theBundle);
+
+ // From te locale, we should be able to fetch string_in_te_no_te_IN_fallback.
+ theBundle = ures_open(testdatapath, "te", &status);
+ if(U_FAILURE(status))
+ {
+ log_data_err("Could not open resource bundle te_IN_NE %s \n",myErrorName(status));
+ return;
+ }
+ ures_getStringByKeyWithFallback(theBundle, "string_in_te_no_te_IN_fallback", &unused_len, &status);
+ if(U_FAILURE(status))
+ {
+ log_err("Expected to find string_in_te_no_te_IN_fallback %s \n",myErrorName(status));
+ }
+ status = U_ZERO_ERROR;
+ ures_close(theBundle);
+}
+
/**
* Test to make sure that the U_USING_FALLBACK_ERROR and U_USING_DEFAULT_ERROR
* are set correctly
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2012, International Business Machines Corporation and
+ * Copyright (c) 1997-2013, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/***************************************************************************
static void TestFallback(void);
+static void TestPreventFallback(void);
+
static void TestBinaryCollationData(void);
static void TestNewTypes(void);
//*******************************************************************************
//*
-//* Copyright (C) 1998-2010, International Business Machines
+//* Copyright (C) 1998-2013, International Business Machines
//* Corporation and others. All Rights Reserved.
//*
//*******************************************************************************
{
string_only_in_te { TE }
+ string_in_te_no_te_IN_fallback { TE_no_fallback }
+
array_only_in_te { TE0, TE1, TE2, TE3 }
array_2d_only_in_te
//*******************************************************************************
//*
-//* Copyright (C) 1998-2005, International Business Machines
+//* Copyright (C) 1998-2013, International Business Machines
//* Corporation and others. All Rights Reserved.
//*
//*******************************************************************************
string_only_in_te_IN { TE_IN }
+ string_in_te_no_te_IN_fallback { ∅∅∅ }
+
array_only_in_te_IN { TE_IN0, TE_IN1, TE_IN2, TE_IN3 }
array_2d_only_in_te_IN