1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

emulation on host: fix internal udp management (#8561)

* emulation on host: fix internal udp management
help dtors: clear map before exit, check with valgrind

* fix style
This commit is contained in:
david gauchard 2022-05-15 22:06:20 +02:00 committed by GitHub
parent 80c0570620
commit 33afdc2723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View File

@ -13,7 +13,8 @@ for i in ../../libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient \
../../libraries/ESP8266WebServer/examples/HelloServer/HelloServer \ ../../libraries/ESP8266WebServer/examples/HelloServer/HelloServer \
../../libraries/SD/examples/Files/Files \ ../../libraries/SD/examples/Files/Files \
../../libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp \ ../../libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp \
../../libraries/LittleFS/examples/SpeedTest/SpeedTest ; do ../../libraries/LittleFS/examples/SpeedTest/SpeedTest \
../../libraries/DNSServer/examples/DNSServer/DNSServer ; do
make -j2 D=1 FORCE32=0 $i make -j2 D=1 FORCE32=0 $i
valgrind --leak-check=full --track-origins=yes --error-limit=no --show-leak-kinds=all --error-exitcode=999 bin/$(basename $i)/$(basename $i) -1 valgrind --leak-check=full --track-origins=yes --error-limit=no --show-leak-kinds=all --error-exitcode=999 bin/$(basename $i)/$(basename $i) -1
done done

View File

@ -163,6 +163,7 @@ static struct option options[] = {
void cleanup() void cleanup()
{ {
mock_stop_udp();
mock_stop_spiffs(); mock_stop_spiffs();
mock_stop_littlefs(); mock_stop_littlefs();
mock_stop_uart(); mock_stop_uart();

View File

@ -33,7 +33,7 @@
#include <poll.h> #include <poll.h>
#include <map> #include <map>
std::map<int, UdpContext*> udps; static std::map<int, UdpContext*> udps;
void register_udp(int sock, UdpContext* udp) void register_udp(int sock, UdpContext* udp)
{ {
@ -58,3 +58,8 @@ void check_incoming_udp()
} }
} }
} }
void mock_stop_udp()
{
udps.clear();
}

View File

@ -170,6 +170,7 @@ void mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize);
class UdpContext; class UdpContext;
void register_udp(int sock, UdpContext* udp = nullptr); void register_udp(int sock, UdpContext* udp = nullptr);
void mock_stop_udp();
// //