diff options
author | WeiY <wei.a.yang@gmail.com> | 2013-08-01 21:49:49 +0800 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-01 16:48:25 +0200 |
commit | 693088951db029f92eb02f0f8a49fc9576ca0fab (patch) | |
tree | 53f7cd00fcf185668bb42137e760a13e49d67560 /testsuites/sptests/spatomic01 | |
parent | score: Use an ISR lock for TOD (diff) | |
download | rtems-693088951db029f92eb02f0f8a49fc9576ca0fab.tar.bz2 |
clean up spatomic testcase
Diffstat (limited to 'testsuites/sptests/spatomic01')
-rw-r--r-- | testsuites/sptests/spatomic01/Makefile.am | 24 | ||||
-rw-r--r-- | testsuites/sptests/spatomic01/init.c | 63 | ||||
-rw-r--r-- | testsuites/sptests/spatomic01/spatomic01.doc | 23 | ||||
-rw-r--r-- | testsuites/sptests/spatomic01/spatomic01.scn | 70 | ||||
-rw-r--r-- | testsuites/sptests/spatomic01/system.h | 51 | ||||
-rw-r--r-- | testsuites/sptests/spatomic01/tasks.c | 93 |
6 files changed, 0 insertions, 324 deletions
diff --git a/testsuites/sptests/spatomic01/Makefile.am b/testsuites/sptests/spatomic01/Makefile.am deleted file mode 100644 index 3bf1e11009..0000000000 --- a/testsuites/sptests/spatomic01/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -if ATOMIC -rtems_tests_PROGRAMS = spatomic01 -spatomic01_SOURCES = init.c tasks.c system.h - -dist_rtems_tests_DATA = spatomic01.scn -dist_rtems_tests_DATA += spatomic01.doc -endif - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../automake/compile.am -include $(top_srcdir)/../automake/leaf.am - -if ATOMIC -AM_CPPFLAGS += -I$(top_srcdir)/../support/include - -LINK_OBJS = $(spatomic01_OBJECTS) -LINK_LIBS = $(spatomic01_LDLIBS) - -spatomic01$(EXEEXT): $(spatomic01_OBJECTS) $(spatomic01_DEPENDENCIES) - @rm -f spatomic01$(EXEEXT) - $(make-exe) -endif - -include $(top_srcdir)/../automake/local.am diff --git a/testsuites/sptests/spatomic01/init.c b/testsuites/sptests/spatomic01/init.c deleted file mode 100644 index 7326bf7c95..0000000000 --- a/testsuites/sptests/spatomic01/init.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2012 Deng Hengyi. - * - * This test case is to test atomic load operation. - * - * 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 -) -{ - int i; - char ch; - rtems_id id; - rtems_status_code status; - - /* Put start of test message */ - puts( "\n\n*** spatomic01 TEST ***\n" ); - - /* Create and start tasks to test */ - for ( i=0; i< TASK_NUMS ; i++ ) { - ch = '0' + i; - - status = rtems_task_create( - rtems_build_name( 'T', 'A', ch, ' ' ), - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "task create" ); - - status = rtems_task_start( id, Test_task, i ); - directive_failed( status, "task start" ); - } - - status = rtems_task_create( - rtems_build_name( 'A', 'T', '0', ' ' ), - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "task create" ); - - status = rtems_task_start( id, Wait_task, 0 ); - directive_failed( status, "task start" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "delete" ); -} diff --git a/testsuites/sptests/spatomic01/spatomic01.doc b/testsuites/sptests/spatomic01/spatomic01.doc deleted file mode 100644 index dc322a3f55..0000000000 --- a/testsuites/sptests/spatomic01/spatomic01.doc +++ /dev/null @@ -1,23 +0,0 @@ -# COPYRIGHT (c) 1989-2012. -# 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: spatomic01 - -directives: - - _Atomic_Load_int - _Atomic_Load_long - _Atomic_Load_ptr - _Atomic_Load_32 - _Atomic_Load_64 - -concepts: - -+ Ensure that the atomic load operations listed above behave as defined. diff --git a/testsuites/sptests/spatomic01/spatomic01.scn b/testsuites/sptests/spatomic01/spatomic01.scn deleted file mode 100644 index 9979d8033c..0000000000 --- a/testsuites/sptests/spatomic01/spatomic01.scn +++ /dev/null @@ -1,70 +0,0 @@ -*** spatomic01 TEST *** - - -task0: _Atomic_Load_int: SUCCESS - -task0: _Atomic_Load_long: SUCCESS - -task0: _Atomic_Load_ptr: SUCCESS - -task0: _Atomic_Load_32: SUCCESS - -task0: _Atomic_Load_int: SUCCESS - -task0: _Atomic_Load_long: SUCCESS - -task0: _Atomic_Load_ptr: SUCCESS - -task0: _Atomic_Load_32: SUCCESS - -task1: _Atomic_Load_int: SUCCESS - -task1: _Atomic_Load_long: SUCCESS - -task1: _Atomic_Load_ptr: SUCCESS - -task1: _Atomic_Load_32: SUCCESS - -task1: _Atomic_Load_int: SUCCESS - -task1: _Atomic_Load_long: SUCCESS - -task1: _Atomic_Load_ptr: SUCCESS - -task1: _Atomic_Load_32: SUCCESS - -task2: _Atomic_Load_int: SUCCESS - -task2: _Atomic_Load_long: SUCCESS - -task2: _Atomic_Load_ptr: SUCCESS - -task2: _Atomic_Load_32: SUCCESS - -task2: _Atomic_Load_int: SUCCESS - -task2: _Atomic_Load_long: SUCCESS - -task2: _Atomic_Load_ptr: SUCCESS - -task2: _Atomic_Load_32: SUCCESS - -task3: _Atomic_Load_int: SUCCESS - -task3: _Atomic_Load_long: SUCCESS - -task3: _Atomic_Load_ptr: SUCCESS - -task3: _Atomic_Load_32: SUCCESS - -task3: _Atomic_Load_int: SUCCESS - -task3: _Atomic_Load_long: SUCCESS - -task3: _Atomic_Load_ptr: SUCCESS - -task3: _Atomic_Load_32: SUCCESS - - -*** END OF TEST spatomic01 *** - diff --git a/testsuites/sptests/spatomic01/system.h b/testsuites/sptests/spatomic01/system.h deleted file mode 100644 index 55931f24c0..0000000000 --- a/testsuites/sptests/spatomic01/system.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * COPYRIGHT (c) 1989-2011. - * 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" -#include "test_support.h" - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task( - rtems_task_argument argument -); - -rtems_task Wait_task( - rtems_task_argument argument -); -/* configuration information */ -#define TASK_NUMS 4 - -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS \ - (2 + TASK_NUMS) - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include <rtems/confdefs.h> - -/* global variables */ - -/* - * Keep the names and IDs in global variables so another task can use them. - */ - -TEST_EXTERN volatile bool TaskRan[ TASK_NUMS ]; - -/* - * Handy macros and static inline functions - */ - -/* end of include file */ diff --git a/testsuites/sptests/spatomic01/tasks.c b/testsuites/sptests/spatomic01/tasks.c deleted file mode 100644 index 9392a5b612..0000000000 --- a/testsuites/sptests/spatomic01/tasks.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2012 Deng Hengyi. - * - * This test case is to test atomic load operation. - * - * 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 - -#include "system.h" - -#include <stdlib.h> -#include <rtems/rtems/atomic.h> - -#define TEST_REPEAT 1000 - -#define ATOMIC_LOAD_NO_BARRIER(NAME, TYPE, R_TYPE, task_id, mem_bar) \ -{ \ - Atomic_##TYPE t; \ - R_TYPE a; \ - R_TYPE b; \ - unsigned int i; \ - for (i = 0; i < TEST_REPEAT; i++){ \ - b = (R_TYPE)rand(); \ - atomic_init(&t, b); \ - a = _Atomic_Load_##NAME(&t, mem_bar); \ - rtems_test_assert(a == b); \ - } \ - printf("\ntask%d: Atomic_Load_" #NAME ": SUCCESS\n", (unsigned int)task_id); \ -} - -rtems_task Test_task( - rtems_task_argument argument - ) -{ - char name[5]; - char *p; - rtems_status_code status; - - /* Get the task name */ - p = rtems_object_get_name( RTEMS_SELF, 5, name ); - rtems_test_assert( p != NULL ); - - /* Print that the task is up and running. */ - /* test relaxed barrier */ - ATOMIC_LOAD_NO_BARRIER(uint, Uint, uint_fast32_t, argument, ATOMIC_ORDER_RELAXED); - - ATOMIC_LOAD_NO_BARRIER(ptr, Pointer, uintptr_t, argument, ATOMIC_ORDER_RELAXED); - - /* test acquire barrier */ - ATOMIC_LOAD_NO_BARRIER(uint, Uint, uint_fast32_t, argument, ATOMIC_ORDER_ACQUIRE); - - ATOMIC_LOAD_NO_BARRIER(ptr, Pointer, uintptr_t, argument, ATOMIC_ORDER_ACQUIRE); - - /* Set the flag that the task is up and running */ - TaskRan[argument] = true; - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "delete" ); -} - -rtems_task Wait_task( - rtems_task_argument argument - ) -{ - char name[5]; - char *p; - bool allDone; - int i; - - /* Get the task name */ - p = rtems_object_get_name( RTEMS_SELF, 5, name ); - rtems_test_assert( p != NULL ); - - /* Wait on the all tasks to run */ - while (1) { - allDone = true; - for ( i=0; i<TASK_NUMS ; i++ ) { - if (TaskRan[i] == false) - allDone = false; - } - if (allDone) { - puts( "\n\n*** END OF TEST spatomic01 ***\n" ); - rtems_test_exit( 0 ); - } - } -} |