Skip to content

Commit

Permalink
add some exception tests
Browse files Browse the repository at this point in the history
  • Loading branch information
igagis committed Jul 2, 2024
1 parent 1541e6d commit 2ffa072
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/failed/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,42 @@ void application::init(){
throw some_unknown_exception();
}
);

suite.add(
"test_which_throws_runtime_error_exception",
[](){
throw std::runtime_error("some runtime error");
}
);

suite.add(
"test_which_throws_logic_error_exception",
[](){
throw std::logic_error("some logic error");
}
);

suite.add(
"test_which_throws_std_exception",
[](){
throw std::exception();
}
);

suite.add(
"test_which_throws_nested_exception",
[](){
try{
try{
throw std::logic_error("some logic error");
}catch(...){
std::throw_with_nested(std::runtime_error("some runtime error"));
}
}catch(...){
std::throw_with_nested(std::invalid_argument("some argument is invalid"));
}
}
);

suite.add(
"test_which_fails_check_eq_with_custom_message",
Expand Down

0 comments on commit 2ffa072

Please sign in to comment.