summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-14 16:01:01 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-14 16:01:01 +0000
commitd4b75d20436d63de4c42845b57220c3901431f91 (patch)
treebac2a0d541befc55845b41900440ef0d66f80f06 /testsuites
parent2009-05-14 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-d4b75d20436d63de4c42845b57220c3901431f91.tar.bz2
2009-05-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* sp09/screen11.c, sp09/sp09.scn: Add case where buffer size is not large enough for buffer node overhead.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/sptests/ChangeLog5
-rw-r--r--testsuites/sptests/sp09/screen11.c30
-rw-r--r--testsuites/sptests/sp09/sp09.scn1
3 files changed, 35 insertions, 1 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index 6cfcac4bd2..c2bb4347c9 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-14 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * sp09/screen11.c, sp09/sp09.scn: Add case where buffer size is not
+ large enough for buffer node overhead.
+
2009-05-14 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac, spwatchdog/system.h,
diff --git a/testsuites/sptests/sp09/screen11.c b/testsuites/sptests/sp09/screen11.c
index d685b62f97..779143ca46 100644
--- a/testsuites/sptests/sp09/screen11.c
+++ b/testsuites/sptests/sp09/screen11.c
@@ -6,7 +6,7 @@
*
* Output parameters: NONE
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -24,6 +24,7 @@ void Screen11()
void *buffer_address_2;
void *buffer_address_3;
rtems_status_code status;
+ uint32_t size;
status = rtems_partition_create(
0,
@@ -88,6 +89,33 @@ void Screen11()
);
/*
+ * Attempt to create a partition with a buffer size that is not large
+ * enough to account for the overhead.
+ */
+ puts(
+ "TA1 - rtems_partition_create - buffer size < overhead - RTEMS_INVALID_SIZE"
+ );
+#define SIZEOF_CHAIN_NODE 2 * sizeof(void *)
+ for ( size=0 ; size < SIZEOF_CHAIN_NODE ; size++) {
+ status = rtems_partition_create(
+ Partition_name[ 1 ],
+ Partition_good_area,
+ size,
+ 256,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ if ( status != RTEMS_INVALID_SIZE )
+ printf( "ERROR when size == %d\n", size );
+
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_SIZE,
+ "rtems_partition_create with buffer_size > length"
+ );
+ }
+
+ /*
* The check for an object being global is only made if
* multiprocessing is enabled.
*/
diff --git a/testsuites/sptests/sp09/sp09.scn b/testsuites/sptests/sp09/sp09.scn
index e334f5b74d..9d0d807f03 100644
--- a/testsuites/sptests/sp09/sp09.scn
+++ b/testsuites/sptests/sp09/sp09.scn
@@ -189,6 +189,7 @@ TA1 - rtems_partition_create - RTEMS_INVALID_NAME
TA1 - rtems_partition_create - length - RTEMS_INVALID_SIZE
TA1 - rtems_partition_create - buffer size - RTEMS_INVALID_SIZE
TA1 - rtems_partition_create - length < buffer size - RTEMS_INVALID_SIZE
+TA1 - rtems_partition_create - buffer size < overhead - RTEMS_INVALID_SIZE
TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED
TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS
TA1 - rtems_partition_create - RTEMS_INVALID_SIZE