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