Chebyshev
Unit testing for scientific software
Loading...
Searching...
No Matches
fail.h
Go to the documentation of this file.
1
5
6#ifndef CHEBYSHEV_FAIL_H
7#define CHEBYSHEV_FAIL_H
8
9#include "./prec_structures.h"
10
11
12namespace chebyshev {
13namespace prec {
14
21 namespace fail {
22
23
25 inline auto passthrough() {
26 return [](const estimate_result& r) -> bool {
27 return false;
28 };
29 }
30
31
34 inline auto fail_on_max_err() {
35 return [](const estimate_result& r) -> bool {
36 return (r.maxErr > r.tolerance) || (r.maxErr != r.maxErr);
37 };
38 }
39
40
43 inline auto fail_on_mean_err() {
44 return [](const estimate_result& r) -> bool {
45 return (r.meanErr > r.tolerance) || (r.meanErr != r.meanErr);
46 };
47 }
48
49
52 inline auto fail_on_rms_err() {
53 return [](const estimate_result& r) -> bool {
54 return (r.rmsErr > r.tolerance) || (r.rmsErr != r.rmsErr);
55 };
56 }
57
58
61 inline auto fail_on_rel_err() {
62 return [](const estimate_result& r) -> bool {
63 return (r.relErr > r.tolerance) || (r.relErr != r.relErr);
64 };
65 }
66
67 }
68}}
69
70
71#endif
auto fail_on_mean_err()
Marks the test as failed if the mean error on the domain is bigger than the tolerance or the error is...
Definition fail.h:43
auto passthrough()
Passthrough fail function which marks all tests as passed (not failed).
Definition fail.h:25
auto fail_on_rel_err()
Marks the test as failed if the relative error on the domain is bigger than the tolerance or the erro...
Definition fail.h:61
auto fail_on_max_err()
Default fail function which marks the test as failed if the maximum error on the domain is bigger tha...
Definition fail.h:34
auto fail_on_rms_err()
Marks the test as failed if the RMS error on the domain is bigger than the tolerance or the error is ...
Definition fail.h:52
General namespace of the framework.
Definition benchmark.h:22
constexpr FloatType get_nan()
Get a quiet NaN of the specified floating point type.
Definition common.h:65
Structures for precision testing.
A structure holding the result of precision estimation.
Definition prec_structures.h:25