~ubuntu-branches/ubuntu/gutsy/icu/gutsy

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2005-05-21 22:44:31 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: package-import@ubuntu.com-20050521224431-r7rktfhnu1n4tf1g
Tags: 2.1-2.1
Rename icu-doc to icu21-doc. icu-doc is built by the icu28 package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/********************************************************************
2
2
 * COPYRIGHT: 
3
 
 * Copyright (c) 1997-2001, International Business Machines Corporation and
 
3
 * Copyright (c) 1997-2002, International Business Machines Corporation and
4
4
 * others. All Rights Reserved.
5
5
 ********************************************************************/
6
6
 
8
8
#include <time.h>
9
9
#include <string.h>
10
10
 
11
 
#define RESTEST_HEAP_CHECK 0
12
 
 
13
11
#include "unicode/utypes.h"
14
12
 
15
 
#if defined(_WIN32) && !defined(__WINDOWS__)
16
 
#define _CRTDBG_MAP_ALLOC
17
 
#include <crtdbg.h>
18
 
#endif
19
 
 
20
13
#include "cstring.h"
21
14
#include "unicode/unistr.h"
22
15
#include "unicode/resbund.h"
204
197
void
205
198
NewResourceBundleTest::TestResourceBundles()
206
199
{
207
 
#if defined(_WIN32) && !defined(__WINDOWS__)
208
 
#if defined(_DEBUG) && RESTEST_HEAP_CHECK
209
 
    /*
210
 
     * Set the debug-heap flag to keep freed blocks in the
211
 
     * heap's linked list - This will allow us to catch any
212
 
     * inadvertent use of freed memory
213
 
     */
214
 
    int tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
215
 
    tmpDbgFlag |= _CRTDBG_DELAY_FREE_MEM_DF;
216
 
    tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
217
 
    tmpDbgFlag |= _CRTDBG_CHECK_ALWAYS_DF;
218
 
    _CrtSetDbgFlag(tmpDbgFlag);
219
 
 
220
 
    _CrtMemState memstate;
221
 
    _CrtMemCheckpoint(&memstate);
222
 
    {
223
 
#endif
224
 
#endif
225
 
 
226
200
    testTag("only_in_Root", TRUE, FALSE, FALSE);
227
201
    testTag("only_in_te", FALSE, TRUE, FALSE);
228
202
    testTag("only_in_te_IN", FALSE, FALSE, TRUE);
231
205
    testTag("in_Root_te_IN", TRUE, FALSE, TRUE);
232
206
    testTag("in_te_te_IN", FALSE, TRUE, TRUE);
233
207
    testTag("nonexistent", FALSE, FALSE, FALSE);
234
 
    OUT << "Passed: " << pass << "\nFailed: " << fail << endl;
235
 
 
236
 
#if defined(_WIN32) && !defined(__WINDOWS__)
237
 
#if defined(_DEBUG) && RESTEST_HEAP_CHECK
238
 
    }
239
 
    _CrtMemDumpAllObjectsSince(&memstate);
240
 
 
241
 
    /*
242
 
     * Set the debug-heap flag to keep freed blocks in the
243
 
     * heap's linked list - This will allow us to catch any
244
 
     * inadvertent use of freed memory
245
 
     */
246
 
    tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
247
 
    tmpDbgFlag |= _CRTDBG_DELAY_FREE_MEM_DF;
248
 
    tmpDbgFlag &= ~_CRTDBG_LEAK_CHECK_DF;
249
 
    tmpDbgFlag &= ~_CRTDBG_CHECK_ALWAYS_DF;
250
 
    _CrtSetDbgFlag(tmpDbgFlag);
251
 
#endif
252
 
#endif
 
208
    logln("Passed: %d\nFailed: %d", pass, fail);
253
209
}
254
210
 
255
211
void