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

Unified Diff: source/test/cintltst/sorttest.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/reapits.c ('k') | source/test/cintltst/spreptst.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/test/cintltst/sorttest.c
diff --git a/source/test/cintltst/sorttest.c b/source/test/cintltst/sorttest.c
index e0f1a4b045429eeb75efa1b0ee214a4cda47aad3..f25c2acb1f77b6b6e68047e592a19baa112d4a62 100644
--- a/source/test/cintltst/sorttest.c
+++ b/source/test/cintltst/sorttest.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2003-2013, International Business Machines
+* Copyright (C) 2003-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -25,8 +25,6 @@
#include "cintltst.h"
#include "uarrsort.h"
-#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
-
static void
SortTest() {
uint16_t small[]={ 8, 1, 2, 5, 4, 3, 7, 6 };
@@ -39,12 +37,12 @@ SortTest() {
/* sort small array (stable) */
errorCode=U_ZERO_ERROR;
- uprv_sortArray(small, LENGTHOF(small), sizeof(small[0]), uprv_uint16Comparator, NULL, TRUE, &errorCode);
+ uprv_sortArray(small, UPRV_LENGTHOF(small), sizeof(small[0]), uprv_uint16Comparator, NULL, TRUE, &errorCode);
if(U_FAILURE(errorCode)) {
log_err("uprv_sortArray(small) failed - %s\n", u_errorName(errorCode));
return;
}
- for(i=1; i<LENGTHOF(small); ++i) {
+ for(i=1; i<UPRV_LENGTHOF(small); ++i) {
if(small[i-1]>small[i]) {
log_err("uprv_sortArray(small) mis-sorted [%d]=%u > [%d]=%u\n", i-1, small[i-1], i, small[i]);
return;
@@ -52,17 +50,17 @@ SortTest() {
}
/* for medium, add bits that will not be compared, to test stability */
- for(i=0; i<LENGTHOF(medium); ++i) {
+ for(i=0; i<UPRV_LENGTHOF(medium); ++i) {
medium[i]=(medium[i]<<4)|i;
}
/* sort medium array (stable) */
- uprv_sortArray(medium, LENGTHOF(medium), sizeof(medium[0]), uprv_int32Comparator, NULL, TRUE, &errorCode);
+ uprv_sortArray(medium, UPRV_LENGTHOF(medium), sizeof(medium[0]), uprv_int32Comparator, NULL, TRUE, &errorCode);
if(U_FAILURE(errorCode)) {
log_err("uprv_sortArray(medium) failed - %s\n", u_errorName(errorCode));
return;
}
- for(i=1; i<LENGTHOF(medium); ++i) {
+ for(i=1; i<UPRV_LENGTHOF(medium); ++i) {
if(medium[i-1]>=medium[i]) {
log_err("uprv_sortArray(medium) mis-sorted [%d]=%u > [%d]=%u\n", i-1, medium[i-1], i, medium[i]);
return;
@@ -71,12 +69,12 @@ SortTest() {
/* sort large array (not stable) */
errorCode=U_ZERO_ERROR;
- uprv_sortArray(large, LENGTHOF(large), sizeof(large[0]), uprv_uint32Comparator, NULL, FALSE, &errorCode);
+ uprv_sortArray(large, UPRV_LENGTHOF(large), sizeof(large[0]), uprv_uint32Comparator, NULL, FALSE, &errorCode);
if(U_FAILURE(errorCode)) {
log_err("uprv_sortArray(large) failed - %s\n", u_errorName(errorCode));
return;
}
- for(i=1; i<LENGTHOF(large); ++i) {
+ for(i=1; i<UPRV_LENGTHOF(large); ++i) {
if(large[i-1]>large[i]) {
log_err("uprv_sortArray(large) mis-sorted [%d]=%u > [%d]=%u\n", i-1, large[i-1], i, large[i]);
return;
« no previous file with comments | « source/test/cintltst/reapits.c ('k') | source/test/cintltst/spreptst.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698