summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-05-29 16:06:47 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-05-29 16:06:47 +0000
commit0252200299d1e00a6664c1661939d418dd54cb53 (patch)
tree125f458eccad867838db1295551ef60b91d6780e /c
parentAdded default POSIX API configuration table. (diff)
downloadrtems-0252200299d1e00a6664c1661939d418dd54cb53.tar.bz2
Gutted test of rtems api calls and added comments to indicate what the test
should do in their place. It now compiles and links.
Diffstat (limited to 'c')
-rw-r--r--c/src/tests/psxtests/psx01/init.c60
-rw-r--r--c/src/tests/psxtests/psx01/system.h21
-rw-r--r--c/src/tests/psxtests/psx01/task.c27
3 files changed, 31 insertions, 77 deletions
diff --git a/c/src/tests/psxtests/psx01/init.c b/c/src/tests/psxtests/psx01/init.c
index 894cc3e890..5605f9fff0 100644
--- a/c/src/tests/psxtests/psx01/init.c
+++ b/c/src/tests/psxtests/psx01/init.c
@@ -22,65 +22,21 @@
* $Id$
*/
-#define TEST_INIT
+#define CONFIGURE_INIT
#include "system.h"
-rtems_task Init(
- rtems_task_argument argument
+void Init(
+ void *argument
)
{
- rtems_time_of_day time;
- rtems_status_code status;
- puts( "\n\n*** TEST 1 ***" );
+ puts( "\n\n*** POSIX TEST 1 ***" );
- build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
- status = rtems_clock_set( &time );
- directive_failed( status, "rtems_clock_set" );
+ /* set the time of day */
- Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
- Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
- Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
+ /* create the three tasks */
- status = rtems_task_create(
- Task_name[ 1 ],
- 1,
- RTEMS_MINIMUM_STACK_SIZE,
- RTEMS_INTERRUPT_LEVEL(31),
- RTEMS_DEFAULT_ATTRIBUTES,
- &Task_id[ 1 ]
- );
- directive_failed( status, "rtems_task_create of TA1" );
+ /* exit */
- status = rtems_task_create(
- Task_name[ 2 ],
- 1,
- RTEMS_MINIMUM_STACK_SIZE * 2,
- RTEMS_DEFAULT_MODES,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Task_id[ 2 ]
- );
- directive_failed( status, "rtems_task_create of TA2" );
-
- status = rtems_task_create(
- Task_name[ 3 ],
- 1,
- RTEMS_MINIMUM_STACK_SIZE * 3,
- RTEMS_DEFAULT_MODES,
- RTEMS_DEFAULT_ATTRIBUTES,
- &Task_id[ 3 ]
- );
- directive_failed( status, "rtems_task_create of TA3" );
-
- status = rtems_task_start( Task_id[ 1 ], Task_1_through_3, 0 );
- directive_failed( status, "rtems_task_start of TA1" );
-
- status = rtems_task_start( Task_id[ 2 ], Task_1_through_3, 0 );
- directive_failed( status, "rtems_task_start of TA2" );
-
- status = rtems_task_start( Task_id[ 3 ], Task_1_through_3, 0 );
- directive_failed( status, "rtems_task_start of TA3" );
-
- status = rtems_task_delete( RTEMS_SELF );
- directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+ pthread_exit( NULL );
}
diff --git a/c/src/tests/psxtests/psx01/system.h b/c/src/tests/psxtests/psx01/system.h
index 08e71c4bb8..75433a7ee7 100644
--- a/c/src/tests/psxtests/psx01/system.h
+++ b/c/src/tests/psxtests/psx01/system.h
@@ -14,16 +14,18 @@
* $Id$
*/
-#include <tmacros.h>
-
/* functions */
-rtems_task Init(
- rtems_task_argument argument
+#include <bsp.h>
+#include <pthread.h>
+#include <stdio.h>
+
+void Init(
+ void *argument
);
-rtems_task Task_1_through_3(
- rtems_task_argument argument
+void Task_1_through_3(
+ void *argument
);
/* configuration information */
@@ -33,11 +35,12 @@ rtems_task Task_1_through_3(
#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
+#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
+#define CONFIGURE_INIT_TASK_TABLE NULL
+
#include <confdefs.h>
/* global variables */
-TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
-TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
-
/* end of include file */
diff --git a/c/src/tests/psxtests/psx01/task.c b/c/src/tests/psxtests/psx01/task.c
index b45d3abce6..f6f365ab51 100644
--- a/c/src/tests/psxtests/psx01/task.c
+++ b/c/src/tests/psxtests/psx01/task.c
@@ -21,30 +21,25 @@
#include "system.h"
-rtems_task Task_1_through_3(
- rtems_task_argument argument
+void Task_1_through_3(
+ void *argument
)
{
- rtems_id tid;
- rtems_time_of_day time;
- rtems_status_code status;
+ int seconds;
- status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
- directive_failed( status, "rtems_task_ident" );
+ for ( ; ; ) {
+ /* grab the tod */
- while( FOREVER ) {
- status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
- directive_failed( status, "rtems_clock_get" );
+ /* if we have run longer 35 seconds exit */
- if ( time.second >= 35 ) {
- puts( "*** END OF TEST 1 ***" );
+ if ( seconds >= 35 ) {
+ puts( "*** END OF POSIX TEST 1 ***" );
exit( 0 );
}
- put_name( Task_name[ task_number( tid ) ], FALSE );
- print_time( " - rtems_clock_get - ", &time, "\n" );
+ /* put our task number and the current time */
- status = rtems_task_wake_after( task_number( tid ) * 5 * TICKS_PER_SECOND );
- directive_failed( status, "rtems_task_wake_after" );
+ /* delay based on our thread number */
+
}
}