3963 |
06 Aug 20 |
peter |
// $Id$ |
3963 |
06 Aug 20 |
peter |
2 |
|
3963 |
06 Aug 20 |
peter |
3 |
/* |
3963 |
06 Aug 20 |
peter |
Copyright (C) 2020 Peter Johansson |
3963 |
06 Aug 20 |
peter |
5 |
|
3963 |
06 Aug 20 |
peter |
This file is part of the yat library, http://dev.thep.lu.se/yat |
3963 |
06 Aug 20 |
peter |
7 |
|
3963 |
06 Aug 20 |
peter |
The yat library is free software; you can redistribute it and/or |
3963 |
06 Aug 20 |
peter |
modify it under the terms of the GNU General Public License as |
3963 |
06 Aug 20 |
peter |
published by the Free Software Foundation; either version 3 of the |
3963 |
06 Aug 20 |
peter |
License, or (at your option) any later version. |
3963 |
06 Aug 20 |
peter |
12 |
|
3963 |
06 Aug 20 |
peter |
The yat library is distributed in the hope that it will be useful, |
3963 |
06 Aug 20 |
peter |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
3963 |
06 Aug 20 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
3963 |
06 Aug 20 |
peter |
General Public License for more details. |
3963 |
06 Aug 20 |
peter |
17 |
|
3963 |
06 Aug 20 |
peter |
You should have received a copy of the GNU General Public License |
3963 |
06 Aug 20 |
peter |
along with yat. If not, see <http://www.gnu.org/licenses/>. |
3963 |
06 Aug 20 |
peter |
20 |
*/ |
3963 |
06 Aug 20 |
peter |
21 |
|
3963 |
06 Aug 20 |
peter |
22 |
#include <config.h> |
3963 |
06 Aug 20 |
peter |
23 |
|
3963 |
06 Aug 20 |
peter |
24 |
#include "Suite.h" |
3963 |
06 Aug 20 |
peter |
25 |
|
3963 |
06 Aug 20 |
peter |
26 |
#include "yat/utility/Exception.h" |
3963 |
06 Aug 20 |
peter |
27 |
#include "yat/utility/utility.h" |
3963 |
06 Aug 20 |
peter |
28 |
|
3963 |
06 Aug 20 |
peter |
29 |
#include <gsl/gsl_cdf.h> |
3963 |
06 Aug 20 |
peter |
30 |
#include <gsl/gsl_errno.h> |
3963 |
06 Aug 20 |
peter |
31 |
|
3963 |
06 Aug 20 |
peter |
32 |
using namespace theplu::yat; |
3963 |
06 Aug 20 |
peter |
33 |
|
3963 |
06 Aug 20 |
peter |
34 |
int main(int argc,char* argv[]) |
3963 |
06 Aug 20 |
peter |
35 |
{ |
3963 |
06 Aug 20 |
peter |
36 |
test::Suite suite(argc, argv); |
3963 |
06 Aug 20 |
peter |
37 |
gsl_set_error_handler(&utility::gsl_error_handler); |
3963 |
06 Aug 20 |
peter |
38 |
|
3963 |
06 Aug 20 |
peter |
39 |
try { |
3963 |
06 Aug 20 |
peter |
40 |
gsl_cdf_poisson_P(0, 0.0); |
3963 |
06 Aug 20 |
peter |
41 |
suite.err() << "no exception thrown\n"; |
3963 |
06 Aug 20 |
peter |
42 |
suite.add(false); |
3963 |
06 Aug 20 |
peter |
43 |
} |
3963 |
06 Aug 20 |
peter |
44 |
catch (utility::GSL_error& e) { |
3963 |
06 Aug 20 |
peter |
45 |
suite.out() << "expected exception caught: what(): " << e.what() |
3963 |
06 Aug 20 |
peter |
46 |
<< "\n"; |
3963 |
06 Aug 20 |
peter |
47 |
} |
3963 |
06 Aug 20 |
peter |
48 |
catch (std::exception& e) { |
3963 |
06 Aug 20 |
peter |
49 |
suite.err() << "error: unexpected exception thrown: what(): " |
3963 |
06 Aug 20 |
peter |
50 |
<< e.what() << "\n"; |
3963 |
06 Aug 20 |
peter |
51 |
suite.add(false); |
3963 |
06 Aug 20 |
peter |
52 |
} |
3963 |
06 Aug 20 |
peter |
53 |
return suite.return_value(); |
3963 |
06 Aug 20 |
peter |
54 |
} |