xref: /AOO42X/main/autodoc/source/cosv/unittest/ut.hxx (revision 9bce9b0d387299c68bd81d539e1478357a103de5)
1*8a106958SDamjan Jovanovic /**************************************************************
2*8a106958SDamjan Jovanovic  *
3*8a106958SDamjan Jovanovic  * Licensed to the Apache Software Foundation (ASF) under one
4*8a106958SDamjan Jovanovic  * or more contributor license agreements.  See the NOTICE file
5*8a106958SDamjan Jovanovic  * distributed with this work for additional information
6*8a106958SDamjan Jovanovic  * regarding copyright ownership.  The ASF licenses this file
7*8a106958SDamjan Jovanovic  * to you under the Apache License, Version 2.0 (the
8*8a106958SDamjan Jovanovic  * "License"); you may not use this file except in compliance
9*8a106958SDamjan Jovanovic  * with the License.  You may obtain a copy of the License at
10*8a106958SDamjan Jovanovic  *
11*8a106958SDamjan Jovanovic  *   http://www.apache.org/licenses/LICENSE-2.0
12*8a106958SDamjan Jovanovic  *
13*8a106958SDamjan Jovanovic  * Unless required by applicable law or agreed to in writing,
14*8a106958SDamjan Jovanovic  * software distributed under the License is distributed on an
15*8a106958SDamjan Jovanovic  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*8a106958SDamjan Jovanovic  * KIND, either express or implied.  See the License for the
17*8a106958SDamjan Jovanovic  * specific language governing permissions and limitations
18*8a106958SDamjan Jovanovic  * under the License.
19*8a106958SDamjan Jovanovic  *
20*8a106958SDamjan Jovanovic  *************************************************************/
21*8a106958SDamjan Jovanovic 
22*8a106958SDamjan Jovanovic 
23*8a106958SDamjan Jovanovic 
24*8a106958SDamjan Jovanovic #ifndef COSV_UNITTEST_UT_HXX
25*8a106958SDamjan Jovanovic #define COSV_UNITTEST_UT_HXX
26*8a106958SDamjan Jovanovic 
27*8a106958SDamjan Jovanovic 
28*8a106958SDamjan Jovanovic #define UT_CHECK( fname, cond ) \
29*8a106958SDamjan Jovanovic     if ( NOT (cond) ) { std::cerr << "ftest_" << #fname << " " << #cond << endl; \
30*8a106958SDamjan Jovanovic         ret = false; }
31*8a106958SDamjan Jovanovic 
32*8a106958SDamjan Jovanovic #define CUT_DECL( nsp, cname ) \
33*8a106958SDamjan Jovanovic     bool classtest_##cname()
34*8a106958SDamjan Jovanovic #define FUT_DECL( cname, fname ) \
35*8a106958SDamjan Jovanovic     bool ftest_##fname( cname & r##cname )
36*8a106958SDamjan Jovanovic 
37*8a106958SDamjan Jovanovic #define UT_RESULT( result ) \
38*8a106958SDamjan Jovanovic     if (result ) std::cout << "All unit tests passed successfully." << std::endl; \
39*8a106958SDamjan Jovanovic     else std::cout << "Errors in unit tests.\n" << std::endl
40*8a106958SDamjan Jovanovic 
41*8a106958SDamjan Jovanovic 
42*8a106958SDamjan Jovanovic 
43*8a106958SDamjan Jovanovic CUT_DECL( csv, File );
44*8a106958SDamjan Jovanovic CUT_DECL( csv, String );
45*8a106958SDamjan Jovanovic 
46*8a106958SDamjan Jovanovic #endif
47