~ubuntu-branches/ubuntu/precise/icu/precise

« back to all changes in this revision

Viewing changes to source/test/intltest/itutil.cpp

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2011-11-09 09:59:08 UTC
  • mfrom: (10.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20111109095908-x875xobgnnvttamx
Tags: 4.8.1.1-1
* New upstream release
* Add simple patch to define PATH_MAX when not defined.  Not an ideal
  solution, but it will do for now.  (Closes: #643661)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/********************************************************************
2
2
 * COPYRIGHT: 
3
 
 * Copyright (c) 1997-2010, International Business Machines Corporation and
 
3
 * Copyright (c) 1997-2011, International Business Machines Corporation and
4
4
 * others. All Rights Reserved.
5
5
 ********************************************************************/
6
6
 
29
29
#include "aliastst.h"
30
30
#include "usettest.h"
31
31
 
 
32
extern IntlTest *createBytesTrieTest();
32
33
static IntlTest *createLocalPointerTest();
 
34
extern IntlTest *createUCharsTrieTest();
33
35
 
34
36
#define CASE(id, test) case id:                               \
35
37
                          name = #test;                       \
44
46
{
45
47
    if (exec) logln("TestSuite Utilities: ");
46
48
    switch (index) {
47
 
        CASE(0, MultithreadTest); 
48
 
        CASE(1, StringTest); 
49
 
        CASE(2, UnicodeStringTest); 
50
 
        CASE(3, LocaleTest); 
51
 
        CASE(4, CharIterTest); 
52
 
        CASE(5, UnicodeTest); 
53
 
        CASE(6, ResourceBundleTest); 
54
 
        CASE(7, NewResourceBundleTest); 
55
 
        CASE(8, PUtilTest); 
56
 
        CASE(9, UObjectTest); 
57
 
        CASE(10, UVector32Test); 
58
 
        CASE(11, UVectorTest); 
59
 
        CASE(12, UTextTest); 
60
 
        CASE(13, LocaleAliasTest); 
 
49
        CASE(0, MultithreadTest);
 
50
        CASE(1, StringTest);
 
51
        CASE(2, UnicodeStringTest);
 
52
        CASE(3, LocaleTest);
 
53
        CASE(4, CharIterTest);
 
54
        CASE(5, UObjectTest);
 
55
        CASE(6, UnicodeTest);
 
56
        CASE(7, ResourceBundleTest);
 
57
        CASE(8, NewResourceBundleTest);
 
58
        CASE(9, PUtilTest);
 
59
        CASE(10, UVector32Test);
 
60
        CASE(11, UVectorTest);
 
61
        CASE(12, UTextTest);
 
62
        CASE(13, LocaleAliasTest);
61
63
        CASE(14, UnicodeSetTest);
62
64
        CASE(15, ErrorCodeTest);
63
65
        case 16:
68
70
                callTest(*test, par);
69
71
            }
70
72
            break;
 
73
        case 17:
 
74
            name = "BytesTrieTest";
 
75
            if (exec) {
 
76
                logln("TestSuite BytesTrieTest---"); logln();
 
77
                LocalPointer<IntlTest> test(createBytesTrieTest());
 
78
                callTest(*test, par);
 
79
            }
 
80
            break;
 
81
        case 18:
 
82
            name = "UCharsTrieTest";
 
83
            if (exec) {
 
84
                logln("TestSuite UCharsTrieTest---"); logln();
 
85
                LocalPointer<IntlTest> test(createUCharsTrieTest());
 
86
                callTest(*test, par);
 
87
            }
 
88
            break;
71
89
        default: name = ""; break; //needed to end loop
72
90
    }
73
91
}
271
289
#include "unicode/ucnvsel.h"
272
290
#include "unicode/ucal.h"
273
291
#include "unicode/udatpg.h"
 
292
#include "unicode/uidna.h"
274
293
#include "unicode/uldnames.h"
275
294
#include "unicode/umsg.h"
276
295
#include "unicode/unorm2.h"
303
322
    }
304
323
 
305
324
    LocalUDateTimePatternGeneratorPointer patgen(udatpg_open("root", errorCode));
306
 
    if(errorCode.logIfFailureAndReset("udatpg_open()")) {
 
325
    if(errorCode.logDataIfFailureAndReset("udatpg_open()")) {
307
326
        return;
308
327
    }
309
328
    if(patgen.isNull()) {
345
364
    }
346
365
#endif /* !UCONFIG_NO_NORMALIZATION */
347
366
 
 
367
#if !UCONFIG_NO_IDNA
 
368
    LocalUIDNAPointer idna(uidna_openUTS46(0, errorCode));
 
369
    if(errorCode.logIfFailureAndReset("uidna_openUTS46()")) {
 
370
        return;
 
371
    }
 
372
    if(idna.isNull()) {
 
373
        errln("LocalUIDNAPointer failure");
 
374
        return;
 
375
    }
 
376
#endif  /* !UCONFIG_NO_IDNA */
 
377
 
348
378
#if !UCONFIG_NO_REGULAR_EXPRESSIONS
349
379
    UnicodeString pattern=UNICODE_STRING_SIMPLE("abc|xy+z");
350
380
    LocalURegularExpressionPointer regex(