summaryrefslogtreecommitdiffstats
path: root/c/src/tests/samples/cdtest
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/tests/samples/cdtest')
-rw-r--r--c/src/tests/samples/cdtest/.cvsignore2
-rw-r--r--c/src/tests/samples/cdtest/Makefile.am48
-rw-r--r--c/src/tests/samples/cdtest/cdtest.scn31
-rw-r--r--c/src/tests/samples/cdtest/init.c26
-rw-r--r--c/src/tests/samples/cdtest/main.cc214
-rw-r--r--c/src/tests/samples/cdtest/system.h40
6 files changed, 0 insertions, 361 deletions
diff --git a/c/src/tests/samples/cdtest/.cvsignore b/c/src/tests/samples/cdtest/.cvsignore
deleted file mode 100644
index 282522db03..0000000000
--- a/c/src/tests/samples/cdtest/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/c/src/tests/samples/cdtest/Makefile.am b/c/src/tests/samples/cdtest/Makefile.am
deleted file mode 100644
index ebe262ac92..0000000000
--- a/c/src/tests/samples/cdtest/Makefile.am
+++ /dev/null
@@ -1,48 +0,0 @@
-##
-## $Id$
-##
-
-
-SAMPLE = cdtest
-PGM = ${ARCH}/$(SAMPLE).exe
-
-MANAGERS = all
-
-C_FILES = init.c
-C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
-
-CC_FILES = main.cc
-CC_O_FILES = $(CC_FILES:%.cc=${ARCH}/%.$(OBJEXT))
-
-H_FILES = system.h
-noinst_HEADERS = $(H_FILES)
-
-DOCTYPES = scn
-DOCS = $(DOCTYPES:%=$(SAMPLE).%)
-
-SRCS = $(DOCS) $(C_FILES) $(CC_FILES) $(H_FILES)
-OBJS = $(C_O_FILES) $(CC_O_FILES)
-
-PRINT_SRCS = $(DOCS)
-
-include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
-include $(top_srcdir)/../automake/compile.am
-include $(top_srcdir)/../automake/leaf.am
-include $(top_srcdir)/sample.am
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-if HAS_CXX
-${PGM}: $(OBJS) $(LINK_FILES)
- $(make-cxx-exe)
-
-all-local: ${ARCH} $(TMPINSTALL_FILES)
-else
-all-local:
-endif
-
-EXTRA_DIST = $(C_FILES) $(CC_FILES) $(DOCS)
-
-include $(top_srcdir)/../automake/local.am
diff --git a/c/src/tests/samples/cdtest/cdtest.scn b/c/src/tests/samples/cdtest/cdtest.scn
deleted file mode 100644
index a832a72372..0000000000
--- a/c/src/tests/samples/cdtest/cdtest.scn
+++ /dev/null
@@ -1,31 +0,0 @@
-Hey I'm in base class constructor number 1 for 0x400010cc.
-Hey I'm in base class constructor number 2 for 0x400010d4.
-Hey I'm in derived class constructor number 3 for 0x400010d4.
-
-
-*** CONSTRUCTOR/DESTRUCTOR TEST ***
-Hey I'm in base class constructor number 4 for 0x4009ee08.
-Hey I'm in base class constructor number 5 for 0x4009ee10.
-Hey I'm in base class constructor number 6 for 0x4009ee18.
-Hey I'm in base class constructor number 7 for 0x4009ee20.
-Hey I'm in derived class constructor number 8 for 0x4009ee20.
-Testing a C++ I/O stream
-Hey I'm in derived class destructor number 8 for 0x4009ee20.
-Derived class - Instantiation order 8
-Hey I'm in base class destructor number 7 for 0x4009ee20.
-Instantiation order 8
-Hey I'm in base class destructor number 6 for 0x4009ee18.
-Instantiation order 6
-Hey I'm in base class destructor number 5 for 0x4009ee10.
-Instantiation order 5
-Hey I'm in base class destructor number 4 for 0x4009ee08.
-Instantiation order 5
-*** END OF CONSTRUCTOR/DESTRUCTOR TEST ***
-
-
-Hey I'm in derived class destructor number 3 for 0x400010d4.
-Derived class - Instantiation order 3
-Hey I'm in base class destructor number 2 for 0x400010d4.
-Instantiation order 3
-Hey I'm in base class destructor number 1 for 0x400010cc.
-Instantiation order 1
diff --git a/c/src/tests/samples/cdtest/init.c b/c/src/tests/samples/cdtest/init.c
deleted file mode 100644
index b2bed90f86..0000000000
--- a/c/src/tests/samples/cdtest/init.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Init
- *
- * This routine is the initialization task for this test program.
- * It is called from init_exec and has the responsibility for creating
- * and starting the tasks that make up the test. If the time of day
- * clock is required for the test, it should also be set to a known
- * value by this function.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1999.
- * 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"
-#include <stdio.h>
-#include <tmacros.h>
diff --git a/c/src/tests/samples/cdtest/main.cc b/c/src/tests/samples/cdtest/main.cc
deleted file mode 100644
index 25dd0e2a63..0000000000
--- a/c/src/tests/samples/cdtest/main.cc
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * This routine is the initialization task for this test program.
- * It is called from init_exec and has the responsibility for creating
- * and starting the tasks that make up the test. If the time of day
- * clock is required for the test, it should also be set to a known
- * value by this function.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1994 by Division Incorporated
- * Based in part on OAR works.
- *
- * 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.
- *
- *
- * by Rosimildo da Silva:
- * Modified the test a bit to indicate when an instance is
- * global or not, and added code to test C++ exception.
- *
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef RTEMS_TEST_IO_STREAM
-#include <iostream.h>
-#endif
-
-extern "C"
-{
-#include <tmacros.h>
-extern rtems_task main_task(rtems_task_argument);
-}
-
-static int num_inst = 0;
-
-class AClass {
-public:
- AClass(const char *p = "LOCAL" ) : ptr( p )
- {
- num_inst++;
- printf(
- "%s: Hey I'm in base class constructor number %d for %p.\n",
- p, num_inst, this
- );
-
- /*
- * Make sure we use some space
- */
-
- string = new char[50];
- sprintf(string, "Instantiation order %d", num_inst);
- };
-
- virtual ~AClass()
- {
- printf(
- "%s: Hey I'm in base class destructor number %d for %p.\n",
- ptr, num_inst, this
- );
- print();
- num_inst--;
- };
-
- virtual void print() { printf("%s\n", string); };
-
-protected:
- char *string;
- const char *ptr;
-};
-
-class BClass : public AClass {
-public:
- BClass(const char *p = "LOCAL" ) : AClass( p )
- {
- num_inst++;
- printf(
- "%s: Hey I'm in derived class constructor number %d for %p.\n",
- p, num_inst, this
- );
-
- /*
- * Make sure we use some space
- */
-
- string = new char[50];
- sprintf(string, "Instantiation order %d", num_inst);
- };
-
- ~BClass()
- {
- printf(
- "%s: Hey I'm in derived class destructor number %d for %p.\n",
- ptr, num_inst,
- this
- );
- print();
- num_inst--;
- };
-
- void print() { printf("Derived class - %s\n", string); }
-};
-
-
-class RtemsException
-{
-public:
-
- RtemsException( char *module, int ln, int err = 0 )
- : error( err ), line( ln ), file( module )
- {
- printf( "RtemsException raised=File:%s, Line:%d, Error=%X\n",
- file, line, error );
- }
-
- void show()
- {
- printf( "RtemsException ---> File:%s, Line:%d, Error=%X\n",
- file, line, error );
- }
-
-private:
- int error;
- int line;
- char *file;
-
-};
-
-
-
-AClass foo( "GLOBAL" );
-BClass foobar( "GLOBAL" );
-
-void
-cdtest(void)
-{
- AClass bar, blech, blah;
- BClass bleak;
-
-#ifdef RTEMS_TEST_IO_STREAM
- cout << "Testing a C++ I/O stream" << endl;
-#else
- printf("IO Stream not tested\n");
-#endif
- bar = blech;
- rtems_task_wake_after( 5 * get_ticks_per_second() );
-}
-
-//
-// main equivalent
-// It can not be called 'main' since the bsp owns that name
-// in many implementations in order to get global constructors
-// run.
-//
-
-static void foo_function()
-{
- try
- {
- throw "foo_function() throw this exception";
- }
- catch( const char *e )
- {
- printf( "foo_function() catch block called:\n < %s >\n", e );
- throw "foo_function() re-throwing execption...";
- }
-}
-
-rtems_task main_task(
- rtems_task_argument
-)
-{
- printf( "\n\n*** CONSTRUCTOR/DESTRUCTOR TEST ***\n" );
-
- cdtest();
-
- printf( "*** END OF CONSTRUCTOR/DESTRUCTOR TEST ***\n\n\n" );
-
-
- printf( "*** TESTING C++ EXCEPTIONS ***\n\n" );
-
- try
- {
- foo_function();
- }
- catch( const char *e )
- {
- printf( "Success catching a char * exception\n%s\n", e );
- }
- try
- {
- printf( "throw an instance based exception\n" );
- throw RtemsException( __FILE__, __LINE__, 0x55 );
- }
- catch( RtemsException & ex )
- {
- printf( "Success catching RtemsException...\n" );
- ex.show();
- }
- catch(...)
- {
- printf( "Caught another exception.\n" );
- }
- printf( "Exceptions are working properly.\n" );
- rtems_task_wake_after( 5 * get_ticks_per_second() );
- printf( "Global Dtors should be called after this line....\n" );
- exit(0);
-}
diff --git a/c/src/tests/samples/cdtest/system.h b/c/src/tests/samples/cdtest/system.h
deleted file mode 100644
index de883665c4..0000000000
--- a/c/src/tests/samples/cdtest/system.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* system.h
- *
- * This include file contains information that is included in every
- * function in the test set.
- *
- * COPYRIGHT (c) 1989-1999.
- * 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 <rtems.h>
-
-/* functions */
-
-rtems_task main_task(
- rtems_task_argument argument
-);
-
-/* configuration information */
-
-#include <bsp.h> /* for device driver prototypes */
-
-#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 1
-#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-#define CONFIGURE_INIT_TASK_ENTRY_POINT main_task
-#define CONFIGURE_INIT_TASK_NAME rtems_build_name( 'C', 'T', 'O', 'R' )
-
-#include <confdefs.h>
-
-/* end of include file */