Skip to content

Commit

Permalink
tests: lib: hash_map: fix libc heap size setting
Browse files Browse the repository at this point in the history
The malloc arena/heap size setting can be adjusted using different
Kconfig options, depending on the libc implementation. This means
prj.conf can't be used to set this value on projects that can be built
for multiple libcs without generating a Kconfig warning.

Note: similar fix was applied for the hash_map sample, see
7ef8911

Signed-off-by: Gerard Marull-Paretas <[email protected]>
  • Loading branch information
gmarull authored and cfriedt committed Oct 10, 2023
1 parent c5064cf commit a19c7f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions tests/lib/hash_map/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
CONFIG_ZTEST=y
CONFIG_ZTEST_NEW_API=y

CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=8192
CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=8192

CONFIG_SYS_HASH_FUNC32=y
CONFIG_SYS_HASH_MAP=y

Expand Down
4 changes: 4 additions & 0 deletions tests/lib/hash_map/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ common:
tests:
libraries.hash_map.separate_chaining.djb2:
extra_configs:
- CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=8192
- CONFIG_SYS_HASH_MAP_CHOICE_SC=y
- CONFIG_SYS_HASH_FUNC32_CHOICE_DJB2=y
libraries.hash_map.open_addressing.djb2:
extra_configs:
- CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=8192
- CONFIG_SYS_HASH_MAP_CHOICE_OA_LP=y
- CONFIG_SYS_HASH_FUNC32_CHOICE_DJB2=y
libraries.hash_map.cxx.djb2:
# need newlib for the c++ runtime
filter: TOOLCHAIN_HAS_NEWLIB == 1
extra_configs:
- CONFIG_NEWLIB_LIBC=y
- CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=8192
- CONFIG_SYS_HASH_MAP_CHOICE_CXX=y

0 comments on commit a19c7f2

Please sign in to comment.