[PATCH 4/9] spport_err01: New test split from sp09

Jennifer Averett jennifer.averett at oarcorp.com
Thu Mar 27 15:30:01 UTC 2014


From: Björn Larsson <BjornL at rtems.org>

This test verifies rtems_port_XXX error tests from sp09 screen 9.
---
 testsuites/sptests/Makefile.am                   |   2 +-
 testsuites/sptests/configure.ac                  |   1 +
 testsuites/sptests/sp09/Makefile.am              |   2 +-
 testsuites/sptests/sp09/screen09.c               | 150 -----------------------
 testsuites/sptests/sp09/sp09.scn                 |  10 --
 testsuites/sptests/sp09/system.h                 |   2 -
 testsuites/sptests/sp09/task1.c                  |   3 -
 testsuites/sptests/spport_err01/Makefile.am      |  22 ++++
 testsuites/sptests/spport_err01/init.c           | 150 +++++++++++++++++++++++
 testsuites/sptests/spport_err01/spport_err01.doc |  25 ++++
 testsuites/sptests/spport_err01/spport_err01.scn |  11 ++
 testsuites/sptests/spport_err01/system.h         |  64 ++++++++++
 12 files changed, 275 insertions(+), 167 deletions(-)
 delete mode 100644 testsuites/sptests/sp09/screen09.c
 create mode 100644 testsuites/sptests/spport_err01/Makefile.am
 create mode 100644 testsuites/sptests/spport_err01/init.c
 create mode 100644 testsuites/sptests/spport_err01/spport_err01.doc
 create mode 100644 testsuites/sptests/spport_err01/spport_err01.scn
 create mode 100644 testsuites/sptests/spport_err01/system.h

diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index a4c3b01..625b6d6 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -30,7 +30,7 @@ SUBDIRS = \
     spsimplesched03 spnsext01 spedfsched01 spedfsched02 spedfsched03 \
     spcbssched01 spcbssched02 spcbssched03 spqreslib sptimespec01 \
     spregion_err01 sppartition_err01 spratemon_err01 spintr_err01 \
-    spsignal_err01
+    spsignal_err01 spport_err01
 SUBDIRS += spprofiling01
 SUBDIRS += spcache01
 SUBDIRS += sptls03
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index 62ab10c..809957d 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -197,6 +197,7 @@ spnotepad01/Makefile
 spnsext01/Makefile
 spobjgetnext/Makefile
 sppagesize/Makefile
+spport_err01/Makefile
 spprintk/Makefile
 spprivenv01/Makefile
 spqreslib/Makefile
diff --git a/testsuites/sptests/sp09/Makefile.am b/testsuites/sptests/sp09/Makefile.am
index f486853..5e92d87 100644
--- a/testsuites/sptests/sp09/Makefile.am
+++ b/testsuites/sptests/sp09/Makefile.am
@@ -1,7 +1,7 @@
 
 rtems_tests_PROGRAMS = sp09
 sp09_SOURCES = init.c delay.c isr.c screen01.c screen02.c screen03.c screen04.c \
-    screen05.c screen06.c screen07.c screen08.c screen09.c \
+    screen05.c screen06.c screen07.c screen08.c \
     task1.c task2.c task3.c \
     system.h
 
diff --git a/testsuites/sptests/sp09/screen09.c b/testsuites/sptests/sp09/screen09.c
deleted file mode 100644
index f0c0ccc..0000000
--- a/testsuites/sptests/sp09/screen09.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*  Screen9
- *
- *  This routine generates error screen 9 for test 9.
- *
- *  Input parameters:  NONE
- *
- *  Output parameters:  NONE
- *
- *  COPYRIGHT (c) 1989-2009.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "system.h"
-
-void Screen9()
-{
-  void              *converted;
-  rtems_status_code status;
-
-  status = rtems_port_create(
-     0,
-     Internal_port_area,
-     External_port_area,
-     sizeof( Internal_port_area ),
-     &Junk_id
-  );
-  fatal_directive_status(
-    status,
-    RTEMS_INVALID_NAME,
-    "rtems_port_create with illegal name"
-  );
-  puts( "TA1 - rtems_port_create - RTEMS_INVALID_NAME" );
-
-#if defined(_C3x) || defined(_C4x)
-  puts( "TA1 - rtems_port_create - RTEMS_INVALID_ADDRESS - SKIPPED" );
-#else
-  status = rtems_port_create(
-     Port_name[ 1 ],
-     &((char *)Internal_port_area)[ 1 ],
-     External_port_area,
-     sizeof( Internal_port_area ),
-     &Junk_id
-  );
-  fatal_directive_status(
-    status,
-    RTEMS_INVALID_ADDRESS,
-    "rtems_port_create with illegal address"
-  );
-  puts( "TA1 - rtems_port_create - bad range - RTEMS_INVALID_ADDRESS" );
-#endif
-
-  status = rtems_port_create(
-     Port_name[ 1 ],
-     Internal_port_area,
-     External_port_area,
-     sizeof( Internal_port_area ),
-     NULL
-  );
-  fatal_directive_status(
-    status,
-    RTEMS_INVALID_ADDRESS,
-    "rtems_port_create null Id"
-  );
-  puts( "TA1 - rtems_port_create - null id - RTEMS_INVALID_ADDRESS" );
-
-  status = rtems_port_create(
-     Port_name[ 1 ],
-     Internal_port_area,
-     External_port_area,
-     sizeof( Internal_port_area ),
-     &Junk_id
-  );
-  fatal_directive_status(
-    status,
-    RTEMS_TOO_MANY,
-    "rtems_port_create of too many"
-  );
-  puts( "TA1 - rtems_port_create - RTEMS_TOO_MANY" );
-
-  status = rtems_port_delete( 0 );
-  fatal_directive_status(
-    status,
-    RTEMS_INVALID_ID,
-    "rtems_port_delete with illegal id"
-  );
-  puts( "TA1 - rtems_port_delete - RTEMS_INVALID_ID" );
-
-  status = rtems_port_ident( 0, &Junk_id );
-  fatal_directive_status(
-    status,
-    RTEMS_INVALID_NAME,
-    "rtems_port_ident with illegal name"
-  );
-  puts( "TA1 - rtems_port_ident - RTEMS_INVALID_NAME" );
-
-  status = rtems_port_external_to_internal(
-    100,
-    Internal_port_area,
-    &converted
-  );
-  fatal_directive_status(
-    status,
-    RTEMS_INVALID_ID,
-    "rtems_port_external_to_internal with illegal id"
-  );
-
-  status = rtems_port_external_to_internal(
-    100,
-    Internal_port_area,
-    NULL
-  );
-  fatal_directive_status(
-    status,
-    RTEMS_INVALID_ADDRESS,
-    "rtems_port_external_to_internal with NULL param"
-  );
-  puts( "TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ADDRESS" );
-
-  status = rtems_port_internal_to_external(
-    100,
-    Internal_port_area,
-    &converted
-  );
-  fatal_directive_status(
-    status,
-    RTEMS_INVALID_ID,
-    "rtems_port_internal_to_external with illegal id"
-  );
-  puts( "TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ID" );
-
-  status = rtems_port_internal_to_external(
-    100,
-    Internal_port_area,
-    NULL
-  );
-  fatal_directive_status(
-    status,
-    RTEMS_INVALID_ADDRESS,
-    "rtems_port_internal_to_external with NULL param"
-  );
-  puts( "TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ADDRESS" );
-}
diff --git a/testsuites/sptests/sp09/sp09.scn b/testsuites/sptests/sp09/sp09.scn
index a7d6615..5807ebe 100644
--- a/testsuites/sptests/sp09/sp09.scn
+++ b/testsuites/sptests/sp09/sp09.scn
@@ -175,14 +175,4 @@ TA1 - rtems_message_queue_delete - delete Q 1 - RTEMS_SUCCESSFUL
 TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL
 TA3 - rtems_message_queue_receive - woke up with RTEMS_OBJECT_WAS_DELETED
 TA3 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL
-<pause - screen 9>
-TA1 - rtems_port_create - RTEMS_INVALID_NAME
-TA1 - rtems_port_create - bad range - RTEMS_INVALID_ADDRESS
-TA1 - rtems_port_create - null id - RTEMS_INVALID_ADDRESS
-TA1 - rtems_port_create - RTEMS_TOO_MANY
-TA1 - rtems_port_delete - RTEMS_INVALID_ID
-TA1 - rtems_port_ident - RTEMS_INVALID_NAME
-TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ADDRESS
-TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ID
-TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ADDRESS
 *** END OF TEST 9 ***
diff --git a/testsuites/sptests/sp09/system.h b/testsuites/sptests/sp09/system.h
index 2e1b4df..92d66fd 100644
--- a/testsuites/sptests/sp09/system.h
+++ b/testsuites/sptests/sp09/system.h
@@ -61,8 +61,6 @@ void Screen7( void );
 
 void Screen8( void );
 
-void Screen9( void );
-
 /* configuration information */
 
 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
diff --git a/testsuites/sptests/sp09/task1.c b/testsuites/sptests/sp09/task1.c
index 1e8bf6f..6ebb5c1 100644
--- a/testsuites/sptests/sp09/task1.c
+++ b/testsuites/sptests/sp09/task1.c
@@ -47,9 +47,6 @@ rtems_task Task_1(
   rtems_test_pause_and_screen_number( 8 );
 
   Screen8();
-  rtems_test_pause_and_screen_number( 9 );
-
-  Screen9();
   
   puts( "*** END OF TEST 9 ***" );
   rtems_test_exit( 0 );
diff --git a/testsuites/sptests/spport_err01/Makefile.am b/testsuites/sptests/spport_err01/Makefile.am
new file mode 100644
index 0000000..8617a4b
--- /dev/null
+++ b/testsuites/sptests/spport_err01/Makefile.am
@@ -0,0 +1,22 @@
+
+rtems_tests_PROGRAMS = spport_err01
+spport_err01_SOURCES = init.c system.h
+
+dist_rtems_tests_DATA = spport_err01.scn
+dist_rtems_tests_DATA += spport_err01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(spport_err01_OBJECTS)
+LINK_LIBS = $(spport_err01_LDLIBS)
+
+spport_err01$(EXEEXT): $(spport_err01_OBJECTS) $(spport_err01_DEPENDENCIES)
+	@rm -f spport_err01$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/spport_err01/init.c b/testsuites/sptests/spport_err01/init.c
new file mode 100644
index 0000000..baab6c6
--- /dev/null
+++ b/testsuites/sptests/spport_err01/init.c
@@ -0,0 +1,150 @@
+/*
+ *  COPYRIGHT (c) 2014.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define CONFIGURE_INIT
+#include "system.h"
+
+rtems_task Init(
+  rtems_task_argument argument
+)
+{
+  void              *converted;
+  rtems_status_code status;
+  
+  puts( "\n\n*** TEST PORT ERROR 01 ***" );
+  Port_name[ 1 ]       =  rtems_build_name( 'D', 'P', '1', ' ' );
+  status = rtems_port_create(
+     0,
+     Internal_port_area,
+     External_port_area,
+     sizeof( Internal_port_area ),
+     &Junk_id
+  );
+  fatal_directive_status(
+    status,
+    RTEMS_INVALID_NAME,
+    "rtems_port_create with illegal name"
+  );
+  puts( "TA1 - rtems_port_create - RTEMS_INVALID_NAME" );
+
+#if defined(_C3x) || defined(_C4x)
+  puts( "TA1 - rtems_port_create - RTEMS_INVALID_ADDRESS - SKIPPED" );
+#else
+  status = rtems_port_create(
+     Port_name[ 1 ],
+     &((char *)Internal_port_area)[ 1 ],
+     External_port_area,
+     sizeof( Internal_port_area ),
+     &Junk_id
+  );
+  fatal_directive_status(
+    status,
+    RTEMS_INVALID_ADDRESS,
+    "rtems_port_create with illegal address"
+  );
+  puts( "TA1 - rtems_port_create - bad range - RTEMS_INVALID_ADDRESS" );
+#endif
+
+  status = rtems_port_create(
+     Port_name[ 1 ],
+     Internal_port_area,
+     External_port_area,
+     sizeof( Internal_port_area ),
+     NULL
+  );
+  fatal_directive_status(
+    status,
+    RTEMS_INVALID_ADDRESS,
+    "rtems_port_create null Id"
+  );
+  puts( "TA1 - rtems_port_create - null id - RTEMS_INVALID_ADDRESS" );
+
+  status = rtems_port_create(
+     Port_name[ 1 ],
+     Internal_port_area,
+     External_port_area,
+     sizeof( Internal_port_area ),
+     &Junk_id
+  );
+  fatal_directive_status(
+    status,
+    RTEMS_TOO_MANY,
+    "rtems_port_create of too many"
+  );
+  puts( "TA1 - rtems_port_create - RTEMS_TOO_MANY" );
+
+  status = rtems_port_delete( 0 );
+  fatal_directive_status(
+    status,
+    RTEMS_INVALID_ID,
+    "rtems_port_delete with illegal id"
+  );
+  puts( "TA1 - rtems_port_delete - RTEMS_INVALID_ID" );
+
+  status = rtems_port_ident( 0, &Junk_id );
+  fatal_directive_status(
+    status,
+    RTEMS_INVALID_NAME,
+    "rtems_port_ident with illegal name"
+  );
+  puts( "TA1 - rtems_port_ident - RTEMS_INVALID_NAME" );
+
+  status = rtems_port_external_to_internal(
+    100,
+    Internal_port_area,
+    &converted
+  );
+  fatal_directive_status(
+    status,
+    RTEMS_INVALID_ID,
+    "rtems_port_external_to_internal with illegal id"
+  );
+
+  status = rtems_port_external_to_internal(
+    100,
+    Internal_port_area,
+    NULL
+  );
+  fatal_directive_status(
+    status,
+    RTEMS_INVALID_ADDRESS,
+    "rtems_port_external_to_internal with NULL param"
+  );
+  puts( "TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ADDRESS" );
+
+  status = rtems_port_internal_to_external(
+    100,
+    Internal_port_area,
+    &converted
+  );
+  fatal_directive_status(
+    status,
+    RTEMS_INVALID_ID,
+    "rtems_port_internal_to_external with illegal id"
+  );
+  puts( "TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ID" );
+
+  status = rtems_port_internal_to_external(
+    100,
+    Internal_port_area,
+    NULL
+  );
+  fatal_directive_status(
+    status,
+    RTEMS_INVALID_ADDRESS,
+    "rtems_port_internal_to_external with NULL param"
+  );
+  puts( "TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ADDRESS" );
+ 
+ puts( "*** END TEST PORT ERROR 01 ***" );
+}
diff --git a/testsuites/sptests/spport_err01/spport_err01.doc b/testsuites/sptests/spport_err01/spport_err01.doc
new file mode 100644
index 0000000..8dec606
--- /dev/null
+++ b/testsuites/sptests/spport_err01/spport_err01.doc
@@ -0,0 +1,25 @@
+#  COPYRIGHT (c) 1989-2014.
+#  On-Line Applications Research Corporation (OAR).
+#
+#  The license and distribution terms for this file may be
+#  found in the file LICENSE in this distribution or at
+#  http://www.rtems.com/license/LICENSE.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name:  spport_err01
+
+directives:
+  p_create, p_delete, p_ident, p_extoin
+
+concepts:
+
+  a.  Verifies all error codes returned by the executive in single
+      processor configurations.
+
+  b.  Verifies error conditions in the following kernel routines or macros:
+        _Ck_date_time, _Expired, _Q_submit, _Get_mnodes, _Get_node,
+        _Free_mem, _Get_mem, _Valid_block, _Set_tcb, _Set_resource,
+        _In_range, _On_boundary
diff --git a/testsuites/sptests/spport_err01/spport_err01.scn b/testsuites/sptests/spport_err01/spport_err01.scn
new file mode 100644
index 0000000..6c0499a
--- /dev/null
+++ b/testsuites/sptests/spport_err01/spport_err01.scn
@@ -0,0 +1,11 @@
+*** TEST PORT ERROR 01 ***
+TA1 - rtems_port_create - RTEMS_INVALID_NAME
+TA1 - rtems_port_create - bad range - RTEMS_INVALID_ADDRESS
+TA1 - rtems_port_create - null id - RTEMS_INVALID_ADDRESS
+TA1 - rtems_port_create - RTEMS_TOO_MANY
+TA1 - rtems_port_delete - RTEMS_INVALID_ID
+TA1 - rtems_port_ident - RTEMS_INVALID_NAME
+TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ADDRESS
+TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ID
+TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ADDRESS
+*** END TEST PORT ERROR 01 ***
diff --git a/testsuites/sptests/spport_err01/system.h b/testsuites/sptests/spport_err01/system.h
new file mode 100644
index 0000000..76426b2
--- /dev/null
+++ b/testsuites/sptests/spport_err01/system.h
@@ -0,0 +1,64 @@
+/*
+ *  This include file contains information that is included in every
+ *  function in the test set.
+ */
+
+/*
+ *  COPYRIGHT (c) 1989-2014.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ */
+
+#include <tmacros.h>
+
+/* functions */
+
+rtems_task Init(
+  rtems_task_argument argument
+);
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS              10
+#define CONFIGURE_MAXIMUM_TIMERS              1
+#define CONFIGURE_MAXIMUM_SEMAPHORES          2
+#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES      1
+#define CONFIGURE_MAXIMUM_PERIODS             1
+#define CONFIGURE_MAXIMUM_USER_EXTENSIONS     0
+#define CONFIGURE_TICKS_PER_TIMESLICE       100
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_EXTRA_TASK_STACKS         (20 * RTEMS_MINIMUM_STACK_SIZE)
+
+#include <rtems/confdefs.h>
+
+/* global variables */
+
+TEST_EXTERN rtems_id   Task_id[ 11 ];       /* array of task ids */
+TEST_EXTERN rtems_name Task_name[ 11 ];     /* array of task names */
+
+TEST_EXTERN rtems_name Semaphore_name[ 4 ]; /* array of semaphore names */
+TEST_EXTERN rtems_id   Semaphore_id[ 4 ];   /* array of semaphore ids */
+
+TEST_EXTERN rtems_name Queue_name[ 3 ];     /* array of queue names */
+TEST_EXTERN rtems_id   Queue_id[ 3 ];       /* array of queue ids */
+
+TEST_EXTERN rtems_name Port_name[ 2 ];      /* array of port names */
+TEST_EXTERN rtems_id   Port_id[ 2 ];        /* array of port ids */
+
+TEST_EXTERN rtems_name Period_name[ 2 ];    /* array of period names */
+TEST_EXTERN rtems_id   Period_id[ 2 ];      /* array of period ids */
+
+TEST_EXTERN rtems_id   Junk_id;             /* id used to return errors */
+
+#define Internal_port_area (void *) 0x00001000
+#define External_port_area (void *) 0x00002000
+
+/* end of include file */
-- 
1.8.1.4




More information about the devel mailing list