summaryrefslogtreecommitdiff
path: root/test/tx/regression/threadx_block_memory_basic_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/tx/regression/threadx_block_memory_basic_test.c')
-rw-r--r--test/tx/regression/threadx_block_memory_basic_test.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/test/tx/regression/threadx_block_memory_basic_test.c b/test/tx/regression/threadx_block_memory_basic_test.c
index 12e301d1..94cc8793 100644
--- a/test/tx/regression/threadx_block_memory_basic_test.c
+++ b/test/tx/regression/threadx_block_memory_basic_test.c
@@ -1,8 +1,20 @@
+/***************************************************************************/
+/* Copyright (c) 2024 Microsoft Corporation */
+/* Copyright (c) 2026 Eclipse ThreadX contributors */
+/* */
+/* This program and the accompanying materials are made available under */
+/* the terms of the MIT License which is available at */
+/* https://opensource.org/licenses/MIT. */
+/* */
+/* SPDX-License-Identifier: MIT */
+/***************************************************************************/
+
/* This test is designed to test simple memory block pool creation, deletion, and
allocates and releases. */
#include <stdio.h>
#include "tx_api.h"
+#include "threadx_test_port.h"
typedef struct BLOCK_MEMORY_TEST_STRUCT
{
@@ -86,7 +98,7 @@ CHAR *pointer;
/* Attempt to create a block pool from a timer. */
pointer = (CHAR *) 0x30000;
- status = tx_block_pool_create(&pool_3, "pool 3", 100, pointer, 320);
+ status = tx_block_pool_create(&pool_3, "pool 3", 100, pointer, TX_TEST_BLOCK_POOL_BYTES(100, 3));
/* Check status. */
if (status != TX_CALLER_ERROR)
@@ -146,7 +158,7 @@ UINT status;
}
/* Attempt to create a block pool from an ISR. */
- status = tx_block_pool_create(&pool_3, "pool 3", 100, (void *) 0x100000, 320);
+ status = tx_block_pool_create(&pool_3, "pool 3", 100, (void *) 0x100000, TX_TEST_BLOCK_POOL_BYTES(100, 3));
/* Check status. */
if (status != TX_CALLER_ERROR)
@@ -217,8 +229,8 @@ CHAR *pointer;
}
/* Create block pools 0 and 1. */
- status = tx_block_pool_create(&pool_0, "pool 0", 100, pointer, 320);
- pointer = pointer + 320;
+ status = tx_block_pool_create(&pool_0, "pool 0", 100, pointer, TX_TEST_BLOCK_POOL_BYTES(100, 3));
+ pointer = pointer + TX_TEST_BLOCK_POOL_BYTES(100, 3);
/* Check status. */
if (status != TX_SUCCESS)
@@ -228,8 +240,8 @@ CHAR *pointer;
test_control_return(1);
}
- status = tx_block_pool_create(&pool_1, "pool 1", 100, pointer, 320);
- pointer = pointer + 320;
+ status = tx_block_pool_create(&pool_1, "pool 1", 100, pointer, TX_TEST_BLOCK_POOL_BYTES(100, 3));
+ pointer = pointer + TX_TEST_BLOCK_POOL_BYTES(100, 3);
/* Check status. */
if (status != TX_SUCCESS)
@@ -265,7 +277,7 @@ CHAR *pointer_2;
CHAR *pointer_3;
CHAR *pointer_4;
INT i;
-unsigned long fake_block[20];
+TX_TEST_POINTER_WORD fake_block[20];
/* Inform user. */
@@ -316,7 +328,7 @@ unsigned long fake_block[20];
/* Try to release a block that points to a non-pool. */
fake_block[0] = 0;
- fake_block[1] = (unsigned long) &fake_block[0];
+ TX_TEST_STORE_POINTER(fake_block[1], &fake_block[0]);
status = tx_block_release(&fake_block[2]);
/* Check status. */