stdex
Additional custom or not Standard C++ covered algorithms
Loading...
Searching...
No Matches
mac
UnitTests
common.hpp
1
#pragma once
2
3
#include <stdexcept>
4
5
template
<
class
T>
6
void
are_equal(
const
T& a,
const
T& b)
7
{
8
if
(!(a == b))
9
throw
std::runtime_error(
"values are not equal"
);
10
}
11
12
template
<
class
E,
typename
F>
13
void
expect_exception(F functor)
14
{
15
try
{ functor(); }
16
catch
(
const
E&) {
return
; }
17
throw
std::runtime_error(
"exception expected"
);
18
}
Generated on Mon Sep 11 2023 15:42:32 for stdex by
1.9.8