File indexing completed on 2025-05-11 08:24:46
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #ifdef HAVE_CONFIG_H
0030 #include "config.h"
0031 #endif
0032
0033 #include <tmacros.h>
0034 #include "test_support.h"
0035
0036 const char rtems_test_name[] = "SPCLOCK_ERR 2";
0037
0038
0039 rtems_task Init(rtems_task_argument argument);
0040
0041 rtems_task Init(
0042 rtems_task_argument argument
0043 )
0044 {
0045 TEST_BEGIN();
0046
0047 rtems_time_of_day time;
0048 rtems_status_code status;
0049
0050 status = rtems_io_close( 0xffff, 0x0000, NULL);
0051 fatal_directive_status(
0052 status,
0053 RTEMS_INVALID_NUMBER,
0054 "rtems_io_close with bad major number"
0055 );
0056 puts( "TA1 - rtems_io_close - RTEMS_INVALID_NUMBER" );
0057 status = rtems_io_control( 0xffff, 0x00000, NULL);
0058 fatal_directive_status(
0059 status,
0060 RTEMS_INVALID_NUMBER,
0061 "rtems_io_close with bad major number"
0062 );
0063 puts( "TA1 - rtems_io_control - RTEMS_INVALID_NUMBER" );
0064 status = rtems_io_initialize( 0xffff, 0x00000, NULL);
0065 fatal_directive_status(
0066 status,
0067 RTEMS_INVALID_NUMBER,
0068 "rtems_io_initialize with bad major number"
0069 );
0070 puts( "TA1 - rtems_io_initialize - RTEMS_INVALID_NUMBER" );
0071 status = rtems_io_open( 0xffff, 0x00000, NULL);
0072 fatal_directive_status(
0073 status,
0074 RTEMS_INVALID_NUMBER,
0075 "rtems_io_open with bad major number"
0076 );
0077 puts( "TA1 - rtems_io_open - RTEMS_INVALID_NUMBER" );
0078 status = rtems_io_read( 0xffff, 0x00000, NULL);
0079 fatal_directive_status(
0080 status,
0081 RTEMS_INVALID_NUMBER,
0082 "rtems_io_read with bad major number"
0083 );
0084 puts( "TA1 - rtems_io_read - RTEMS_INVALID_NUMBER" );
0085 status = rtems_io_write( 0xffff, 0x0ffff, NULL);
0086 fatal_directive_status(
0087 status,
0088 RTEMS_INVALID_NUMBER,
0089 "rtems_io_write with bad major number"
0090 );
0091 puts( "TA1 - rtems_io_write - RTEMS_INVALID_NUMBER" );
0092
0093 build_time( &time, 12, 31, 2000, 23, 59, 59, 0 );
0094 status = rtems_clock_set( &time );
0095 directive_failed( status, "rtems_clock_set" );
0096 print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_SUCCESSFUL\n" );
0097 status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
0098 status = rtems_clock_get_tod( &time );
0099 directive_failed( status, "rtems_clock_set" );
0100 print_time( "TA1 - rtems_clock_get_tod - ", &time, " - RTEMS_SUCCESSFUL\n" );
0101
0102 build_time( &time, 12, 31, 1999, 23, 59, 59, 0 );
0103 status = rtems_clock_set( &time );
0104 directive_failed( status, "rtems_clock_set" );
0105 print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_SUCCESSFUL\n" );
0106 status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
0107 status = rtems_clock_get_tod( &time );
0108 directive_failed( status, "rtems_clock_get_tod" );
0109 print_time( "TA1 - rtems_clock_get_tod - ", &time, " - RTEMS_SUCCESSFUL\n" );
0110
0111 build_time( &time, 12, 31, 2099, 23, 59, 59, 0 );
0112 status = rtems_clock_set( &time );
0113 directive_failed( status, "rtems_clock_set" );
0114 print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_SUCCESSFUL\n" );
0115 status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
0116 status = rtems_clock_get_tod( &time );
0117 directive_failed( status, "rtems_clock_set" );
0118 print_time( "TA1 - rtems_clock_get_tod - ", &time, " - RTEMS_SUCCESSFUL\n" );
0119
0120 build_time( &time, 1, 1, 2100, 0, 0, 0, 0 );
0121 status = rtems_clock_set( &time );
0122 fatal_directive_status( status, RTEMS_INVALID_CLOCK, "rtems_clock_set" );
0123 print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_INVALID_CLOCK\n" );
0124 status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
0125 status = rtems_clock_get_tod( &time );
0126 directive_failed( status, "rtems_clock_set" );
0127 print_time( "TA1 - rtems_clock_get_tod - ", &time, " - RTEMS_SUCCESSFUL\n" );
0128
0129 build_time( &time, 12, 31, 1991, 23, 59, 59, 0 );
0130 status = rtems_clock_set( &time );
0131 directive_failed( status, "rtems_clock_set" );
0132 print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_SUCCESSFUL\n" );
0133 status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
0134 status = rtems_clock_get_tod( &time );
0135 directive_failed( status, "rtems_clock_set" );
0136 print_time( "TA1 - rtems_clock_get_tod - ", &time, " - RTEMS_SUCCESSFUL\n" );
0137
0138 TEST_END();
0139 rtems_test_exit( 0 );
0140 }
0141
0142 #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
0143 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
0144
0145 #define CONFIGURE_MAXIMUM_TASKS 1
0146 #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
0147
0148 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
0149
0150 #define CONFIGURE_INIT
0151
0152 #include <rtems/confdefs.h>
0153