OLD | NEW |
1 /* | 1 /* |
2 ******************************************************************************* | 2 ******************************************************************************* |
3 * | 3 * |
4 * Copyright (C) 2003-2012, International Business Machines | 4 * Copyright (C) 2003-2014, International Business Machines |
5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
6 * | 6 * |
7 ******************************************************************************* | 7 ******************************************************************************* |
8 * file name: testidna.cpp | 8 * file name: testidna.cpp |
9 * encoding: US-ASCII | 9 * encoding: US-ASCII |
10 * tab size: 8 (not used) | 10 * tab size: 8 (not used) |
11 * indentation:4 | 11 * indentation:4 |
12 * | 12 * |
13 * created on: 2003feb1 | 13 * created on: 2003feb1 |
14 * created by: Ram Viswanadha | 14 * created by: Ram Viswanadha |
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1305 "uidna_IDNToUnicode",uidna_IDNToUnicode | 1305 "uidna_IDNToUnicode",uidna_IDNToUnicode |
1306 ); | 1306 ); |
1307 } | 1307 } |
1308 void TestIDNA::TestChaining(){ | 1308 void TestIDNA::TestChaining(){ |
1309 testChaining("uidna_toASCII",uidna_toASCII, "uidna_toUnicode", uidna_toUnico
de); | 1309 testChaining("uidna_toASCII",uidna_toASCII, "uidna_toUnicode", uidna_toUnico
de); |
1310 } | 1310 } |
1311 | 1311 |
1312 | 1312 |
1313 static const int loopCount = 100; | 1313 static const int loopCount = 100; |
1314 static const int maxCharCount = 20; | 1314 static const int maxCharCount = 20; |
1315 static const int maxCodePoint = 0x10ffff; | 1315 |
1316 static uint32_t | 1316 static uint32_t |
1317 randul() | 1317 randul() |
1318 { | 1318 { |
1319 static UBool initialized = FALSE; | 1319 static UBool initialized = FALSE; |
1320 if (!initialized) | 1320 if (!initialized) |
1321 { | 1321 { |
1322 srand((unsigned)time(NULL)); | 1322 srand((unsigned)time(NULL)); |
1323 initialized = TRUE; | 1323 initialized = TRUE; |
1324 } | 1324 } |
1325 // Assume rand has at least 12 bits of precision | 1325 // Assume rand has at least 12 bits of precision |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1600 TestIDNA::gPrep = NamePrepTransform::createInstance(parseError, status); | 1600 TestIDNA::gPrep = NamePrepTransform::createInstance(parseError, status); |
1601 if(TestIDNA::gPrep ==NULL){ | 1601 if(TestIDNA::gPrep ==NULL){ |
1602 //status = U_MEMORY_ALLOCATION_ERROR; | 1602 //status = U_MEMORY_ALLOCATION_ERROR; |
1603 return NULL; | 1603 return NULL; |
1604 } | 1604 } |
1605 } | 1605 } |
1606 return TestIDNA::gPrep; | 1606 return TestIDNA::gPrep; |
1607 | 1607 |
1608 } | 1608 } |
1609 #endif /* #if !UCONFIG_NO_IDNA */ | 1609 #endif /* #if !UCONFIG_NO_IDNA */ |
OLD | NEW |