Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: source/test/cintltst/cdtdptst.c

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/test/cintltst/cdtdptst.h ('k') | source/test/cintltst/cdtrgtst.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/test/cintltst/cdtdptst.c
diff --git a/source/test/cintltst/cdtdptst.c b/source/test/cintltst/cdtdptst.c
index e1b03dd9d4cda622cedb6baa81c617e3c7b36ed7..4151efe7807a6de2ff765e08c16bc8128198e824 100644
--- a/source/test/cintltst/cdtdptst.c
+++ b/source/test/cintltst/cdtdptst.c
@@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2012, International Business Machines Corporation and
+ * Copyright (c) 1997-2014, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/********************************************************************************
@@ -38,6 +38,8 @@ void addDtFrDepTest(TestNode** root)
addTest(root, &TestRunTogetherPattern985, "tsformat/cdtdptst/TestRunTogetherPattern985");
addTest(root, &TestCzechMonths459, "tsformat/cdtdptst/TestCzechMonths459");
addTest(root, &TestQuotePattern161, "tsformat/cdtdptst/TestQuotePattern161");
+ addTest(root, &TestBooleanAttributes, "tsformat/cdtdptst/TestBooleanAttributes");
+
}
@@ -349,4 +351,35 @@ void TestQuotePattern161()
ctest_resetTimeZone();
}
+/*
+ * Testing udat_getBooleanAttribute and unum_setBooleanAttribute() to make sure basic C wrapper functionality is present
+ */
+void TestBooleanAttributes(void)
+{
+ UDateFormat *en;
+ UErrorCode status=U_ZERO_ERROR;
+ UBool initialState = TRUE;
+ UBool switchedState = FALSE;
+
+ log_verbose("\ncreating a date format with english locale\n");
+ en = udat_open(UDAT_FULL, UDAT_DEFAULT, "en_US", NULL, 0, NULL, 0, &status);
+ if(U_FAILURE(status)) {
+ log_data_err("error in creating the dateformat -> %s (Are you missing data?)\n",
+ myErrorName(status) );
+ return;
+ }
+
+
+ initialState = udat_getBooleanAttribute(en, UDAT_PARSE_ALLOW_NUMERIC, &status);
+ if(initialState != TRUE) switchedState = TRUE; // if it wasn't the default of TRUE, then flip what we expect
+
+ udat_setBooleanAttribute(en, UDAT_PARSE_ALLOW_NUMERIC, switchedState, &status);
+ if(switchedState != udat_getBooleanAttribute(en, UDAT_PARSE_ALLOW_NUMERIC, &status)) {
+ log_err("unable to switch states!");
+ return;
+ }
+
+ udat_close(en);
+}
+
#endif /* #if !UCONFIG_NO_FORMATTING */
« no previous file with comments | « source/test/cintltst/cdtdptst.h ('k') | source/test/cintltst/cdtrgtst.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698