summaryrefslogtreecommitdiffstats
path: root/c/src/tests/tmtests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-12-20 15:21:31 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-12-20 15:21:31 +0000
commit3ad7602ef237319eb320488f090df786a9c03423 (patch)
tree1de10a32c4f0cdce8fb7bae3b7b586d887b4d11c /c/src/tests/tmtests
parentSpelling error corrected. (diff)
downloadrtems-3ad7602ef237319eb320488f090df786a9c03423.tar.bz2
Modifications to avoid having the size of the Buffer_addresses array
too small when OPERATION_COUNT is less than 10.
Diffstat (limited to 'c/src/tests/tmtests')
-rw-r--r--c/src/tests/tmtests/tm20/task1.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/c/src/tests/tmtests/tm20/task1.c b/c/src/tests/tmtests/tm20/task1.c
index 162a99c8d1..34247ead95 100644
--- a/c/src/tests/tmtests/tm20/task1.c
+++ b/c/src/tests/tmtests/tm20/task1.c
@@ -12,6 +12,7 @@
#define TEST_INIT
#include "system.h"
+#include <assert.h>
rtems_device_major_number _STUB_major = 1;
@@ -19,18 +20,23 @@ rtems_id Region_id;
rtems_name Region_name;
rtems_unsigned8 Region_area[ 2048 ] CPU_STRUCTURE_ALIGNMENT;
+#define PARTITION_SIZE 2048
+#define PARTITION_ELEMENT_SIZE 128
+#define PARTITION_BUFFER_POINTERS \
+ ((PARTITION_SIZE / PARTITION_ELEMENT_SIZE) + 2)
+
rtems_id Partition_id;
rtems_name Partition_name;
-rtems_unsigned8 Partition_area[ 2048 ] CPU_STRUCTURE_ALIGNMENT;
+rtems_unsigned8 Partition_area[ PARTITION_SIZE ] CPU_STRUCTURE_ALIGNMENT;
-void *Buffer_address_1;
-void *Buffer_address_2;
-void *Buffer_address_3;
-void *Buffer_address_4;
+void *Buffer_address_1;
+void *Buffer_address_2;
+void *Buffer_address_3;
+void *Buffer_address_4;
rtems_unsigned32 buffer_count;
-void *Buffer_addresses[ OPERATION_COUNT+1 ];
+void *Buffer_addresses[ PARTITION_BUFFER_POINTERS ];
rtems_task Task_1(
rtems_task_argument argument
@@ -95,7 +101,7 @@ rtems_task Task_1(
rtems_partition_create(
Partition_name,
Partition_area,
- 2048,
+ PARTITION_SIZE,
128,
RTEMS_DEFAULT_ATTRIBUTES,
&Partition_id
@@ -154,6 +160,8 @@ rtems_task Task_1(
if ( status == RTEMS_UNSATISFIED ) break;
buffer_count++;
+
+ assert( buffer_count < PARTITION_BUFFER_POINTERS );
}
Timer_initialize();
@@ -209,7 +217,7 @@ rtems_task Task_1(
RTEMS_NO_TIMEOUT,
&Buffer_address_2
);
- directive_failed( status, "region_get_semgent" );
+ directive_failed( status, "region_get_segment" );
Timer_initialize();
(void) rtems_region_get_segment(