xtd 0.2.0
Loading...
Searching...
No Matches

◆ throws_any() [2/4]

static void xtd::tunit::valid::throws_any ( const std::function< void()> &  statement,
const xtd::diagnostics::stack_frame stack_frame 
)
static

Validates that the statement does not throw an exception.

Parameters
statementThe statement that verify.
stack_frameContains information about current file and current line.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
xtd::tunit::valid::throws_any([&] {v1.at(5);}, csf_); // test ok.
xtd::tunit::valid::throws_any([&] {v1.at(2);}, csf_); // test fails.
static void throws_any(const std::function< void()> &statement)
Validates that the statement does not throw an exception.
#define csf_
Provides information about the current stack frame.
Definition current_stack_frame.h:30