Files
esp-mqtt/test/host/main/test_mqtt5_client.cpp
T
Euripedes Rocha Filho 20b6eb0e30 fix(mqtt5): Fix mqtt5 max inflight message counting
Split message validation path for mqtt5
Introduces tests on the conformance test suite

Fixes #312
2026-07-28 14:19:52 +02:00

26 lines
719 B
C++

/*
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <catch2/catch_test_macros.hpp>
#include <cstdint>
#include "esp_err.h"
extern "C" {
esp_err_t test_mqtt5_check_inflight_maximum(uint16_t send_count, uint16_t receive_maximum);
int test_mqtt5_increment_packet_counter_with_dup(void);
}
TEST_CASE("MQTT5 inflight quota uses an exact upper bound")
{
REQUIRE(test_mqtt5_check_inflight_maximum(1, 2) == ESP_OK);
REQUIRE(test_mqtt5_check_inflight_maximum(2, 2) == ESP_FAIL);
}
TEST_CASE("MQTT5 first send on a connection counts even when PUBLISH has DUP set")
{
REQUIRE(test_mqtt5_increment_packet_counter_with_dup() == 1);
}