QuickCheck++  0.0.3
Automated testing library
quickcheck.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009 Cyril Soldani
3  *
4  * This file is part of QuickCheck++.
5  *
6  * QuickCheck++ is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the Free
8  * Software Foundation, either version 3 of the License, or (at your option)
9  * any later version.
10  *
11  * QuickCheck++ is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * QuickCheck++. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
751 #ifndef QUICKCHECK_QUICKCHECK_H
752 #define QUICKCHECK_QUICKCHECK_H
753 
754 #include <iostream>
755 
756 #include "ostream.hh"
757 #include "Property.hh"
758 
765 namespace quickcheck {
766 
782 template<class Prop>
783 bool check(const char *msg, size_t n = 100, size_t max = 0,
784  bool isVerbose = false, std::ostream& out = std::cout)
785 {
786  std::cout << "* Checking that " << msg << "..." << std::endl;
787  Prop theProperty;
788  bool status = theProperty.check(n, max, isVerbose, out);
789  std::cout << std::endl;
790  return status;
791 }
792 
793 }
794 
795 #endif // !QUICKCHECK_QUICKCHECK_H