Return error when limit<=0 (#804)

Fix #806
This commit is contained in:
cyan317
2023-08-02 15:34:42 +01:00
committed by GitHub
parent 1804e3e9c0
commit c90bc15959
45 changed files with 832 additions and 562 deletions

View File

@@ -49,7 +49,7 @@ TEST_F(RPCDefaultProcessorTest, ValidInput)
EXPECT_CALL(handler, spec(_)).WillOnce(ReturnRef(spec));
EXPECT_CALL(handler, process(Eq(data), _)).WillOnce(Return(data));
auto const ret = processor(handler, input, Context{std::ref(yield)});
auto const ret = processor(handler, input, Context{yield});
ASSERT_TRUE(ret); // no error
});
}
@@ -64,7 +64,7 @@ TEST_F(RPCDefaultProcessorTest, NoInputVaildCall)
auto const input = json::parse(R"({})");
EXPECT_CALL(handler, process(_)).WillOnce(Return(data));
auto const ret = processor(handler, input, Context{std::ref(yield)});
auto const ret = processor(handler, input, Context{yield});
ASSERT_TRUE(ret); // no error
});
}
@@ -79,7 +79,7 @@ TEST_F(RPCDefaultProcessorTest, InvalidInput)
auto const spec = RpcSpec{{"something", Required{}}};
EXPECT_CALL(handler, spec(_)).WillOnce(ReturnRef(spec));
auto const ret = processor(handler, input, Context{std::ref(yield)});
auto const ret = processor(handler, input, Context{yield});
ASSERT_FALSE(ret); // returns error
});
}