summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-13 17:09:14 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-13 17:09:14 +0000
commit4f7b4a88365ac991054affcc86aba178d3c86b16 (patch)
tree53af735f8615013c0932e4dbac388cc7a881a5a3 /testsuites
parent2009-05-13 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-4f7b4a88365ac991054affcc86aba178d3c86b16.tar.bz2
2009-05-13 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, configure.ac: New test to exercise rtems_workspace_XXX methods. * spwkspace/.cvsignore, spwkspace/Makefile.am, spwkspace/init.c, spwkspace/spwkspace.scn, spwkspace/system.h: New files.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/sptests/ChangeLog7
-rw-r--r--testsuites/sptests/Makefile.am5
-rw-r--r--testsuites/sptests/configure.ac1
-rw-r--r--testsuites/sptests/spwkspace/.cvsignore2
-rw-r--r--testsuites/sptests/spwkspace/Makefile.am27
-rw-r--r--testsuites/sptests/spwkspace/init.c63
-rw-r--r--testsuites/sptests/spwkspace/spwkspace.scn10
-rw-r--r--testsuites/sptests/spwkspace/system.h31
8 files changed, 144 insertions, 2 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index b06e2cc3a5..682fd29aa7 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,3 +1,10 @@
+2009-05-13 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * Makefile.am, configure.ac: New test to exercise rtems_workspace_XXX
+ methods.
+ * spwkspace/.cvsignore, spwkspace/Makefile.am, spwkspace/init.c,
+ spwkspace/spwkspace.scn, spwkspace/system.h: New files.
+
2009-05-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* sp04/system.h, sp04/task1.c, sp04/tswitch.c, sp07/init.c,
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index cc32a3ec65..c01b6d21d7 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -9,8 +9,9 @@ SUBDIRS = sp01 sp02 sp03 sp04 sp05 sp06 sp07 sp08 sp09 sp11 sp12 sp13 sp14 \
sp15 sp16 sp17 sp19 sp20 sp21 sp22 sp23 sp24 sp25 sp26 sp27 sp28 sp29 \
sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 sp40 sp41 sp42 sp43 sp44 \
sp45 sp46 sp47 sp48 spsize spwatchdog spfatal01 spfatal02 spfatal03 \
- spfatal04 spfatal05 spfatal06 spfatal07 spfatal08 spfatal09 spobjgetnext
-
+ spfatal04 spfatal05 spfatal06 spfatal07 spfatal08 spfatal09 spobjgetnext \
+ spwkspace
+
DIST_SUBDIRS = $(SUBDIRS) spfatal spfatal_support
EXTRA_DIST = spfatal_support/init.c spfatal_support/system.h
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index b13885d10d..9e24f8b2bc 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -86,5 +86,6 @@ spfatal07/Makefile
spfatal08/Makefile
spfatal09/Makefile
spobjgetnext/Makefile
+spwkspace/Makefile
])
AC_OUTPUT
diff --git a/testsuites/sptests/spwkspace/.cvsignore b/testsuites/sptests/spwkspace/.cvsignore
new file mode 100644
index 0000000000..282522db03
--- /dev/null
+++ b/testsuites/sptests/spwkspace/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/testsuites/sptests/spwkspace/Makefile.am b/testsuites/sptests/spwkspace/Makefile.am
new file mode 100644
index 0000000000..50ab079cd6
--- /dev/null
+++ b/testsuites/sptests/spwkspace/Makefile.am
@@ -0,0 +1,27 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = spwkspace
+spwkspace_SOURCES = init.c system.h
+
+dist_rtems_tests_DATA = spwkspace.scn
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+spwkspace_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(spwkspace_OBJECTS) $(spwkspace_LDADD)
+LINK_LIBS = $(spwkspace_LDLIBS)
+
+spwkspace$(EXEEXT): $(spwkspace_OBJECTS) $(spwkspace_DEPENDENCIES)
+ @rm -f spwkspace$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/spwkspace/init.c b/testsuites/sptests/spwkspace/init.c
new file mode 100644
index 0000000000..0c4028b727
--- /dev/null
+++ b/testsuites/sptests/spwkspace/init.c
@@ -0,0 +1,63 @@
+/*
+ * Exercise SuperCore Object Get Next
+ *
+ * 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.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#define CONFIGURE_INIT
+#include "system.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ void *p1;
+ bool retbool;
+ Heap_Information_block info;
+
+ puts( "\n\n*** TEST WORKSPACE CLASSIC API ***" );
+
+ puts( "rtems_workspace_get_information - null pointer" );
+ retbool = rtems_workspace_get_information( NULL );
+ assert( retbool == false );
+
+ puts( "rtems_workspace_get_information - OK" );
+ retbool = rtems_workspace_get_information( &info );
+ assert( retbool == true );
+
+ puts( "rtems_workspace_allocate - null pointer" );
+ retbool = rtems_workspace_allocate( 42, NULL );
+ assert( retbool == false );
+
+ puts( "rtems_workspace_allocate - 0 bytes" );
+ retbool = rtems_workspace_allocate( 0, &p1 );
+ assert( retbool == false );
+
+ puts( "rtems_workspace_allocate - too many bytes" );
+ retbool = rtems_workspace_allocate( info.Free.largest * 2, &p1 );
+ assert( retbool == false );
+
+ puts( "rtems_workspace_allocate - 42 bytes" );
+ retbool = rtems_workspace_allocate( 42, &p1 );
+ assert( retbool == true );
+ assert( p1 != NULL );
+
+ puts( "rtems_workspace_free - NULL" );
+ retbool = rtems_workspace_free( NULL );
+ assert( retbool == false );
+
+ puts( "rtems_workspace_free - previous pointer to 42 bytes" );
+ retbool = rtems_workspace_free( p1 );
+ assert( retbool == true );
+
+
+ puts( "*** END OF TEST WORKSPACE CLASSIC API ***" );
+ rtems_test_exit( 0 );
+}
diff --git a/testsuites/sptests/spwkspace/spwkspace.scn b/testsuites/sptests/spwkspace/spwkspace.scn
new file mode 100644
index 0000000000..0fe8088abf
--- /dev/null
+++ b/testsuites/sptests/spwkspace/spwkspace.scn
@@ -0,0 +1,10 @@
+*** TEST WORKSPACE CLASSIC API ***
+rtems_workspace_get_information - null pointer
+rtems_workspace_get_information - OK
+rtems_workspace_allocate - null pointer
+rtems_workspace_allocate - 0 bytes
+rtems_workspace_allocate - too many bytes
+rtems_workspace_allocate - 42 bytes
+rtems_workspace_free - NULL
+rtems_workspace_free - previous pointer to 42 bytes
+*** END OF TEST WORKSPACE CLASSIC API ***
diff --git a/testsuites/sptests/spwkspace/system.h b/testsuites/sptests/spwkspace/system.h
new file mode 100644
index 0000000000..e595c3d9dd
--- /dev/null
+++ b/testsuites/sptests/spwkspace/system.h
@@ -0,0 +1,31 @@
+/*
+ * 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.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+
+/* functions */
+
+rtems_task Init(
+ rtems_task_argument argument
+);
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+
+#include <rtems/confdefs.h>
+
+/* end of include file */