Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed Sep 11, 2024
1 parent d51f01b commit aa7d659
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions runtime/test/zserio/VariantTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ struct ThrowingMove

struct ThrowingBig
{
explicit ThrowingBig(int)
: big()
explicit ThrowingBig(int) :
big()
{
throw std::runtime_error("dang");
}
Expand Down Expand Up @@ -305,8 +305,12 @@ TYPED_TEST(VariantTest, exception)
Var2 var2;
ASSERT_THROW(var2.template emplace<0>(ThrowingMove()), std::runtime_error);
ASSERT_EQ(var2.valueless_by_exception(), true);
ASSERT_THROW(var2.visit([](auto&&){}), zserio::BadVariantAccess);
ASSERT_THROW(std::as_const(var2).visit([](const auto&){}), zserio::BadVariantAccess);
ASSERT_THROW(var2.visit([](auto&&) {
}),
zserio::BadVariantAccess);
ASSERT_THROW(std::as_const(var2).visit([](const auto&) {
}),
zserio::BadVariantAccess);

zserio::Variant<size_t, int, ThrowingBig> var3;
ASSERT_THROW(var3.template emplace<1>(11), std::runtime_error);
Expand Down

0 comments on commit aa7d659

Please sign in to comment.