unit tests: Only initialise tcpip_adapter() when needed by the test

Prevents unexpected memory allocations when running tests which
don't require tcpip_adapter.
This commit is contained in:
Angus Gratton
2018-09-26 10:17:46 +10:00
committed by bot
parent 222a7118a9
commit 159ff6e08e
8 changed files with 103 additions and 18 deletions

View File

@@ -3,7 +3,6 @@
#include "freertos/task.h"
#include "unity.h"
#include "unity_config.h"
#include "tcpip_adapter.h"
void unityTask(void *pvParameters)
{
@@ -13,10 +12,6 @@ void unityTask(void *pvParameters)
void app_main()
{
// TCP/IP adapter is initialized here because it leaks memory so the
// initialization in test cases would make the test fail because of leak.
tcpip_adapter_init();
// Note: if unpinning this task, change the way run times are calculated in
// unity_platform
xTaskCreatePinnedToCore(unityTask, "unityTask", UNITY_FREERTOS_STACK_SIZE, NULL,