source: icXML/icXML-devel/tests/src/UtilTests/CoreTests_RefStack.cpp @ 2726

Last change on this file since 2726 was 2726, checked in by cameron, 7 years ago

Add original Xerces tests and samples directories

File size: 3.0 KB
Line 
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id: CoreTests_RefStack.cpp 470088 2006-11-01 20:35:12Z amassari $
20 */
21
22// ---------------------------------------------------------------------------
23//  XML4C2 includes
24// ---------------------------------------------------------------------------
25#include "CoreTests.hpp"
26#include <xercesc/util/RefStackOf.hpp>
27
28
29// ---------------------------------------------------------------------------
30//  Force a full instantiation of our stack and its enumerator, just to
31//  insure that all methods get instantiated and compiled.
32// ---------------------------------------------------------------------------
33template RefStackOf<int>;
34template RefStackEnumerator<int>;
35
36
37
38// ---------------------------------------------------------------------------
39//  Test entry point
40// ---------------------------------------------------------------------------
41static bool basicTests()
42{
43    RefStackOf<double> testStack(500);
44
45    return true;
46}
47
48
49// ---------------------------------------------------------------------------
50//  Test entry point
51// ---------------------------------------------------------------------------
52bool testRefStack()
53{
54    XERCES_STD_QUALIFIER wcout  << L"----------------------------------\n"
55                << L"Testing RefStackOf template class\n"
56                << L"----------------------------------" << XERCES_STD_QUALIFIER endl;
57
58    bool retVal = true;
59
60    try
61    {
62        // Call other local methods to do specific tests
63        XERCES_STD_QUALIFIER wcout << L"Testing RefStackOf basics" << XERCES_STD_QUALIFIER endl;
64        if (!basicTests())
65        {
66            XERCES_STD_QUALIFIER wcout << L"RefStackOf basic tests failed" << XERCES_STD_QUALIFIER endl;
67            retVal = false;
68        }
69         else
70        {
71            XERCES_STD_QUALIFIER wcout  << L"RefArrayOf constructor tests passed"
72                        << XERCES_STD_QUALIFIER endl;
73        }
74        XERCES_STD_QUALIFIER wcout << XERCES_STD_QUALIFIER endl;
75    }
76
77    catch(const XMLException& toCatch)
78    {
79        XERCES_STD_QUALIFIER wcout  << L"  ERROR: Unexpected exception!\n   Msg: "
80                    << toCatch.getMessage() << XERCES_STD_QUALIFIER endl;
81        return false;
82    }
83
84    return retVal;
85}
Note: See TracBrowser for help on using the repository browser.