source: rtems/c/src/tests/psxtests/psx01/task.c @ ecc912f4

4.104.114.84.95
Last change on this file since ecc912f4 was ecc912f4, checked in by Joel Sherrill <joel.sherrill@…>, on 08/07/96 at 22:05:15

added more error cases to complete testing of pthread_equal when
RTEMS_DEBUG is enabled.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*  Task_1_through_3
2 *
3 *  This routine serves as a test task.  It verifies the basic task
4 *  switching capabilities of the executive.
5 *
6 *  Input parameters:
7 *    argument - task argument
8 *
9 *  Output parameters:  NONE
10 *
11 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
12 *  On-Line Applications Research Corporation (OAR).
13 *  All rights assigned to U.S. Government, 1994.
14 *
15 *  This material may be reproduced by or for the U.S. Government pursuant
16 *  to the copyright license under the clause at DFARS 252.227-7013.  This
17 *  notice must appear in all copies of this file and its derivatives.
18 *
19 *  $Id$
20 */
21
22#include "system.h"
23
24void *Task_1_through_3(
25  void *argument
26)
27{
28  int status;
29
30  /* XXX temporary */
31
32  /* get id of this thread */
33
34  Task_id = pthread_self();
35  printf( "Task's ID is 0x%08x\n", Task_id );
36
37  status = pthread_equal( Task_id, Task_id );
38  if ( status )
39    puts( "pthread_equal match case passed" );
40  assert( status );
41
42  status = pthread_equal( Init_id, Task_id );
43  if ( !status )
44    puts( "pthread_equal different case passed" );
45  assert( !status );
46
47  puts( "pthread_equal first id bad" );
48  status = pthread_equal( -1, Task_id );
49  assert( status == 0);
50
51  puts( "pthread_equal second id bad" );
52  status = pthread_equal( Init_id, -1 );
53  assert( status == 0);
54
55  puts( "*** END OF POSIX TEST 1 ***" );
56  exit( 0 );
57
58  return NULL; /* just so the compiler thinks we returned something */
59}
Note: See TracBrowser for help on using the repository browser.