Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
cetlib
cetlib
test
exception_category_matcher_t.cc
Go to the documentation of this file.
1
#include <catch2/catch.hpp>
2
3
#include "
cetlib/exception_category_matcher.h
"
4
5
using
cet::exception_category_matcher
;
6
7
TEST_CASE
(
"Category matcher"
)
8
{
9
exception_category_matcher
matcher(
"junk"
);
10
SECTION(
"Exception category matches"
)
11
{
12
cet::exception
e
(
"junk"
);
13
SECTION(
"Thrown"
)
14
{
15
CHECK_THROWS_MATCHES(
throw
e,
cet::exception
, matcher);
16
}
17
SECTION(
"Not Thrown"
) { CHECK_THAT(e, matcher); }
18
}
19
SECTION(
"Exception category does not match"
)
20
{
21
cet::exception
e
(
"junky"
);
22
SECTION(
"Thrown"
)
23
{
24
CHECK_THROWS_MATCHES(
throw
e,
cet::exception
, !matcher);
25
}
26
SECTION(
"Not Thrown"
) { CHECK_THAT(e, !matcher); }
27
}
28
}
exception_category_matcher.h
e
const double e
Definition:
gUpMuFluxGen.cxx:165
cet::exception_category_matcher
Definition:
exception_category_matcher.h:24
TEST_CASE
TEST_CASE("Category matcher")
Definition:
exception_category_matcher_t.cc:7
fhicl::exception
cet::coded_exception< error, detail::translate > exception
Definition:
exception.h:33
Generated by
1.8.11