Skip to content

Commit 2c990a6

Browse files
committed
Merge branch 'bugfix/linux_host_test' into 'master'
fix(linux): fix mixed linux host test issues found after CI docker image upgrade Closes IDFCI-2784 See merge request espressif/esp-idf!38181
2 parents f7218f7 + aa6c645 commit 2c990a6

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

.gitlab/ci/host-test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ test_pytest_qemu:
316316
--qemu-extra-args \"-global driver=timer.$IDF_TARGET.timg,property=wdt_disable,value=true\"
317317

318318
test_pytest_linux:
319-
allow_failure: true # IDFCI-2784 [v5.5, v5.4] test_pytest_linux fails on ubuntu 24.04
320319
extends:
321320
- .host_test_template
322321
- .before_script:build

components/esp_app_format/test_apps/main/test_app_desc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ TEST(esp_app_format, esp_app_get_elf_sha256_test)
2929
int res;
3030
size_t len;
3131

32-
char ref_sha256[sha256_hex_len + 1];
32+
char ref_sha256[sha256_hex_len + 2];
3333
const esp_app_desc_t* desc = esp_app_get_description();
3434
for (int i = 0; i < sizeof(ref_sha256) / 2; ++i) {
3535
snprintf(ref_sha256 + 2 * i, 3, "%02x", desc->app_elf_sha256[i]);

components/heap/test_apps/host_test_linux/main/test_heap_linux.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -50,7 +50,7 @@ TEST_CASE("Alloc APIs", "[heap]")
5050

5151
TEST_CASE("Size APIs", "[heap]")
5252
{
53-
/* These functions doesnt provide any useful information on linux
53+
/* These functions doesn't provide any useful information on linux
5454
These "tests" are simply included to check that all the functions in the header
5555
are actually mocked
5656
*/
@@ -71,21 +71,22 @@ TEST_CASE("Size APIs", "[heap]")
7171
TEST_ASSERT_TRUE(heap_caps_get_allocated_size(&info) == 0);
7272
}
7373

74-
#define TEST_ALIGNMENT 0x1F
74+
#define TEST_ALIGNMENT 0x20
7575

7676
TEST_CASE("Aligned alloc APIs", "[heap]")
7777
{
78-
uint8_t * p = heap_caps_aligned_alloc(TEST_ALIGNMENT, MALLOC_LEN, MALLOC_CAP_DEFAULT);
78+
const int aligned_len = MALLOC_LEN - (MALLOC_LEN % TEST_ALIGNMENT);
79+
uint8_t * p = heap_caps_aligned_alloc(TEST_ALIGNMENT, aligned_len, MALLOC_CAP_DEFAULT);
7980
TEST_ASSERT_NOT_NULL(p);
8081
TEST_ASSERT_TRUE(((intptr_t)p & (0x1F -1)) == 0);
81-
memset(p, TEST_VAL, MALLOC_LEN);
82-
TEST_ASSERT_EACH_EQUAL_HEX8(TEST_VAL, p, MALLOC_LEN);
82+
memset(p, TEST_VAL, aligned_len);
83+
TEST_ASSERT_EACH_EQUAL_HEX8(TEST_VAL, p, aligned_len);
8384
heap_caps_free(p);
8485

85-
p = heap_caps_aligned_calloc(TEST_ALIGNMENT, MALLOC_LEN, sizeof(uint8_t), MALLOC_CAP_DEFAULT);
86+
p = heap_caps_aligned_calloc(TEST_ALIGNMENT, aligned_len, sizeof(uint8_t), MALLOC_CAP_DEFAULT);
8687
TEST_ASSERT_NOT_NULL(p);
8788
TEST_ASSERT_TRUE(((intptr_t)p & (0x1F -1)) == 0);
88-
TEST_ASSERT_EACH_EQUAL_HEX8(0, p, MALLOC_LEN);
89+
TEST_ASSERT_EACH_EQUAL_HEX8(0, p, aligned_len);
8990
heap_caps_free(p);
9091
}
9192

components/log/host_test/log_test/main/log_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ struct PrintFixture : BasicLogFixture {
104104
int print_to_buffer(const char *format, va_list args)
105105
{
106106
// Added support for multi-line log, for example ESP_LOG_BUFFER...
107-
int ret = vsnprintf(&print_buffer[buffer_idx], BUFFER_SIZE, format, args);
107+
int ret = vsnprintf(&print_buffer[buffer_idx], BUFFER_SIZE - buffer_idx, format, args);
108108
buffer_idx += ret;
109109
return ret;
110110
}

0 commit comments

Comments
 (0)