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 <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2019-11-21 15:06:20 -08:00 committed by Andrew Boie
commit d27acb9eb6
4 changed files with 28 additions and 6 deletions

View file

@ -43,7 +43,12 @@ dummy_test(test_msgq_user_attrs_get);
dummy_test(test_msgq_user_purge_when_put);
#endif /* CONFIG_USERSPACE */
K_MEM_POOL_DEFINE(test_pool, 128, 128, 2, 4);
#ifdef CONFIG_64BIT
#define MAX_SZ 256
#else
#define MAX_SZ 128
#endif
K_MEM_POOL_DEFINE(test_pool, 128, MAX_SZ, 2, 4);
extern struct k_msgq kmsgq;
extern struct k_msgq msgq;

View file

@ -32,7 +32,12 @@ K_SEM_DEFINE(end_sema, 0, 1);
* to allocate the pipe object, one for its buffer. Both should be auto-
* released when the thread exits
*/
K_MEM_POOL_DEFINE(test_pool, 128, 128, 4, 4);
#ifdef CONFIG_64BIT
#define SZ 256
#else
#define SZ 128
#endif
K_MEM_POOL_DEFINE(test_pool, SZ, SZ, 4, 4);
static void tpipe_put(struct k_pipe *ppipe, int timeout)
{
@ -337,9 +342,9 @@ void test_pipe_alloc(void)
zassert_false(k_pipe_alloc_init(&pipe_test_alloc, 0), NULL);
k_pipe_cleanup(&pipe_test_alloc);
ret = k_pipe_alloc_init(&pipe_test_alloc, PIPE_LEN * 8);
ret = k_pipe_alloc_init(&pipe_test_alloc, 1024);
zassert_true(ret == -ENOMEM,
"resource pool is smaller then requested buffer");
"resource pool max block size is not smaller then requested buffer");
}
/**

View file

@ -13,7 +13,13 @@ extern void test_poll_multi(void);
extern void test_poll_threadstate(void);
extern void test_poll_grant_access(void);
K_MEM_POOL_DEFINE(test_pool, 128, 128, 4, 4);
#ifdef CONFIG_64BIT
#define MAX_SZ 256
#else
#define MAX_SZ 128
#endif
K_MEM_POOL_DEFINE(test_pool, 128, MAX_SZ, 4, 4);
/*test case main entry*/
void test_main(void)

View file

@ -28,7 +28,13 @@ static void test_queue_alloc_append_user(void)
ztest_test_skip();
}
#endif
K_MEM_POOL_DEFINE(test_pool, 16, 96, 4, 4);
#ifdef CONFIG_64BIT
#define MAX_SZ 128
#else
#define MAX_SZ 96
#endif
K_MEM_POOL_DEFINE(test_pool, 16, MAX_SZ, 4, 4);
/*test case main entry*/
void test_main(void)