mirror of
https://github.com/espressif/esp-mqtt.git
synced 2026-08-03 20:14:15 +02:00
20b6eb0e30
Split message validation path for mqtt5 Introduces tests on the conformance test suite Fixes #312
26 lines
719 B
C++
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);
|
|
}
|