@@ -15,15 +15,6 @@ static void test_leak_setup(const char * file, long line)
15
15
unity_reset_leak_checks ();
16
16
}
17
17
18
- static const char * this_bin_addr (void )
19
- {
20
- spi_flash_mmap_handle_t out_handle ;
21
- const void * binary_address ;
22
- const esp_partition_t * partition = esp_ota_get_running_partition ();
23
- esp_partition_mmap (partition , 0 , partition -> size , SPI_FLASH_MMAP_DATA , & binary_address , & out_handle );
24
- return binary_address ;
25
- }
26
-
27
18
TEST_CASE ("mqtt init with invalid url" , "[mqtt][leaks=0]" )
28
19
{
29
20
test_leak_setup (__FILE__ , __LINE__ );
@@ -38,22 +29,32 @@ TEST_CASE("mqtt init and deinit", "[mqtt][leaks=0]")
38
29
{
39
30
test_leak_setup (__FILE__ , __LINE__ );
40
31
const esp_mqtt_client_config_t mqtt_cfg = {
41
- // no connection takes place, but the uri has to be valid for init() to succeed
32
+ // no connection takes place, but the uri has to be valid for init() to succeed
42
33
.uri = "mqtts://localhost:8883" ,
43
34
};
44
35
esp_mqtt_client_handle_t client = esp_mqtt_client_init (& mqtt_cfg );
45
36
TEST_ASSERT_NOT_EQUAL (NULL , client );
46
37
esp_mqtt_client_destroy (client );
47
38
}
48
39
40
+ #if !TEMPORARY_DISABLED_FOR_TARGETS (ESP32S2 )
41
+ static const char * this_bin_addr (void )
42
+ {
43
+ spi_flash_mmap_handle_t out_handle ;
44
+ const void * binary_address ;
45
+ const esp_partition_t * partition = esp_ota_get_running_partition ();
46
+ esp_partition_mmap (partition , 0 , partition -> size , SPI_FLASH_MMAP_DATA , & binary_address , & out_handle );
47
+ return binary_address ;
48
+ }
49
+
49
50
TEST_CASE ("mqtt enqueue and destroy outbox" , "[mqtt][leaks=0]" )
50
51
{
51
52
const char * bin_addr = this_bin_addr ();
52
53
test_leak_setup (__FILE__ , __LINE__ );
53
54
const int messages = 20 ;
54
55
const int size = 2000 ;
55
56
const esp_mqtt_client_config_t mqtt_cfg = {
56
- // no connection takes place, but the uri has to be valid for init() to succeed
57
+ // no connection takes place, but the uri has to be valid for init() to succeed
57
58
.uri = "mqtts://localhost:8883" ,
58
59
};
59
60
esp_mqtt_client_handle_t client = esp_mqtt_client_init (& mqtt_cfg );
@@ -67,4 +68,5 @@ TEST_CASE("mqtt enqueue and destroy outbox", "[mqtt][leaks=0]")
67
68
TEST_ASSERT_GREATER_OR_EQUAL (messages * size , bytes_before - bytes_after );
68
69
69
70
esp_mqtt_client_destroy (client );
70
- }
71
+ }
72
+ #endif //!TEMPORARY_DISABLED_FOR_TARGETS(ESP32S2)
0 commit comments