Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 Intel Corporation |
| 3 | * |
| 4 | * SPDX-License-Identifier: Apache-2.0 |
| 5 | */ |
| 6 | |
| 7 | /* |
| 8 | * @file test dynamic memory allocation using C libraries |
| 9 | * |
| 10 | * This module verifies that the various dynamic memory allocation functions |
| 11 | * works fine with minimal C library and newlib C library. |
| 12 | * |
| 13 | * IMPORTANT: The module only ensures that each supported library is present, |
| 14 | * and that a bare minimum of its functionality is operating correctly. It does |
| 15 | * NOT guarantee that ALL standards-defined functionality is present, nor does |
| 16 | * it guarantee that ALL functionality provided is working correctly. |
| 17 | */ |
| 18 | |
Keith Packard | 623a6d9 | 2022-04-12 17:16:01 -0700 | [diff] [blame] | 19 | #define _BSD_SOURCE |
Gerard Marull-Paretas | 79e6b0e | 2022-08-25 09:58:46 +0200 | [diff] [blame] | 20 | #include <zephyr/kernel.h> |
Fabio Baltieri | def2301 | 2022-07-19 14:16:24 +0000 | [diff] [blame] | 21 | #include <zephyr/ztest.h> |
Tom Hughes | 11d70c6 | 2025-01-15 16:32:52 -0800 | [diff] [blame] | 22 | #include <zephyr/test_toolchain.h> |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 23 | #include <stdlib.h> |
| 24 | #include <errno.h> |
Martin Åberg | 80b9080 | 2021-01-14 15:24:16 +0100 | [diff] [blame] | 25 | #include <time.h> |
Keith Packard | 0643f00 | 2022-06-20 21:44:20 -0700 | [diff] [blame] | 26 | #include <stdint.h> |
| 27 | |
Tom Hughes | 11d70c6 | 2025-01-15 16:32:52 -0800 | [diff] [blame] | 28 | /* |
| 29 | * Don't complain about ridiculous alloc size requests |
| 30 | */ |
Tom Hughes | 1541174 | 2025-01-17 09:32:42 -0800 | [diff] [blame] | 31 | TOOLCHAIN_DISABLE_GCC_WARNING(TOOLCHAIN_WARNING_ALLOC_SIZE_LARGER_THAN) |
Tom Hughes | 11d70c6 | 2025-01-15 16:32:52 -0800 | [diff] [blame] | 32 | |
Keith Packard | 0643f00 | 2022-06-20 21:44:20 -0700 | [diff] [blame] | 33 | #define TOO_BIG PTRDIFF_MAX |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 34 | |
shixiongx zhang | 84d23fd | 2021-03-04 14:31:06 +0800 | [diff] [blame] | 35 | /** |
| 36 | * |
| 37 | * @brief Test implementation-defined constants library |
| 38 | * @defgroup libc_api |
| 39 | * @ingroup all_tests |
| 40 | * @{ |
| 41 | * |
| 42 | */ |
| 43 | |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 44 | #define BUF_LEN 10 |
| 45 | |
Martin Åberg | 80b9080 | 2021-01-14 15:24:16 +0100 | [diff] [blame] | 46 | |
| 47 | /* The access test allocates objects of this type and dereferences members. */ |
| 48 | union aligntest { |
| 49 | long long thelonglong; |
| 50 | double thedouble; |
| 51 | uintmax_t theuintmax_t; |
| 52 | void (*thepfunc)(void); |
| 53 | time_t thetime_t; |
| 54 | }; |
| 55 | |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 56 | |
Keith Packard | 5e0a25f | 2023-05-09 12:14:52 -0700 | [diff] [blame] | 57 | #if defined(CONFIG_COMMON_LIBC_MALLOC) && \ |
| 58 | (CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE == 0) |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 59 | __no_optimization void _test_no_mem_malloc(void) |
| 60 | { |
| 61 | int *iptr = NULL; |
| 62 | |
| 63 | iptr = malloc(BUF_LEN); |
| 64 | zassert_is_null((iptr), "malloc failed, errno: %d", errno); |
| 65 | free(iptr); |
| 66 | iptr = NULL; |
| 67 | } |
| 68 | |
| 69 | ZTEST(c_lib_dynamic_memalloc, test_no_mem_malloc) |
| 70 | { |
| 71 | _test_no_mem_malloc(); |
| 72 | } |
| 73 | |
| 74 | __no_optimization void _test_no_mem_realloc(void) |
| 75 | { |
| 76 | char *ptr = NULL; |
| 77 | char *reloc_ptr = NULL; |
| 78 | |
| 79 | reloc_ptr = realloc(ptr, BUF_LEN); |
| 80 | zassert_is_null(reloc_ptr, "realloc failed, errno: %d", errno); |
| 81 | free(reloc_ptr); |
| 82 | reloc_ptr = NULL; |
| 83 | } |
| 84 | |
| 85 | ZTEST(c_lib_dynamic_memalloc, test_no_mem_realloc) |
| 86 | { |
| 87 | _test_no_mem_realloc(); |
| 88 | } |
| 89 | #else |
Martin Åberg | 80b9080 | 2021-01-14 15:24:16 +0100 | [diff] [blame] | 90 | /* Make sure we can access some built-in types. */ |
| 91 | static void do_the_access(volatile union aligntest *aptr) |
| 92 | { |
| 93 | aptr->thelonglong = 2; |
| 94 | aptr->thelonglong; |
| 95 | |
| 96 | if (IS_ENABLED(CONFIG_FPU)) { |
| 97 | aptr->thedouble = 3.0; |
| 98 | aptr->thedouble; |
| 99 | } |
| 100 | |
| 101 | aptr->theuintmax_t = 4; |
| 102 | aptr->theuintmax_t; |
| 103 | |
| 104 | aptr->thepfunc = test_main; |
| 105 | aptr->thepfunc; |
| 106 | |
| 107 | aptr->thetime_t = 3; |
| 108 | aptr->thetime_t; |
| 109 | } |
| 110 | |
| 111 | #define PRINT_TYPE_INFO(_t) \ |
| 112 | TC_PRINT(" %-14s %4zu %5zu\n", #_t, sizeof(_t), __alignof__(_t)) |
| 113 | |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 114 | ZTEST(c_lib_dynamic_memalloc, test_malloc_align) |
Martin Åberg | 80b9080 | 2021-01-14 15:24:16 +0100 | [diff] [blame] | 115 | { |
| 116 | char *ptr[64] = { NULL }; |
| 117 | |
| 118 | TC_PRINT(" Compiler type info for " CONFIG_ARCH " " CONFIG_BOARD "\n"); |
| 119 | TC_PRINT(" TYPE SIZE ALIGN\n"); |
| 120 | PRINT_TYPE_INFO(int); |
| 121 | PRINT_TYPE_INFO(long); |
| 122 | PRINT_TYPE_INFO(long long); |
| 123 | PRINT_TYPE_INFO(double); |
| 124 | PRINT_TYPE_INFO(size_t); |
| 125 | PRINT_TYPE_INFO(void *); |
| 126 | PRINT_TYPE_INFO(void (*)(void)); |
| 127 | PRINT_TYPE_INFO(time_t); |
| 128 | |
| 129 | /* Tries to use the malloc() implementation when in different states. */ |
| 130 | for (size_t i = 0; i < ARRAY_SIZE(ptr); i++) { |
| 131 | union aligntest *aptr = NULL; |
| 132 | |
| 133 | ptr[i] = malloc(sizeof *(ptr[i])); |
| 134 | aptr = malloc(sizeof(*aptr)); |
| 135 | if (aptr) { |
| 136 | do_the_access(aptr); |
| 137 | } |
| 138 | free(aptr); |
| 139 | } |
| 140 | for (size_t i = 0; i < ARRAY_SIZE(ptr); i++) { |
| 141 | free(ptr[i]); |
| 142 | ptr[i] = NULL; |
| 143 | } |
| 144 | |
| 145 | for (size_t n = 0; n < ARRAY_SIZE(ptr); n++) { |
| 146 | union aligntest *aptr = NULL; |
| 147 | |
| 148 | for (size_t i = 0; i < n; i++) { |
| 149 | ptr[i] = malloc(sizeof *(ptr[i])); |
| 150 | } |
| 151 | aptr = malloc(sizeof(*aptr)); |
| 152 | if (aptr) { |
| 153 | do_the_access(aptr); |
| 154 | } |
| 155 | free(aptr); |
| 156 | for (size_t i = 0; i < n; i++) { |
| 157 | free(ptr[i]); |
| 158 | ptr[i] = NULL; |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | for (size_t n = 0; n < ARRAY_SIZE(ptr); n++) { |
| 163 | union aligntest *aptr = NULL; |
| 164 | |
| 165 | ptr[n] = malloc(n); |
| 166 | aptr = malloc(sizeof(*aptr)); |
| 167 | if (aptr) { |
| 168 | do_the_access(aptr); |
| 169 | } |
| 170 | free(aptr); |
| 171 | free(ptr[n]); |
| 172 | ptr[n] = NULL; |
| 173 | } |
| 174 | } |
| 175 | |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 176 | /** |
| 177 | * @brief Test dynamic memory allocation using malloc |
| 178 | * |
| 179 | * @see malloc(), free() |
| 180 | */ |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 181 | ZTEST(c_lib_dynamic_memalloc, test_malloc) |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 182 | { |
| 183 | /* Initialize error number to avoid garbage value, in case of SUCCESS */ |
| 184 | int *iptr = NULL; |
| 185 | |
| 186 | iptr = malloc(BUF_LEN * sizeof(int)); |
| 187 | zassert_not_null((iptr), "malloc failed, errno: %d", errno); |
Andrew Boie | 4b4f773 | 2019-02-01 12:18:31 -0800 | [diff] [blame] | 188 | memset(iptr, 'p', BUF_LEN * sizeof(int)); |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 189 | free(iptr); |
| 190 | iptr = NULL; |
| 191 | } |
| 192 | |
| 193 | /** |
| 194 | * @brief Test dynamic memory allocation free function |
| 195 | * |
| 196 | * @see free() |
| 197 | */ |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 198 | ZTEST(c_lib_dynamic_memalloc, test_free) |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 199 | { |
| 200 | /* |
| 201 | * In free, if ptr is passed as NULL, no operation is performed |
| 202 | * Just make sure, no exception occurs and test pass |
| 203 | */ |
| 204 | free(NULL); |
| 205 | } |
| 206 | |
| 207 | /** |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 208 | * @brief Test dynamic memory allocation using realloc |
| 209 | * |
| 210 | * @see malloc(), realloc(), free() |
| 211 | */ |
Andrew Boie | 4b4f773 | 2019-02-01 12:18:31 -0800 | [diff] [blame] | 212 | ZTEST_BMEM unsigned char filled_buf[BUF_LEN]; |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 213 | |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 214 | ZTEST(c_lib_dynamic_memalloc, test_realloc) |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 215 | { |
| 216 | char orig_size = BUF_LEN; |
| 217 | char new_size = BUF_LEN + BUF_LEN; |
| 218 | char *ptr = NULL; |
| 219 | char *reloc_ptr = NULL; |
| 220 | |
| 221 | ptr = malloc(orig_size); |
| 222 | |
| 223 | zassert_not_null((ptr), "malloc failed, errno: %d", errno); |
Flavio Ceolin | da49f2e | 2018-09-11 19:09:03 -0700 | [diff] [blame] | 224 | (void)memset(ptr, 'p', orig_size); |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 225 | |
| 226 | reloc_ptr = realloc(ptr, new_size); |
| 227 | |
| 228 | zassert_not_null(reloc_ptr, "realloc failed, errno: %d", errno); |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 229 | ptr = reloc_ptr; |
| 230 | |
Flavio Ceolin | da49f2e | 2018-09-11 19:09:03 -0700 | [diff] [blame] | 231 | (void)memset(filled_buf, 'p', BUF_LEN); |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 232 | zassert_true(((memcmp(ptr, filled_buf, BUF_LEN)) == 0), |
| 233 | "realloc failed to copy malloc data, errno: %d", errno); |
| 234 | |
| 235 | free(ptr); |
| 236 | ptr = NULL; |
| 237 | } |
| 238 | |
| 239 | /** |
| 240 | * @brief Test dynamic memory allocation using reallocarray |
| 241 | * |
| 242 | * @see malloc(), reallocarray(), free() |
| 243 | */ |
Kumar Gala | d4ed0d7 | 2023-03-16 14:58:04 +0000 | [diff] [blame] | 244 | #if defined(CONFIG_NEWLIB_LIBC) || defined(CONFIG_ARMCLANG_STD_LIBC) |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 245 | ZTEST(c_lib_dynamic_memalloc, test_reallocarray) |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 246 | { |
Kumar Gala | d4ed0d7 | 2023-03-16 14:58:04 +0000 | [diff] [blame] | 247 | /* reallocarray not implemented for newlib or arm libc */ |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 248 | ztest_test_skip(); |
| 249 | } |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 250 | ZTEST(c_lib_dynamic_memalloc, test_calloc) |
shixiongx zhang | 84d23fd | 2021-03-04 14:31:06 +0800 | [diff] [blame] | 251 | { |
| 252 | ztest_test_skip(); |
| 253 | } |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 254 | #else |
shixiongx zhang | 84d23fd | 2021-03-04 14:31:06 +0800 | [diff] [blame] | 255 | /** |
| 256 | * @brief Test dynamic memory allocation using calloc |
| 257 | * |
| 258 | * @see calloc(), free() |
| 259 | */ |
| 260 | #define CALLOC_BUFLEN (200) |
| 261 | static ZTEST_BMEM unsigned char zerobuf[CALLOC_BUFLEN]; |
| 262 | |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 263 | __no_optimization void _test_calloc(void) |
shixiongx zhang | 84d23fd | 2021-03-04 14:31:06 +0800 | [diff] [blame] | 264 | { |
| 265 | char *cptr = NULL; |
| 266 | |
Keith Packard | 0643f00 | 2022-06-20 21:44:20 -0700 | [diff] [blame] | 267 | cptr = calloc(TOO_BIG, sizeof(int)); |
shixiongx zhang | 84d23fd | 2021-03-04 14:31:06 +0800 | [diff] [blame] | 268 | zassert_is_null((cptr), "calloc failed, errno: %d", errno); |
Enjia Mai | d111637 | 2021-03-31 01:10:53 +0800 | [diff] [blame] | 269 | free(cptr); |
shixiongx zhang | 84d23fd | 2021-03-04 14:31:06 +0800 | [diff] [blame] | 270 | |
Keith Packard | 0643f00 | 2022-06-20 21:44:20 -0700 | [diff] [blame] | 271 | cptr = calloc(TOO_BIG, sizeof(char)); |
shixiongx zhang | 84d23fd | 2021-03-04 14:31:06 +0800 | [diff] [blame] | 272 | zassert_is_null((cptr), "calloc failed, errno: %d", errno); |
Enjia Mai | d111637 | 2021-03-31 01:10:53 +0800 | [diff] [blame] | 273 | free(cptr); |
shixiongx zhang | 84d23fd | 2021-03-04 14:31:06 +0800 | [diff] [blame] | 274 | |
| 275 | cptr = calloc(CALLOC_BUFLEN, sizeof(char)); |
| 276 | zassert_not_null((cptr), "calloc failed, errno: %d", errno); |
| 277 | zassert_true(((memcmp(cptr, zerobuf, CALLOC_BUFLEN)) == 0), |
| 278 | "calloc failed to set zero value, errno: %d", errno); |
| 279 | memset(cptr, 'p', CALLOC_BUFLEN); |
| 280 | free(cptr); |
| 281 | cptr = NULL; |
| 282 | } |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 283 | ZTEST(c_lib_dynamic_memalloc, test_calloc) |
| 284 | { |
| 285 | _test_calloc(); |
| 286 | } |
shixiongx zhang | 84d23fd | 2021-03-04 14:31:06 +0800 | [diff] [blame] | 287 | |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 288 | ZTEST(c_lib_dynamic_memalloc, test_reallocarray) |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 289 | { |
| 290 | char orig_size = BUF_LEN; |
| 291 | char *ptr = NULL; |
shixiongx zhang | 84d23fd | 2021-03-04 14:31:06 +0800 | [diff] [blame] | 292 | char *cptr = NULL; |
| 293 | |
Keith Packard | 0643f00 | 2022-06-20 21:44:20 -0700 | [diff] [blame] | 294 | cptr = reallocarray(ptr, TOO_BIG, sizeof(int)); |
shixiongx zhang | 84d23fd | 2021-03-04 14:31:06 +0800 | [diff] [blame] | 295 | zassert_is_null((ptr), "reallocarray failed, errno: %d", errno); |
| 296 | zassert_is_null((cptr), "reallocarray failed, errno: %d"); |
| 297 | free(cptr); |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 298 | |
| 299 | ptr = malloc(orig_size); |
| 300 | |
| 301 | zassert_not_null((ptr), "malloc failed, errno: %d", errno); |
Flavio Ceolin | da49f2e | 2018-09-11 19:09:03 -0700 | [diff] [blame] | 302 | (void)memset(ptr, 'p', orig_size); |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 303 | |
| 304 | char *reloc_ptr = reallocarray(ptr, 2, orig_size); |
| 305 | |
| 306 | zassert_not_null(reloc_ptr, "reallocarray failed"); |
| 307 | zassert_not_null((ptr), "malloc/reallocarray failed, errno: %d", errno); |
| 308 | ptr = reloc_ptr; |
| 309 | |
Flavio Ceolin | da49f2e | 2018-09-11 19:09:03 -0700 | [diff] [blame] | 310 | (void)memset(filled_buf, 'p', BUF_LEN); |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 311 | zassert_true(((memcmp(ptr, filled_buf, BUF_LEN)) == 0), |
| 312 | "realloc failed to copy malloc data, errno: %d", errno); |
| 313 | |
| 314 | free(ptr); |
| 315 | ptr = NULL; |
| 316 | } |
| 317 | #endif |
| 318 | |
| 319 | |
| 320 | #define MAX_LEN (10 * BUF_LEN) |
| 321 | |
| 322 | /** |
| 323 | * @brief Test dynamic memory allocation functions |
| 324 | * |
| 325 | * @see malloc(), calloc(), realloc(), free() |
| 326 | */ |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 327 | ZTEST(c_lib_dynamic_memalloc, test_memalloc_all) |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 328 | { |
| 329 | char *mlc_ptr = NULL; |
| 330 | char *clc_ptr = NULL; |
| 331 | char *reloc_ptr = NULL; |
| 332 | int orig_size = BUF_LEN; |
| 333 | int new_size = MAX_LEN; |
| 334 | |
| 335 | mlc_ptr = malloc(orig_size); |
| 336 | zassert_not_null((mlc_ptr), "malloc failed, errno: %d", errno); |
| 337 | |
| 338 | clc_ptr = calloc(100, sizeof(char)); |
| 339 | zassert_not_null((clc_ptr), "calloc failed, errno: %d", errno); |
| 340 | |
| 341 | reloc_ptr = realloc(mlc_ptr, new_size); |
| 342 | zassert_not_null(reloc_ptr, "realloc failed, errno: %d", errno); |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 343 | mlc_ptr = reloc_ptr; |
| 344 | |
| 345 | free(mlc_ptr); |
| 346 | free(clc_ptr); |
| 347 | mlc_ptr = NULL; |
| 348 | clc_ptr = NULL; |
| 349 | reloc_ptr = NULL; |
| 350 | } |
| 351 | |
| 352 | /** |
shixiongx zhang | 84d23fd | 2021-03-04 14:31:06 +0800 | [diff] [blame] | 353 | * @} |
| 354 | */ |
| 355 | |
| 356 | /** |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 357 | * |
| 358 | * @brief Test dynamic memory allocation upto maximum size |
| 359 | * Negative test case |
| 360 | * |
| 361 | */ |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 362 | __no_optimization void _test_memalloc_max(void) |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 363 | { |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 364 | char *ptr = NULL; |
| 365 | |
Keith Packard | 0643f00 | 2022-06-20 21:44:20 -0700 | [diff] [blame] | 366 | ptr = malloc(TOO_BIG); |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 367 | zassert_is_null(ptr, "malloc passed unexpectedly"); |
| 368 | free(ptr); |
| 369 | ptr = NULL; |
| 370 | } |
| 371 | |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 372 | ZTEST(c_lib_dynamic_memalloc, test_memalloc_max) |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 373 | { |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 374 | _test_memalloc_max(); |
Praful Swarnakar | 3a82aef | 2018-08-02 08:36:59 +0530 | [diff] [blame] | 375 | } |
Anas Nashif | 3e4c547 | 2023-02-22 15:56:59 +0000 | [diff] [blame] | 376 | #endif |
| 377 | |
| 378 | ZTEST_SUITE(c_lib_dynamic_memalloc, NULL, NULL, NULL, NULL, NULL); |