template<>
void compare(const Cynara::MonitorGetEntriesRequest &req1,
- const Cynara::MonitorGetEntriesRequest &req2) {
+ const Cynara::MonitorGetEntriesRequest &req2)
+{
EXPECT_EQ(req1.bufferSize(), req2.bufferSize());
EXPECT_EQ(req1.sequenceNumber(), req2.sequenceNumber());
}
-static const uint64_t BUFF_SIZE_MIN = 0;
-static const uint64_t BUFF_SIZE_1 = 1;
-static const uint64_t BUFF_SIZE_MAX = CYNARA_MAX_MONITOR_BUFFER_SIZE;
-static const uint64_t BUFF_SIZE_HALF = (BUFF_SIZE_MAX + BUFF_SIZE_MIN) / 2;
-
} /* namespace anonymous */
using namespace Cynara;
/* *** compare by objects test cases *** */
-/**
- * @brief Verify if MonitorGetEntriesRequest is properly (de)serialized with buffer size set
- * to 0
- * @test Expected result:
- * - buffer size is 0
- */
-TEST(ProtocolMonitorGet, MonitorGetEntriesRequest01) {
- auto request = std::make_shared<MonitorGetEntriesRequest>(BUFF_SIZE_MIN, SN::min);
- auto protocol = std::make_shared<ProtocolMonitorGet>();
- testRequest(request, protocol);
-}
-
-/**
- * @brief Verify if MonitorGetEntriesRequest is properly (de)serialized with buffer size set
- * to 1
- * @test Expected result:
- * - buffer size is 1
- */
-TEST(ProtocolMonitorGet, MonitorGetEntriesRequest02) {
- auto request = std::make_shared<MonitorGetEntriesRequest>(BUFF_SIZE_1, SN::min_1);
- auto protocol = std::make_shared<ProtocolMonitorGet>();
- testRequest(request, protocol);
-}
-
-/**
- * @brief Verify if MonitorGetEntriesRequest is properly (de)serialized with buffer size set
- * to half max value
- * @test Expected result:
- * - buffer size is half max value
- */
-TEST(ProtocolMonitorGet, MonitorGetEntriesRequest03) {
- auto request = std::make_shared<MonitorGetEntriesRequest>(BUFF_SIZE_HALF, SN::mid);
- auto protocol = std::make_shared<ProtocolMonitorGet>();
- testRequest(request, protocol);
-}
-
-/**
- * @brief Verify if MonitorGetEntriesRequest is properly (de)serialized with buffer size set
- * to max value
- * @test Expected result:
- * - buffer size is max value
- */
-TEST(ProtocolMonitorGet, MonitorGetEntriesRequest04) {
- auto request = std::make_shared<MonitorGetEntriesRequest>(BUFF_SIZE_MAX, SN::max);
- auto protocol = std::make_shared<ProtocolMonitorGet>();
- testRequest(request, protocol);
+TEST(ProtocolMonitorGet, MonitorGetEntriesRequestPositive) {
+ for (auto &size : Monitor::BufferSize::all) {
+ for (auto &sequenceNumber : SN::all) {
+ auto request = std::make_shared<MonitorGetEntriesRequest>(size, sequenceNumber);
+ auto protocol = std::make_shared<ProtocolMonitorGet>();
+ testRequest(request, protocol);
+ }
+ }
}
/* *** compare by serialized data test cases *** */
-/**
- * @brief Verify if MonitorGetEntriesRequest is properly (de)serialized with buffer size set
- * to 0
- * @test Expected result:
- * - buffer size is 0
- */
-TEST(ProtocolMonitorGet, MonitorGetEntriesRequest05) {
- auto request = std::make_shared<MonitorGetEntriesRequest>(BUFF_SIZE_MIN, SN::min);
- auto protocol = std::make_shared<ProtocolMonitorGet>();
- binaryTestRequest(request, protocol);
-}
-
-/**
- * @brief Verify if MonitorGetEntriesRequest is properly (de)serialized with buffer size set
- * to 1
- * @test Expected result:
- * - buffer size is 1
- */
-TEST(ProtocolMonitorGet, MonitorGetEntriesRequest06) {
- auto request = std::make_shared<MonitorGetEntriesRequest>(BUFF_SIZE_1, SN::min_1);
- auto protocol = std::make_shared<ProtocolMonitorGet>();
- binaryTestRequest(request, protocol);
-}
-
-/**
- * @brief Verify if MonitorGetEntriesRequest is properly (de)serialized with buffer size set
- * to half max value
- * @test Expected result:
- * - buffer size is half max value
- */
-TEST(ProtocolMonitorGet, MonitorGetEntriesRequest07) {
- auto request = std::make_shared<MonitorGetEntriesRequest>(BUFF_SIZE_HALF, SN::mid);
- auto protocol = std::make_shared<ProtocolMonitorGet>();
- binaryTestRequest(request, protocol);
-}
-
-/**
- * @brief Verify if MonitorGetEntriesRequest is properly (de)serialized with buffer size set
- * to max value
- * @test Expected result:
- * - buffer size is max value
- */
-TEST(ProtocolMonitorGet, MonitorGetEntriesRequest08) {
- auto request = std::make_shared<MonitorGetEntriesRequest>(BUFF_SIZE_MAX, SN::max);
- auto protocol = std::make_shared<ProtocolMonitorGet>();
- binaryTestRequest(request, protocol);
+TEST(ProtocolMonitorGet, MonitorGetEntriesRequestBinaryPositive) {
+ for (auto &size : Monitor::BufferSize::all) {
+ for (auto &sequenceNumber : SN::all) {
+ auto request = std::make_shared<MonitorGetEntriesRequest>(size, sequenceNumber);
+ auto protocol = std::make_shared<ProtocolMonitorGet>();
+ binaryTestRequest(request, protocol);
+ }
+ }
}