Skip to content

Commit

Permalink
add stacked exception test
Browse files Browse the repository at this point in the history
  • Loading branch information
igagis committed Jul 6, 2024
1 parent 8f410a3 commit 677e777
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/failed/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include "../harness/testees.hpp"

#include <utki/exception.hpp>

// NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)

namespace{
Expand Down Expand Up @@ -107,6 +109,25 @@ void application::init(){
}
}
);

suite.add(
"test_which_throws_stacked_exception",
[](){
try{
try{
try{
throw std::logic_error("some logic error");
}catch(...){
utki::throw_with_nested(std::runtime_error("some runtime error"));
}
}catch(...){
utki::throw_with_nested(std::exception());
}
}catch(...){
utki::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 677e777

Please sign in to comment.