ICU-5426 Reduce VM size and reduce exported data on Unix machines.

X-SVN-Rev: 20466
This commit is contained in:
George Rhoten 2006-10-01 06:45:25 +00:00
parent b0d276726b
commit a866e44617
14 changed files with 54 additions and 67 deletions

View File

@ -777,7 +777,7 @@ DateFormatTest::TestBadInput135()
errln((UnicodeString)"FAIL: UErrorCode received during test: " + (int32_t)status);
}
const char* DateFormatTest::parseFormats[] = {
static const char* const parseFormats[] = {
"MMMM d, yyyy",
"MMMM d yyyy",
"M/d/yy",
@ -789,7 +789,7 @@ const char* DateFormatTest::parseFormats[] = {
"h:mm a MMMM d, yyyy"
};
const char* DateFormatTest::inputStrings[] = {
static const char* const inputStrings[] = {
"bogus string", 0, 0, 0, 0, 0, 0, 0, 0, 0,
"April 1, 1997", "April 1, 1997", 0, 0, 0, 0, 0, "April 1", 0, 0,
"Jan 1, 1970", "January 1, 1970", 0, 0, 0, 0, 0, "January 1", 0, 0,

View File

@ -109,10 +109,6 @@ public:
*/
virtual void TestBadInput135(void);
private:
static const char* parseFormats[];
static const char* inputStrings[];
public:
/**
* Verify the correct behavior when parsing an array of inputs against an

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2003, International Business Machines Corporation and
* Copyright (c) 1997-2006, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@ -26,7 +26,7 @@ CollationEnglishTest::~CollationEnglishTest()
delete myCollation;
}
const UChar CollationEnglishTest::testSourceCases[][CollationEnglishTest::MAX_TOKEN_LEN] = {
static const UChar testSourceCases[][CollationEnglishTest::MAX_TOKEN_LEN] = {
{(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, 0},
{(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x002D /* '-' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, 0},
{(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x0020 /* ' ' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, 0},
@ -78,7 +78,7 @@ const UChar CollationEnglishTest::testSourceCases[][CollationEnglishTest::MAX_TO
{(UChar)0x0070 /* 'p' */, 0x00E9, (UChar)0x0063 /* 'c' */, (UChar)0x0068 /* 'h' */, 0x00E9, 0} // 49
};
const UChar CollationEnglishTest::testTargetCases[][CollationEnglishTest::MAX_TOKEN_LEN] = {
static const UChar testTargetCases[][CollationEnglishTest::MAX_TOKEN_LEN] = {
{(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
{(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, 0},
{(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x002D /* '-' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, 0},
@ -130,7 +130,7 @@ const UChar CollationEnglishTest::testTargetCases[][CollationEnglishTest::MAX_TO
{(UChar)0x0070 /* 'p' */, 0x00EA, (UChar)0x0063 /* 'c' */, (UChar)0x0068 /* 'h' */, (UChar)0x0065 /* 'e' */, 0} // 49
};
const Collator::EComparisonResult CollationEnglishTest::results[] = {
static const Collator::EComparisonResult results[] = {
Collator::LESS,
Collator::LESS, /*Collator::GREATER,*/
Collator::LESS,
@ -186,7 +186,7 @@ const Collator::EComparisonResult CollationEnglishTest::results[] = {
Collator::LESS // 49
};
const UChar CollationEnglishTest::testBugs[][CollationEnglishTest::MAX_TOKEN_LEN] = {
static const UChar testBugs[][CollationEnglishTest::MAX_TOKEN_LEN] = {
{0x61, 0},
{0x41, 0},
{0x65, 0},
@ -201,7 +201,7 @@ const UChar CollationEnglishTest::testBugs[][CollationEnglishTest::MAX_TOKEN_LEN
// 0x0300 is grave, 0x0301 is acute
// the order of elements in this array must be different than the order in CollationFrenchTest
const UChar CollationEnglishTest::testAcute[][CollationEnglishTest::MAX_TOKEN_LEN] = {
static const UChar testAcute[][CollationEnglishTest::MAX_TOKEN_LEN] = {
{0x65, 0x65, 0},
{0x65, 0x65, 0x0301, 0},
{0x65, 0x65, 0x0301, 0x0300, 0},

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2003, International Business Machines Corporation and
* Copyright (c) 1997-2006, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@ -40,12 +40,6 @@ public:
void TestTertiary(/* char* par */);
private:
static const UChar testBugs[][MAX_TOKEN_LEN];
static const UChar testSourceCases[][MAX_TOKEN_LEN];
static const UChar testTargetCases[][MAX_TOKEN_LEN];
static const Collator::EComparisonResult results[];
static const UChar testAcute[][MAX_TOKEN_LEN];
Collator *myCollation;
};

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2003, International Business Machines Corporation and
* Copyright (c) 1997-2006, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@ -16,7 +16,7 @@
#include "sfwdchit.h"
const UChar G7CollationTest::testCases[][G7CollationTest::MAX_TOKEN_LEN] = {
static const UChar testCases[][G7CollationTest::MAX_TOKEN_LEN] = {
{ 0x0062 /*'b'*/, 0x006c /*'l'*/, 0x0061 /*'a'*/, 0x0062 /*'c'*/, 0x006b /*'k'*/,
0x0062 /*'b'*/, 0x0069 /*'i'*/, 0x0072 /*'r'*/, 0x0064 /*'d'*/, 0x0073 /*'s'*/, 0x0000}, /* 9 */
{ 0x0050 /*'P'*/, 0x0061 /*'a'*/, 0x0074/*'t'*/, 0x0000}, /* 1 */
@ -56,7 +56,7 @@ const UChar G7CollationTest::testCases[][G7CollationTest::MAX_TOKEN_LEN] = {
{ 0x007a /*'z'*/, 0x0065 /*'e'*/, 0x0062 /*'b'*/, 0x0072 /*'r'*/, 0x0061 /*'a'*/, 0x0000} /* 29 */
};
const int32_t G7CollationTest::results[G7CollationTest::TESTLOCALES][G7CollationTest::TOTALTESTSET] = {
static const int32_t results[G7CollationTest::TESTLOCALES][G7CollationTest::TOTALTESTSET] = {
{ 12, 13, 9, 0, 14, 1, 11, 2, 3, 4, 5, 6, 8, 10, 7, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 }, /* en_US */
{ 12, 13, 9, 0, 14, 1, 11, 2, 3, 4, 5, 6, 8, 10, 7, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 }, /* en_GB */
{ 12, 13, 9, 0, 14, 1, 11, 2, 3, 4, 5, 6, 8, 10, 7, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 }, /* en_CA */

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2003, International Business Machines Corporation and
* Copyright (c) 1997-2006, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@ -70,9 +70,6 @@ public:
// " & aa ; a'-' & ee ; e'-' & ii ; i'-' & oo ; o'-' & uu ; u'-' "
void TestDemo4(/* char* par */);
private:
static const UChar testCases[][MAX_TOKEN_LEN];
static const int32_t results[TESTLOCALES][TOTALTESTSET];
};
#endif /* #if !UCONFIG_NO_COLLATION */

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2005, International Business Machines Corporation and *
* Copyright (C) 1996-2006, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -377,7 +377,7 @@ void IntlTestRBNF::TestFractionalRuleSet()
if (U_FAILURE(status)) {
errln("FAIL: could not construct formatter");
} else {
static const char* testData[][2] = {
static const char* const testData[][2] = {
{ "0", "0" },
{ ".1", "1/10" },
{ ".11", "1/9" },
@ -1046,7 +1046,7 @@ IntlTestRBNF::TestEnglishSpellout()
if (U_FAILURE(status)) {
errln("FAIL: could not construct formatter");
} else {
static const char* testData[][2] = {
static const char* const testData[][2] = {
{ "1", "one" },
{ "2", "two" },
{ "15", "fifteen" },
@ -1099,7 +1099,7 @@ IntlTestRBNF::TestOrdinalAbbreviations()
if (U_FAILURE(status)) {
errln("FAIL: could not construct formatter");
} else {
static const char* testData[][2] = {
static const char* const testData[][2] = {
{ "1", "1st" },
{ "2", "2nd" },
{ "3", "3rd" },
@ -1135,7 +1135,7 @@ IntlTestRBNF::TestDurations()
if (U_FAILURE(status)) {
errln("FAIL: could not construct formatter");
} else {
static const char* testData[][2] = {
static const char* const testData[][2] = {
{ "3,600", "1:00:00" }, //move me and I fail
{ "0", "0 sec." },
{ "1", "1 sec." },
@ -1174,7 +1174,7 @@ IntlTestRBNF::TestSpanishSpellout()
if (U_FAILURE(status)) {
errln("FAIL: could not construct formatter");
} else {
static const char* testData[][2] = {
static const char* const testData[][2] = {
{ "1", "uno" },
{ "6", "seis" },
{ "16", "diecis\\u00e9is" },
@ -1214,7 +1214,7 @@ IntlTestRBNF::TestFrenchSpellout()
if (U_FAILURE(status)) {
errln("FAIL: could not construct formatter");
} else {
static const char* testData[][2] = {
static const char* const testData[][2] = {
{ "1", "un" },
{ "15", "quinze" },
{ "20", "vingt" },
@ -1259,7 +1259,7 @@ IntlTestRBNF::TestFrenchSpellout()
delete formatter;
}
static const char* swissFrenchTestData[][2] = {
static const char* const swissFrenchTestData[][2] = {
{ "1", "un" },
{ "15", "quinze" },
{ "20", "vingt" },
@ -1331,7 +1331,7 @@ IntlTestRBNF::TestItalianSpellout()
if (U_FAILURE(status)) {
errln("FAIL: could not construct formatter");
} else {
static const char* testData[][2] = {
static const char* const testData[][2] = {
{ "1", "uno" },
{ "15", "quindici" },
{ "20", "venti" },
@ -1370,7 +1370,7 @@ IntlTestRBNF::TestGermanSpellout()
if (U_FAILURE(status)) {
errln("FAIL: could not construct formatter");
} else {
static const char* testData[][2] = {
static const char* const testData[][2] = {
{ "1", "eins" },
{ "15", "f\\u00fcnfzehn" },
{ "20", "zwanzig" },
@ -1415,7 +1415,7 @@ IntlTestRBNF::TestThaiSpellout()
if (U_FAILURE(status)) {
errln("FAIL: could not construct formatter");
} else {
static const char* testData[][2] = {
static const char* const testData[][2] = {
{ "0", "\\u0e28\\u0e39\\u0e19\\u0e22\\u0e4c" },
{ "1", "\\u0e2b\\u0e19\\u0e36\\u0e48\\u0e07" },
{ "10", "\\u0e2a\\u0e34\\u0e1a" },
@ -1518,7 +1518,7 @@ IntlTestRBNF::TestSmallValues()
if (U_FAILURE(status)) {
errln("FAIL: could not construct formatter");
} else {
static const char* testDataDefault[][2] = {
static const char* const testDataDefault[][2] = {
{ "0.001", "zero point zero zero one" },
{ "0.0001", "zero point zero zero zero one" },
{ "0.00001", "zero point zero zero zero zero one" },
@ -1550,12 +1550,12 @@ IntlTestRBNF::TestSmallValues()
{ "123.321", "one hundred and twenty-three point three two one" },
{ "0.0000000011754944", "zero point zero zero zero zero zero zero zero zero one one seven five four nine four four" },
{ "0.000001175494351", "zero point zero zero zero zero zero one one seven five four nine four three five one" },
{ NULL, NULL }
};
{ NULL, NULL }
};
doTest(formatter, testDataDefault, TRUE);
delete formatter;
delete formatter;
}
}
@ -1573,7 +1573,7 @@ IntlTestRBNF::TestLocalizations(void)
errln("FAIL: could not construct formatter");
} else {
{
static const char* testData[][2] = {
static const char* const testData[][2] = {
{ "0", "nada" },
{ "5", "yah, some" },
{ "423", "plenty" },
@ -1585,7 +1585,7 @@ IntlTestRBNF::TestLocalizations(void)
{
UnicodeString loc("<<%main, %other>,<en, Main, Other>,<fr, leMain, leOther>,<de, 'das Main', 'etwas anderes'>>");
static const char* testData[][2] = {
static const char* const testData[][2] = {
{ "0", "no" },
{ "5", "some" },
{ "423", "a lot" },
@ -1728,7 +1728,7 @@ IntlTestRBNF::TestAllLocales()
}
void
IntlTestRBNF::doTest(RuleBasedNumberFormat* formatter, const char* testData[][2], UBool testParsing)
IntlTestRBNF::doTest(RuleBasedNumberFormat* formatter, const char* const testData[][2], UBool testParsing)
{
// man, error reporting would be easier with printf-style syntax for unicode string and formattable

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2005, International Business Machines Corporation and *
* Copyright (C) 1996-2006, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -118,7 +118,7 @@ class IntlTestRBNF : public IntlTest {
virtual void TestHebrewFraction();
protected:
virtual void doTest(RuleBasedNumberFormat* formatter, const char* testData[][2], UBool testParsing);
virtual void doTest(RuleBasedNumberFormat* formatter, const char* const testData[][2], UBool testParsing);
virtual void doLenientParseTest(RuleBasedNumberFormat* formatter, const char* testData[][2]);
/* U_HAVE_RBNF */

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2003, International Business Machines Corporation and
* Copyright (c) 1997-2006, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************
************************************************************************
@ -215,7 +215,7 @@ void JamoTest::TestPiecemeal(void) {
void
JamoTest::TestRealText() {
// Test text taken from the Unicode web site
static const char* WHAT_IS_UNICODE[] = {
static const char* const WHAT_IS_UNICODE[] = {
"\\uc720\\ub2c8\\ucf54\\ub4dc\\uc5d0", "\\ub300\\ud574", "?",
"\\uc5b4\\ub5a4", "\\ud50c\\ub7ab\\ud3fc,", "\\uc5b4\\ub5a4",

View File

@ -14,7 +14,7 @@
#include "cstring.h"
#include <stdio.h>
const char* rawData[33][8] = {
static const char* const rawData[33][8] = {
// language code
{ "en", "fr", "ca", "el", "no", "it", "xx", "zh" },
@ -1538,7 +1538,7 @@ LocaleTest::TestSetIsBogus() {
void
LocaleTest::TestKeywordVariants(void) {
struct {
static const struct {
const char *localeID;
const char *expectedLocaleID;
//const char *expectedLocaleIDNoKeywords;
@ -1645,7 +1645,7 @@ LocaleTest::TestKeywordVariants(void) {
void
LocaleTest::TestKeywordVariantParsing(void) {
struct {
static const struct {
const char *localeID;
const char *keyword;
const char *expectedValue;
@ -1675,7 +1675,7 @@ LocaleTest::TestKeywordVariantParsing(void) {
void
LocaleTest::TestGetBaseName(void) {
struct {
static const struct {
const char *localeID;
const char *baseName;
} testCases[] = {
@ -2017,7 +2017,7 @@ static Locale _canonicalize(int32_t selector, /* 0==createFromName, 1==createCan
void LocaleTest::TestCanonicalization(void)
{
static struct {
static const struct {
const char *localeID; /* input */
const char *getNameID; /* expected getName() result */
const char *canonicalID; /* expected canonicalize() result */

View File

@ -31,7 +31,7 @@
#include "unicode/putil.h"
#include "idnaconf.h"
static UChar unicodeIn[][41] ={
static const UChar unicodeIn[][41] ={
{
0x0644, 0x064A, 0x0647, 0x0645, 0x0627, 0x0628, 0x062A, 0x0643, 0x0644,
0x0645, 0x0648, 0x0634, 0x0639, 0x0631, 0x0628, 0x064A, 0x061F, 0x0000
@ -233,7 +233,7 @@ static const char *domainNames[] = {
typedef struct ErrorCases ErrorCases;
static struct ErrorCases{
static const struct ErrorCases{
UChar unicode[100];
const char *ascii;
@ -407,7 +407,7 @@ static struct ErrorCases{
};
static struct ConformanceTestCases
static const struct ConformanceTestCases
{
const char *comment;
const char *in;
@ -1177,7 +1177,7 @@ void TestIDNA::testConformance(const char* toASCIIName, TestFunc toASCII,
// test and ascertain
// func(func(func(src))) == func(src)
void TestIDNA::testChaining(UChar* src,int32_t numIterations,const char* testName,
void TestIDNA::testChaining(const UChar* src,int32_t numIterations,const char* testName,
UBool useSTD3ASCIIRules, UBool caseInsensitive, TestFunc func){
UChar even[MAX_DEST_SIZE];
UChar odd[MAX_DEST_SIZE];

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 2003-2004, International Business Machines
* Copyright (C) 2003-2006, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -90,7 +90,7 @@ private:
void testErrorCases(const char* IDNToASCIIName, TestFunc IDNToASCII,
const char* IDNToUnicodeName, TestFunc IDNToUnicode);
void testChaining(UChar* src,int32_t numIterations,const char* testName,
void testChaining(const UChar* src,int32_t numIterations,const char* testName,
UBool useSTD3ASCIIRules, UBool caseInsensitive, TestFunc func);
void testRootLabelSeparator(const char* testName, CompareFunc func,

View File

@ -37,10 +37,10 @@
#define MAX_CLASS_ID 200
UClassID ids[MAX_CLASS_ID];
const char *ids_factory[MAX_CLASS_ID];
const char *ids_class[MAX_CLASS_ID];
uint32_t ids_count = 0;
static UClassID ids[MAX_CLASS_ID];
static const char *ids_factory[MAX_CLASS_ID];
static const char *ids_class[MAX_CLASS_ID];
static uint32_t ids_count = 0;
UObject *UObjectTest::testClass(UObject *obj,
const char *className, const char *factory,

View File

@ -1,12 +1,12 @@
/*
**************************************************************************************
********************************************************************************
* Copyright (C) 1999-2006 International Business Machines Corporation and
* others. All Rights Reserved.
**************************************************************************************
********************************************************************************
* Date Name Description
* 10/20/99 alan Creation.
* 03/22/2000 Madhu Added additional tests
**************************************************************************************
********************************************************************************
*/
#include "unicode/utypes.h"
@ -812,7 +812,7 @@ void UnicodeSetTest::TestScriptSet() {
* Test the [:Latin:] syntax.
*/
void UnicodeSetTest::TestPropertySet() {
static const char* DATA[] = {
static const char* const DATA[] = {
// Pattern, Chars IN, Chars NOT in
"[:Latin:]",