Skip to content

Commit d27acb9

Browse files
Andrew Boieandrewboie
authored andcommitted
tests: adjust resource pool sizes for 64-bit
The requests are somewhat larger on 64-bit since we are allocating structs with pointer members. Increase these to a larger multiple of the minimum block size. Signed-off-by: Andrew Boie <[email protected]>
1 parent a15a47d commit d27acb9

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

tests/kernel/msgq/msgq_api/src/main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ dummy_test(test_msgq_user_attrs_get);
4343
dummy_test(test_msgq_user_purge_when_put);
4444
#endif /* CONFIG_USERSPACE */
4545

46-
K_MEM_POOL_DEFINE(test_pool, 128, 128, 2, 4);
46+
#ifdef CONFIG_64BIT
47+
#define MAX_SZ 256
48+
#else
49+
#define MAX_SZ 128
50+
#endif
51+
K_MEM_POOL_DEFINE(test_pool, 128, MAX_SZ, 2, 4);
4752

4853
extern struct k_msgq kmsgq;
4954
extern struct k_msgq msgq;

tests/kernel/pipe/pipe_api/src/test_pipe_contexts.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ K_SEM_DEFINE(end_sema, 0, 1);
3232
* to allocate the pipe object, one for its buffer. Both should be auto-
3333
* released when the thread exits
3434
*/
35-
K_MEM_POOL_DEFINE(test_pool, 128, 128, 4, 4);
35+
#ifdef CONFIG_64BIT
36+
#define SZ 256
37+
#else
38+
#define SZ 128
39+
#endif
40+
K_MEM_POOL_DEFINE(test_pool, SZ, SZ, 4, 4);
3641

3742
static void tpipe_put(struct k_pipe *ppipe, int timeout)
3843
{
@@ -337,9 +342,9 @@ void test_pipe_alloc(void)
337342
zassert_false(k_pipe_alloc_init(&pipe_test_alloc, 0), NULL);
338343
k_pipe_cleanup(&pipe_test_alloc);
339344

340-
ret = k_pipe_alloc_init(&pipe_test_alloc, PIPE_LEN * 8);
345+
ret = k_pipe_alloc_init(&pipe_test_alloc, 1024);
341346
zassert_true(ret == -ENOMEM,
342-
"resource pool is smaller then requested buffer");
347+
"resource pool max block size is not smaller then requested buffer");
343348
}
344349

345350
/**

tests/kernel/poll/src/main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ extern void test_poll_multi(void);
1313
extern void test_poll_threadstate(void);
1414
extern void test_poll_grant_access(void);
1515

16-
K_MEM_POOL_DEFINE(test_pool, 128, 128, 4, 4);
16+
#ifdef CONFIG_64BIT
17+
#define MAX_SZ 256
18+
#else
19+
#define MAX_SZ 128
20+
#endif
21+
22+
K_MEM_POOL_DEFINE(test_pool, 128, MAX_SZ, 4, 4);
1723

1824
/*test case main entry*/
1925
void test_main(void)

tests/kernel/queue/src/main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ static void test_queue_alloc_append_user(void)
2828
ztest_test_skip();
2929
}
3030
#endif
31-
K_MEM_POOL_DEFINE(test_pool, 16, 96, 4, 4);
31+
32+
#ifdef CONFIG_64BIT
33+
#define MAX_SZ 128
34+
#else
35+
#define MAX_SZ 96
36+
#endif
37+
K_MEM_POOL_DEFINE(test_pool, 16, MAX_SZ, 4, 4);
3238

3339
/*test case main entry*/
3440
void test_main(void)

0 commit comments

Comments
 (0)