File indexing completed on 2025-05-11 08:24:35
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
0030
0031
0032
0033
0034
0035
0036 #ifdef HAVE_CONFIG_H
0037 #include "config.h"
0038 #endif
0039
0040 #define CONFIGURE_INIT
0041
0042 #include <tmacros.h>
0043 #include <time.h>
0044 #include <stdlib.h>
0045
0046 const char rtems_test_name[] = "TZTEST";
0047
0048
0049 rtems_task Init(rtems_task_argument argument);
0050 void tztester(void);
0051
0052 void tztester(void)
0053 {
0054 struct tm *tm;
0055 time_t now;
0056
0057 printf("TZ:\"%s\"\n", getenv("TZ"));
0058
0059 time(&now);
0060 tm = localtime(&now);
0061 printf ("%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d\n",
0062 1900+tm->tm_year, tm->tm_mon+1, tm->tm_mday,
0063 tm->tm_hour, tm->tm_min, tm->tm_sec);
0064
0065 tm = gmtime(&now);
0066 printf ("%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d\n",
0067 1900+tm->tm_year, tm->tm_mon+1, tm->tm_mday,
0068 tm->tm_hour, tm->tm_min, tm->tm_sec);
0069 }
0070
0071 rtems_task Init(
0072 rtems_task_argument argument
0073 )
0074 {
0075 rtems_time_of_day time;
0076 rtems_status_code status;
0077
0078 TEST_BEGIN();
0079
0080 build_time( &time, 3, 14, 2007, 15, 9, 26, 5 );
0081 status = rtems_clock_set( &time );
0082 directive_failed( status, "rtems_clock_set" );
0083
0084 setenv( "TZ", "CST6CDT,M 3.2.0,M 11.1.0", 1 );
0085
0086 tzset();
0087
0088 tztester();
0089
0090 TEST_END();
0091 exit(0);
0092 }
0093
0094
0095 #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
0096 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
0097
0098 #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
0099
0100 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
0101 #define CONFIGURE_MAXIMUM_TASKS 1
0102
0103 #include <rtems/confdefs.h>