Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(681)

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

Issue 288320043: ticket:12012: Replace all sizeof p / sizeof T with UPRV_LENGTHOF(). (Closed) Base URL: svn+ssh://source.icu-project.org/repos/icu/icu/trunk
Patch Set: Code review. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/test/cintltst/spooftest.c ('k') | source/test/intltest/icusvtst.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/test/cintltst/usrchtst.c
diff --git a/source/test/cintltst/usrchtst.c b/source/test/cintltst/usrchtst.c
index e425e552acabd9f7e3528bf8e2d2daad0f8de567..0c233af2e7fe3eb374afe66a4b218529de1d2ebc 100644
--- a/source/test/cintltst/usrchtst.c
+++ b/source/test/cintltst/usrchtst.c
@@ -1,5 +1,5 @@
/********************************************************************
- * Copyright (c) 2001-2011,2015,2016 International Business Machines
+ * Copyright (c) 2001-2016 International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************
* File usrchtst.c
@@ -2896,8 +2896,8 @@ static void TestPCEBuffer_100df(void) {
{ 0x0020, 0x0020, 0x00df, 0x0020, 0x0041, 0x00df, 0x0020, 0x0061, 0x00df, 0x0020, 0x00c5, 0x00df, 0x0020, 0x212b, 0x00df, 0x0020, 0x0041, 0x030a, 0x00df, 0x0020, 0x00e5, 0x00df, 0x0020, 0x0061, 0x02da, 0x00df, 0x0020, 0x0061, 0x030a, 0x00df, 0x0020, 0xd8fa, 0xdeae, 0x00df, 0x0020, 0x2027, 0x00df }; /* 38 cp, 9 of them unpaired surrogates */
UChar source[] =
{ 0x0020, 0x0020, 0x00df, 0x0020, 0x0041, 0x00df, 0x0020, 0x0061, 0x00df, 0x0020, 0x00c5, 0x00df, 0x0020, 0x212b, 0x00df, 0x0020, 0x0041, 0x030a, 0x00df, 0x0020, 0x00e5, 0x00df, 0x0020, 0x0061, 0x02da, 0x00df, 0x0020, 0x0061, 0x030a, 0x00df, 0x0020, 0xd8fa, 0xdeae, 0x00df, 0x0020, 0x2027, 0x00df };
- uint32_t searchLen = sizeof(search)/sizeof(UChar);
- uint32_t sourceLen = sizeof(source)/sizeof(UChar);
+ uint32_t searchLen = UPRV_LENGTHOF(search);
+ uint32_t sourceLen = UPRV_LENGTHOF(source);
TestPCEBuffer_with(search,searchLen,source,sourceLen);
}
@@ -2907,8 +2907,8 @@ static void TestPCEBuffer_2surr(void) {
{ 0x0020, 0x0020, 0xdfff, 0x0020, 0x0041, 0xdfff, 0x0020, 0x0061, 0xdfff, 0x0020, 0x00c5, 0xdfff, 0x0020, 0x212b, 0xdfff, 0x0020, 0x0041, 0x030a, 0xdfff, 0x0020, 0x00e5, 0xdfff, 0x0020, 0x0061, 0x02da, 0xdfff, 0x0020, 0x0061, 0x030a, 0xdfff, 0x0020, 0xd8fa, 0xdeae, 0xdfff, 0x0020, 0x2027, 0xdfff }; /* 38 cp, 9 of them unpaired surrogates */
UChar source[] =
{ 0x0020, 0x0020, 0xdfff, 0x0020, 0x0041, 0xdfff, 0x0020, 0x0061, 0xdfff, 0x0020, 0x00c5, 0xdfff, 0x0020, 0x212b, 0xdfff, 0x0020, 0x0041, 0x030a, 0xdfff, 0x0020, 0x00e5, 0xdfff, 0x0020, 0x0061, 0x02da, 0xdfff, 0x0020, 0x0061, 0x030a, 0xdfff, 0x0020, 0xd8fa, 0xdeae, 0xdfff, 0x0020, 0x2027, 0xdfff };
- uint32_t searchLen = sizeof(search)/sizeof(UChar);
- uint32_t sourceLen = sizeof(source)/sizeof(UChar);
+ uint32_t searchLen = UPRV_LENGTHOF(search);
+ uint32_t sourceLen = UPRV_LENGTHOF(source);
TestPCEBuffer_with(search,searchLen,source,sourceLen);
}
@@ -2927,8 +2927,8 @@ static void TestMatchFollowedByIgnorables(void) {
int32_t matchLength = 0;
const int32_t expectedMatchLength = 1;
- searchLen = sizeof(search)/sizeof(UChar);
- sourceLen = sizeof(source)/sizeof(UChar);
+ searchLen = UPRV_LENGTHOF(search);
+ sourceLen = UPRV_LENGTHOF(source);
coll = ucol_openFromShortString("LHR_AN_CX_EX_FX_HX_NX_S3",
FALSE,
« no previous file with comments | « source/test/cintltst/spooftest.c ('k') | source/test/intltest/icusvtst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b