test: Add assert mock to avoid death tests (#1947)

Fixes #1750
This commit is contained in:
Sergey Kuznetsov
2025-03-07 18:11:52 +00:00
committed by GitHub
parent 8a08c5e6ce
commit c57fe1e6e4
30 changed files with 411 additions and 295 deletions

View File

@@ -17,6 +17,7 @@
*/
//==============================================================================
#include "util/MockAssert.hpp"
#include "util/newconfig/Array.hpp"
#include "util/newconfig/ConfigConstraints.hpp"
#include "util/newconfig/ConfigValue.hpp"
@@ -38,9 +39,11 @@ TEST(ArrayTest, prefix)
EXPECT_EQ(Array::prefix("foo.bar.[].baz"), "foo.bar.[]");
}
TEST(ArrayDeathTest, prefix)
struct ArrayAssertTest : common::util::WithMockAssert {};
TEST_F(ArrayAssertTest, prefix)
{
EXPECT_DEATH(Array::prefix("foo.bar"), ".*");
EXPECT_CLIO_ASSERT_FAIL(Array::prefix("foo.bar"));
}
TEST(ArrayTest, addSingleValue)