mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-25 13:57:15 +00:00
spmsgq_err[12]: Add message sizes to configuration
The test had hard-coded numbers for maximum messages and message sizes. As a result, it did not configure the memory required for message storage.
This commit is contained in:
@@ -32,8 +32,6 @@
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#define MESSAGE_SIZE (sizeof(long) * 4)
|
||||
|
||||
const char rtems_test_name[] = "SP MESSAGE QUEUE ERROR 1";
|
||||
|
||||
rtems_task Init(
|
||||
@@ -44,6 +42,8 @@ rtems_task Init(
|
||||
uint32_t count;
|
||||
size_t size;
|
||||
rtems_status_code status;
|
||||
|
||||
rtems_test_assert( MAX_MESSAGES == 2 );
|
||||
|
||||
TEST_BEGIN();
|
||||
Queue_name[ 1 ] = rtems_build_name( 'M', 'Q', '1', ' ' );
|
||||
@@ -60,7 +60,7 @@ rtems_task Init(
|
||||
/* null ID parameter */
|
||||
status = rtems_message_queue_create(
|
||||
Queue_name[ 1 ],
|
||||
3,
|
||||
MAX_MESSAGES,
|
||||
MESSAGE_SIZE,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
NULL
|
||||
@@ -90,7 +90,7 @@ rtems_task Init(
|
||||
/* max size == 0 */
|
||||
status = rtems_message_queue_create(
|
||||
Queue_name[ 1 ],
|
||||
3,
|
||||
MAX_MESSAGES,
|
||||
0,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&Junk_id
|
||||
@@ -105,7 +105,7 @@ rtems_task Init(
|
||||
/* bad name parameter */
|
||||
status = rtems_message_queue_create(
|
||||
0,
|
||||
3,
|
||||
MAX_MESSAGES,
|
||||
MESSAGE_SIZE,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&Junk_id
|
||||
@@ -149,7 +149,7 @@ rtems_task Init(
|
||||
|
||||
status = rtems_message_queue_create(
|
||||
Queue_name[ 1 ],
|
||||
2,
|
||||
MAX_MESSAGES,
|
||||
MESSAGE_SIZE,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&Queue_id[ 1 ]
|
||||
@@ -159,7 +159,7 @@ rtems_task Init(
|
||||
|
||||
status = rtems_message_queue_create(
|
||||
Queue_name[ 2 ],
|
||||
1,
|
||||
MAX_MESSAGES,
|
||||
MESSAGE_SIZE,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&Junk_id
|
||||
|
||||
@@ -33,6 +33,12 @@
|
||||
|
||||
#include <tmacros.h>
|
||||
|
||||
/*
|
||||
* Message buffer information
|
||||
*/
|
||||
#define MAX_MESSAGES 2
|
||||
#define MESSAGE_SIZE (sizeof(long) * 4)
|
||||
|
||||
/* functions */
|
||||
|
||||
rtems_task Init(
|
||||
@@ -52,6 +58,9 @@ rtems_task Init(
|
||||
#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 100
|
||||
|
||||
#define CONFIGURE_MESSAGE_BUFFER_MEMORY \
|
||||
CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MAX_MESSAGES, MESSAGE_SIZE)
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#define CONFIGURE_EXTRA_TASK_STACKS (20 * RTEMS_MINIMUM_STACK_SIZE)
|
||||
|
||||
@@ -33,8 +33,6 @@
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
|
||||
#define MESSAGE_SIZE (sizeof(long) * 4)
|
||||
|
||||
const char rtems_test_name[] = "SP MESSAGE QUEUE ERROR 2";
|
||||
|
||||
rtems_task Init(
|
||||
@@ -43,6 +41,8 @@ rtems_task Init(
|
||||
{
|
||||
long buffer[ 4 ];
|
||||
rtems_status_code status;
|
||||
|
||||
rtems_test_assert( MAX_MESSAGES == 2 );
|
||||
|
||||
TEST_BEGIN();
|
||||
Queue_name[ 1 ] = rtems_build_name( 'M', 'Q', '1', ' ' );
|
||||
@@ -61,7 +61,7 @@ rtems_task Init(
|
||||
|
||||
status = rtems_message_queue_create(
|
||||
Queue_name[ 1 ],
|
||||
2,
|
||||
MAX_MESSAGES,
|
||||
MESSAGE_SIZE,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&Queue_id[ 1 ]
|
||||
@@ -75,7 +75,7 @@ rtems_task Init(
|
||||
|
||||
status = rtems_message_queue_create(
|
||||
Queue_name[ 1 ],
|
||||
2,
|
||||
MAX_MESSAGES,
|
||||
MESSAGE_SIZE,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&Queue_id[ 1 ]
|
||||
|
||||
@@ -33,6 +33,12 @@
|
||||
|
||||
#include <tmacros.h>
|
||||
|
||||
/*
|
||||
* Message buffer information
|
||||
*/
|
||||
#define MAX_MESSAGES 2
|
||||
#define MESSAGE_SIZE (sizeof(long) * 4)
|
||||
|
||||
/* functions */
|
||||
|
||||
rtems_task Init(
|
||||
@@ -56,6 +62,9 @@ rtems_task Task_3(
|
||||
#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 100
|
||||
|
||||
#define CONFIGURE_MESSAGE_BUFFER_MEMORY \
|
||||
CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MAX_MESSAGES, MESSAGE_SIZE)
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#define CONFIGURE_EXTRA_TASK_STACKS (20 * RTEMS_MINIMUM_STACK_SIZE)
|
||||
|
||||
Reference in New Issue
Block a user