Functions
exception_category_matcher_t.cc File Reference
#include <catch2/catch.hpp>
#include "cetlib/exception_category_matcher.h"

Go to the source code of this file.

Functions

 TEST_CASE ("Category matcher")
 

Function Documentation

TEST_CASE ( "Category matcher"  )

Definition at line 7 of file exception_category_matcher_t.cc.

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 }
const double e
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33