mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-20 19:56:00 +00:00
@@ -70,6 +70,13 @@ TEST_F(AnyCounterTests, operatorAdd)
|
||||
counter += 42;
|
||||
}
|
||||
|
||||
TEST_F(AnyCounterTests, set)
|
||||
{
|
||||
EXPECT_CALL(mockCounterImpl, value()).WillOnce(::testing::Return(4));
|
||||
EXPECT_CALL(mockCounterImpl, set(42));
|
||||
counter.set(42);
|
||||
}
|
||||
|
||||
TEST_F(AnyCounterTests, reset)
|
||||
{
|
||||
EXPECT_CALL(mockCounterImpl, set(0));
|
||||
@@ -82,6 +89,20 @@ TEST_F(AnyCounterTests, value)
|
||||
EXPECT_EQ(counter.value(), 42);
|
||||
}
|
||||
|
||||
struct AnyCounterDeathTest : AnyCounterTests {};
|
||||
|
||||
TEST_F(AnyCounterDeathTest, setLowerValue)
|
||||
{
|
||||
testing::Mock::AllowLeak(&mockCounterImpl);
|
||||
EXPECT_DEATH(
|
||||
{
|
||||
EXPECT_CALL(mockCounterImpl, value()).WillOnce(::testing::Return(50));
|
||||
counter.set(42);
|
||||
},
|
||||
".*"
|
||||
);
|
||||
}
|
||||
|
||||
struct CounterIntTests : ::testing::Test {
|
||||
CounterInt counter{"test_counter", R"(label1="value1",label2="value2")"};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user