EpoxyDuino upgrade

This commit is contained in:
hsaturn
2023-01-04 22:02:00 +01:00
parent 670d67c024
commit d8105ee224
10 changed files with 39 additions and 27 deletions

View File

@@ -4,7 +4,7 @@
EXTRA_CXXFLAGS=-g3 -O0
# Remove flto flag from EpoxyDuino (too many <optimized out>)
CXXFLAGS = -Wextra -Wall -std=gnu++11 -fno-exceptions -fno-threadsafe-statics
CXXFLAGS = -Wextra -Wall -std=gnu++11 -fno-exceptions -fno-threadsafe-statics -DEPOXY_TEST
APP_NAME := network-tests
ARDUINO_LIBS := AUnit AceCommon AceTime TinyMqtt EspMock ESP8266WiFi ESPAsyncTCP TinyConsole

View File

@@ -157,7 +157,7 @@ test(network_client_alive)
const uint32_t keep_alive=1;
start_servers(2, true);
assertEqual(WiFi.status(), WL_CONNECTED);
set_millis(0); // Enter simulated time
EpoxyTest::set_millis(0); // Enter simulated time
MqttBroker broker(1883);
broker.begin();
@@ -178,18 +178,18 @@ test(network_client_alive)
// All is going well if we call client.loop()
// The client is able to send PingReq to the broker
add_seconds(keep_alive);
EpoxyTest::add_seconds(keep_alive);
client.loop();
broker.loop();
assertEqual(broker.clientsCount(), (size_t)1);
// Now simulate that the client is frozen for
// a too long time
add_seconds(TINY_MQTT_CLIENT_ALIVE_TOLERANCE*2);
EpoxyTest::add_seconds(TINY_MQTT_CLIENT_ALIVE_TOLERANCE*2);
broker.loop();
assertEqual(broker.clientsCount(), (size_t)0);
set_real_time();
EpoxyTest::set_real_time();
}
test(network_client_keep_alive_high)