1 # Note this test is written in a bit of an odd way. In systemtap 2.2
2 # and above, ctime will raise an error. For systemtap versions before
3 # 2.2, ctime returned one of three error strings. Map those error
4 # strings to one error.
18 println(ctime(100000000))
19 println(ctime(1234567890))
20 println(ctime(1073741824))
21 println(ctime(0x50000000))
23 // some time really long ago
27 secsperhour = secspermin * minsperhour
28 secsperday = secsperhour * hoursperday
30 time = -1 * (epoch_year - 1000) * 365 * secsperday
33 if (result == "far far in the future..."
34 || result == "a long, long time ago..."
35 || result == "<invalid time>")
36 println("conversion error")
40 println("conversion error")
42 // some time in the far future
43 time = (9999 - epoch_year) * 365 * secsperday
46 if (result == "far far in the future..."
47 || result == "a long, long time ago..."
48 || result == "<invalid time>")
49 println("conversion error")
53 println("conversion error")
60 // over the edge, a long, long time ago...
64 if (result == "far far in the future..."
65 || result == "a long, long time ago..."
66 || result == "<invalid time>")
67 println("conversion error")
71 println("conversion error")
78 // over the edge, far far in the future...
82 if (result == "far far in the future..."
83 || result == "a long, long time ago..."
84 || result == "<invalid time>")
85 println("conversion error")
89 println("conversion error")
94 result = ctime(-9223372036854775808)
95 if (result == "far far in the future..."
96 || result == "a long, long time ago..."
97 || result == "<invalid time>")
98 println("conversion error")
102 println("conversion error")
107 result = ctime(9223372036854775807)
108 if (result == "far far in the future..."
109 || result == "a long, long time ago..."
110 || result == "<invalid time>")
111 println("conversion error")
115 println("conversion error")