ICU-832 Each test string does not need to be 128 UChars big.
Setting MAX_TOKEN_LEN to a lower limit takes out about 100K from the executable on Windows. If you need larger test string, you can raise the limit where it's needed. X-SVN-Rev: 4411
This commit is contained in:
parent
f2e4587c90
commit
c0ecb9aa96
@ -24,14 +24,9 @@
|
||||
|
||||
|
||||
|
||||
/* static constants */
|
||||
#define MAX_TOKEN_LEN 128
|
||||
|
||||
/* tests comparison of custom collation with different strengths */
|
||||
void doTest(UCollator*, const UChar* source, const UChar* target, UCollationResult result);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
|
||||
#include "cintltst.h"
|
||||
#define MAX_TOKEN_LEN 128
|
||||
#define MAX_TOKEN_LEN 16
|
||||
|
||||
|
||||
/**
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
#define MAX_TOKEN_LEN 128
|
||||
#define MAX_TOKEN_LEN 16
|
||||
/* Perform Collation Currency Test */
|
||||
void currTest(void);
|
||||
|
||||
|
@ -24,18 +24,15 @@
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
#define MAX_TOKEN_LEN 128
|
||||
#define MAX_TOKEN_LEN 24
|
||||
|
||||
|
||||
/* performs test with strength PRIMARY */
|
||||
static void TestPrimary(void);
|
||||
static void TestPrimary(void);
|
||||
|
||||
/* perform test with strength TERTIARY*/
|
||||
static void TestTertiary(void);
|
||||
static void TestTertiary(void);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -25,9 +25,8 @@
|
||||
#include "cintltst.h"
|
||||
|
||||
|
||||
#define MAX_TOKEN_LEN 128
|
||||
|
||||
|
||||
#define MAX_TOKEN_LEN 16
|
||||
|
||||
/* performs test with strength PRIMARY */
|
||||
static void TestPrimary(void);
|
||||
|
||||
@ -35,8 +34,6 @@ static void TestPrimary(void);
|
||||
static void TestTertiary(void);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "cintltst.h"
|
||||
|
||||
|
||||
#define MAX_TOKEN_LEN 128
|
||||
#define MAX_TOKEN_LEN 16
|
||||
|
||||
|
||||
/* perform test with strength SECONDARY */
|
||||
|
@ -25,8 +25,8 @@
|
||||
#include "cintltst.h"
|
||||
|
||||
|
||||
#define MAX_TOKEN_LEN 128
|
||||
|
||||
#define MAX_TOKEN_LEN 16
|
||||
|
||||
|
||||
/* perform test with strength SECONDARY*/
|
||||
static void TestPrimary(void);
|
||||
@ -35,6 +35,5 @@ static void TestPrimary(void);
|
||||
static void TestTertiary(void);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -24,9 +24,8 @@
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
#define MAX_TOKEN_LEN 128
|
||||
#define MAX_TOKEN_LEN 16
|
||||
|
||||
|
||||
/* performs Extra tests*/
|
||||
static void TestExtra(void);
|
||||
|
||||
@ -37,6 +36,5 @@
|
||||
static void TestTertiary(void);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -40,12 +40,11 @@
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
#define MAX_TOKEN_LEN 128
|
||||
#define MAX_TOKEN_LEN 16
|
||||
#define TESTLOCALES 12
|
||||
#define FIXEDTESTSET 15
|
||||
#define TOTALTESTSET 30
|
||||
|
||||
|
||||
/* perform test for G7 locales */
|
||||
static void TestG7Locales(void);
|
||||
|
||||
|
@ -24,8 +24,8 @@
|
||||
#include "unicode/utypes.h"
|
||||
#include "unicode/ucol.h"
|
||||
|
||||
#define MAX_TOKEN_LEN 128
|
||||
|
||||
#define MAX_TOKEN_LEN 16
|
||||
|
||||
/**
|
||||
* Test for CollationElementIterator previous and next for the whole set of
|
||||
* unicode characters.
|
||||
@ -39,7 +39,7 @@
|
||||
*
|
||||
*/
|
||||
static void TestPrevious(void);
|
||||
|
||||
|
||||
/**
|
||||
* Test for getOffset() and setOffset()
|
||||
*/
|
||||
|
@ -28,9 +28,9 @@
|
||||
#include "cintltst.h"
|
||||
|
||||
|
||||
#define MAX_TOKEN_LEN 128
|
||||
#define MAX_TOKEN_LEN 16
|
||||
|
||||
|
||||
|
||||
/*perform test with strength TERTIARY*/
|
||||
static void TestTertiary(void);
|
||||
|
||||
|
@ -28,6 +28,9 @@
|
||||
#include "ucol_tok.h"
|
||||
#include "cmemory.h"
|
||||
|
||||
#define MAX_TOKEN_LEN 16
|
||||
|
||||
|
||||
static UCollator *myCollation;
|
||||
const static UChar gRules[MAX_TOKEN_LEN] =
|
||||
/*" & 0 < 1,\u2461<a,A"*/
|
||||
@ -35,26 +38,26 @@ const static UChar gRules[MAX_TOKEN_LEN] =
|
||||
|
||||
const static UChar testCase[][MAX_TOKEN_LEN] =
|
||||
{
|
||||
/*0*/ {0x0031 /*'1'*/, 0x0061/*'a'*/, 0x0000},
|
||||
/*1*/ {0x0031 /*'1'*/, 0x0041/*'A'*/, 0x0000},
|
||||
/*2*/ {0x2460 /*circ'1'*/, 0x0061/*'a'*/, 0x0000},
|
||||
/*0*/ {0x0031 /*'1'*/, 0x0061/*'a'*/, 0x0000},
|
||||
/*1*/ {0x0031 /*'1'*/, 0x0041/*'A'*/, 0x0000},
|
||||
/*2*/ {0x2460 /*circ'1'*/, 0x0061/*'a'*/, 0x0000},
|
||||
/*3*/ {0x2460 /*circ'1'*/, 0x0041/*'A'*/, 0x0000}
|
||||
};
|
||||
|
||||
const static UCollationResult caseTestResults[][9] =
|
||||
{
|
||||
{ UCOL_LESS, UCOL_LESS, UCOL_LESS, 0, UCOL_LESS, UCOL_LESS, 0, 0, UCOL_LESS },
|
||||
{ UCOL_LESS, UCOL_LESS, UCOL_LESS, 0, UCOL_LESS, UCOL_LESS, 0, 0, UCOL_LESS },
|
||||
{ UCOL_GREATER, UCOL_LESS, UCOL_LESS, 0, UCOL_LESS, UCOL_LESS, 0, 0, UCOL_GREATER },
|
||||
{ UCOL_LESS, UCOL_LESS, UCOL_LESS, 0, UCOL_GREATER, UCOL_LESS, 0, 0, UCOL_LESS },
|
||||
{ UCOL_LESS, UCOL_LESS, UCOL_LESS, 0, UCOL_GREATER, UCOL_LESS, 0, 0, UCOL_LESS },
|
||||
{ UCOL_GREATER, UCOL_LESS, UCOL_GREATER, 0, UCOL_LESS, UCOL_LESS, 0, 0, UCOL_GREATER }
|
||||
|
||||
};
|
||||
|
||||
const static UColAttributeValue caseTestAttributes[][2] =
|
||||
{
|
||||
{ UCOL_LOWER_FIRST, UCOL_OFF},
|
||||
{ UCOL_UPPER_FIRST, UCOL_OFF},
|
||||
{ UCOL_LOWER_FIRST, UCOL_ON},
|
||||
{ UCOL_LOWER_FIRST, UCOL_OFF},
|
||||
{ UCOL_UPPER_FIRST, UCOL_OFF},
|
||||
{ UCOL_LOWER_FIRST, UCOL_ON},
|
||||
{ UCOL_UPPER_FIRST, UCOL_ON}
|
||||
|
||||
};
|
||||
@ -92,7 +95,7 @@ static void TestCase( )
|
||||
myCollation = ucol_open("en_US", &status);
|
||||
if(U_FAILURE(status)){
|
||||
log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
|
||||
return;
|
||||
return;
|
||||
}
|
||||
log_verbose("Testing different case settings\n");
|
||||
ucol_setStrength(myCollation, UCOL_TERTIARY);
|
||||
@ -111,7 +114,7 @@ static void TestCase( )
|
||||
myCollation = ucol_openRules(gRules, u_strlen(gRules), UNORM_NONE, UCOL_TERTIARY, &status);
|
||||
if(U_FAILURE(status)){
|
||||
log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
|
||||
return;
|
||||
return;
|
||||
}
|
||||
log_verbose("Testing different case settings with custom rules\n");
|
||||
ucol_setStrength(myCollation, UCOL_TERTIARY);
|
||||
@ -424,7 +427,7 @@ static void FunkyATest( )
|
||||
myCollation = ucol_open("en_US", &status);
|
||||
if(U_FAILURE(status)){
|
||||
log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
|
||||
return;
|
||||
return;
|
||||
}
|
||||
log_verbose("Testing some A letters, for some reason\n");
|
||||
ucol_setAttribute(myCollation, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
#define MAX_TOKEN_LEN 128
|
||||
#define MAX_TOKEN_LEN 16
|
||||
|
||||
|
||||
/*perform test with strength PRIMARY */
|
||||
@ -33,6 +33,4 @@ static void TestPrimary(void);
|
||||
static void TestTertiary(void);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -24,20 +24,17 @@
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
#define MAX_TOKEN_LEN 128
|
||||
#define MAX_TOKEN_LEN 16
|
||||
|
||||
/* performs test with strength PRIMARY */
|
||||
static void TestPrimary(void);
|
||||
|
||||
/* perform test with strength SECONDARY */
|
||||
static void TestSecondary(void);
|
||||
static void TestSecondary(void);
|
||||
|
||||
/* perform test with strength TERTIARY */
|
||||
static void TestTertiary(void);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user