Skip to content

Commit

Permalink
Added initializer for global field in StateWrapper in stitcher test
Browse files Browse the repository at this point in the history
Signed-off-by: Chinmay <[email protected]>
  • Loading branch information
ChinmayaSharma-hue committed Jul 30, 2024
1 parent a876583 commit 1a8b466
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class MQTTParserTest : public ::testing::Test {};

TEST_F(MQTTParserTest, Properties) {
Message frame;
StateWrapper *state = nullptr;
StateWrapper* state = nullptr;
ParseState result_state;
std::string_view frame_view;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ TEST(MqttStitcherTest, EmptyInputs) {
absl::flat_hash_map<packet_id_t, std::deque<Message>> resp_map;

RecordsWithErrorCount<Record> result;
StateWrapper state = {.send = {}, .recv = {}};
StateWrapper state = {.global = {}, .send = {}, .recv = {}};

result = StitchFrames(&req_map, &resp_map, &state);

Expand All @@ -51,7 +51,7 @@ TEST(MqttStitcherTest, OnlyRequests) {
absl::flat_hash_map<packet_id_t, std::deque<Message>> resp_map;

RecordsWithErrorCount<Record> result;
StateWrapper state = {.send = {}, .recv = {}};
StateWrapper state = {.global = {}, .send = {}, .recv = {}};

Message connect_frame, pingreq_frame;
connect_frame = CreateFrame(kRequest, MqttControlPacketType::CONNECT, 0, 0);
Expand All @@ -77,7 +77,7 @@ TEST(MqttStitcherTest, OnlyResponses) {
absl::flat_hash_map<packet_id_t, std::deque<Message>> resp_map;

RecordsWithErrorCount<Record> result;
StateWrapper state = {.send = {}, .recv = {}};
StateWrapper state = {.global = {}, .send = {}, .recv = {}};

Message connack_frame, pingresp_frame;
connack_frame = CreateFrame(kResponse, MqttControlPacketType::CONNACK, 0, 0);
Expand All @@ -102,7 +102,7 @@ TEST(MqttStitcherTest, MissingResponseBeforeNextResponse) {
absl::flat_hash_map<packet_id_t, std::deque<Message>> resp_map;

RecordsWithErrorCount<Record> result;
StateWrapper state = {.send = {}, .recv = {}};
StateWrapper state = {.global = {}, .send = {}, .recv = {}};

Message pub1_frame, puback_frame, sub_frame, suback_frame, unsub_frame, unsuback_frame;
pub1_frame = CreateFrame(kRequest, MqttControlPacketType::PUBLISH, 1, 1);
Expand Down Expand Up @@ -141,7 +141,7 @@ TEST(MqttStitcherTest, MissingResponseTailEnd) {
absl::flat_hash_map<packet_id_t, std::deque<Message>> resp_map;

RecordsWithErrorCount<Record> result;
StateWrapper state = {.send = {}, .recv = {}};
StateWrapper state = {.global = {}, .send = {}, .recv = {}};

Message pub1_frame, sub_frame, suback_frame, unsub_frame, unsuback_frame;
pub1_frame = CreateFrame(kRequest, MqttControlPacketType::PUBLISH, 1, 1);
Expand Down Expand Up @@ -182,7 +182,7 @@ TEST(MqttStitcherTest, MissingRequest) {
absl::flat_hash_map<packet_id_t, std::deque<Message>> resp_map;

RecordsWithErrorCount<Record> result;
StateWrapper state = {.send = {}, .recv = {}};
StateWrapper state = {.global = {}, .send = {}, .recv = {}};

Message connect_frame, connack_frame, pingresp_frame;
connect_frame = CreateFrame(kRequest, MqttControlPacketType::CONNECT, 0, 0);
Expand Down Expand Up @@ -212,7 +212,7 @@ TEST(MqttStitcherTest, InOrderMatching) {
absl::flat_hash_map<packet_id_t, std::deque<Message>> resp_map;

RecordsWithErrorCount<Record> result;
StateWrapper state = {.send = {}, .recv = {}};
StateWrapper state = {.global = {}, .send = {}, .recv = {}};

// Establishment of connection, ping requests and responses, and three publish requests (qos 1,
// qos 2 and qos 1) with increasing packet identifiers (since they are sent before their responses
Expand Down Expand Up @@ -296,7 +296,7 @@ TEST(MqttStitcherTest, OutOfOrderMatching) {
absl::flat_hash_map<packet_id_t, std::deque<Message>> resp_map;

RecordsWithErrorCount<Record> result;
StateWrapper state = {.send = {}, .recv = {}};
StateWrapper state = {.global = {}, .send = {}, .recv = {}};

// Delayed response for PUBLISH (PID 3, QOS 1) and SUBSCRIBE (PID 4) (Delayed meaning some the
// response for this request comes after the responses for later requests)
Expand Down Expand Up @@ -355,7 +355,7 @@ TEST(MqttStitcherTest, DummyResponseStitching) {
absl::flat_hash_map<packet_id_t, std::deque<Message>> resp_map;

RecordsWithErrorCount<Record> result;
StateWrapper state = {.send = {}, .recv = {}};
StateWrapper state = {.global = {}, .send = {}, .recv = {}};

Message pub0_frame, disconnect_frame, connect_frame, connack_frame;
pub0_frame = CreateFrame(kRequest, MqttControlPacketType::PUBLISH, 0, 0); // PUBLISH with QoS 0
Expand Down

0 comments on commit 1a8b466

Please sign in to comment.