-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtests.html
108 lines (97 loc) · 2.61 KB
/
tests.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!doctype html>
<html>
<!--
HTML for a simple Marstime web application
CL 2011-04-11
-->
<head>
<meta charset="UTF-8">
<title>Marstime Example</title>
<script type="text/javascript" src="marstime.min.js"></script>
<script type="text/javascript" src="tests.js"></script>
<link href="marstime.css" rel='stylesheet' type='text/css'>
<style>
li.true { color: green;}
li.false { color:red;}
li.nofunction { color:blue;}
</style>
<meta name="HandheldFriendly" content="true" />
<meta name="viewport" content="width=device-width, height=device-height" />
<script type="text/javascript">
function print(text){
if (document.getElementById) {
document.getElementById('writeHere').innerHTML = text; }
else if (document.layers) {
document.layers.writeHere.document.write(text);
document.layers.writeHere.document.close(); }
}
function test(name){
try{
var value = eval("test_"+name+"();");
var text="Failed";
if(value) {text="Passed";}
return "<li class='"+value.toString()+"'>"+name+" : "+text+"</li>\n";
}
catch(error){
return "<li class='nofunction'>"+name+" : No Function</li>\n";
}
}
function run_tests()
{
var result="";
result+="<h1>Testing</h1>";
result+= "<ol>";
result+=test("should_pass");
result+=test("should_fail");
result+=test("west_to_east");
result+=test("east_to_west");
result+=test("j2000_epoch");
result+=test("julian");
result+=test("utc_to_tt_offset");
result+=test("julian_tt");
result+=test("j2000_offset_tt");
result+=test("Mars_Mean_Anomaly");
result+=test("FMS_Angle");
result+=test("alpha_perturbs");
result+=test("equation_of_center");
result+=test("Mars_Ls");
result+=test("equation_of_time");
result+=test("j2000_from_Mars_Solar_Date");
result+=test("j2000_ott_from_Mars_Solar_Date");
result+=test("Clancy_Year");
result+=test("Mars24_Year");
result+=test("Coordinated_Mars_Time");
result+=test("Local_Mean_Solar_Time");
result+=test("Local_True_Solar_Time");
result+=test("subsolar_longitude");
result+=test("solar_declination");
result+=test("heliocentric_distance");
result+=test("heliocentric_longitude");
result+=test("heliocentric_latitude");
result+=test("hourangle");
result+=test("solar_zenith");
result+=test("solar_zenith_and_elevation");
result+=test("solar_azimuth");
result+=test("on_mills");
result+=test("midnight_crossing");
result+=test("spirit_landing");
result+= "</ol>";
print(result);
// print(5-2+3);
}
window.onload=run_tests;
</script>
</head>
<body>
<div id="writeHere">
</div>
<h1>Test A</h1>
<script type="text/javascript">
TestA();
</script>
<h1>Test B</h1>
<script type="text/javascript">
TestB();
</script>
</body>
</html>