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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
//
// GENERATED FILE
//
use super::*;
use f2rust_std::*;
//$Procedure F_ZZPLAT ( Test Fortran Intrinsics )
pub fn F_ZZPLAT(OK: &mut bool, ctx: &mut Context) -> f2rust_std::Result<()> {
let mut BFFID = [b' '; 8 as usize];
let mut DEQUIV: f64 = 0.0;
let mut IEQUIV = StackArray::<i32, 2>::new(1..=2);
//
// SPICELIB Functions
//
//
// Local Variables
//
//
// EQUIVALENCE statements
//
//
// Start the test family with an open call.
//
testutil::TOPEN(b"F_ZZPLAT", ctx)?;
//
// --- Case: ------------------------------------------------------
//
testutil::TCASE(b"Binary File Format Consistency Check", ctx)?;
//
// Fetch the binary file format ID string.
//
spicelib::ZZPLATFM(b"FILE_FORMAT", &mut BFFID, ctx);
//
// "Touch" IEQUIV to make sure it does not get optimized out,
// as is the case with IFORT on Linux.
//
DummyArrayMut::<i32>::from_equiv(std::slice::from_mut(&mut DEQUIV), 1..=2)[1] =
spicelib::TOUCHI(DummyArray::<i32>::from_equiv(&[DEQUIV], 1..=2)[1]);
DummyArrayMut::<i32>::from_equiv(std::slice::from_mut(&mut DEQUIV), 1..=2)[2] =
spicelib::TOUCHI(DummyArray::<i32>::from_equiv(&[DEQUIV], 1..=2)[2]);
//
// Set the test value. "Touch" it as well.
//
DEQUIV = 1.0;
DEQUIV = spicelib::TOUCHD(DEQUIV);
//
// Branch based on the value returned; check equivalenced
// integers for the appropriate values.
//
if spicelib::EQSTR(&BFFID, b"BIG-IEEE") {
testutil::CHCKSI(
b"IEQUIV(1)",
DummyArray::<i32>::from_equiv(&[DEQUIV], 1..=2)[1],
b"=",
1072693248,
0,
OK,
ctx,
)?;
testutil::CHCKSI(
b"IEQUIV(2)",
DummyArray::<i32>::from_equiv(&[DEQUIV], 1..=2)[2],
b"=",
0,
0,
OK,
ctx,
)?;
} else if spicelib::EQSTR(&BFFID, b"LTL-IEEE") {
testutil::CHCKSI(
b"IEQUIV(1)",
DummyArray::<i32>::from_equiv(&[DEQUIV], 1..=2)[1],
b"=",
0,
0,
OK,
ctx,
)?;
testutil::CHCKSI(
b"IEQUIV(2)",
DummyArray::<i32>::from_equiv(&[DEQUIV], 1..=2)[2],
b"=",
1072693248,
0,
OK,
ctx,
)?;
} else if spicelib::EQSTR(&BFFID, b"VAX-GFLT") {
testutil::CHCKSI(
b"IEQUIV(1)",
DummyArray::<i32>::from_equiv(&[DEQUIV], 1..=2)[1],
b"=",
16400,
0,
OK,
ctx,
)?;
testutil::CHCKSI(
b"IEQUIV(2)",
DummyArray::<i32>::from_equiv(&[DEQUIV], 1..=2)[2],
b"=",
0,
0,
OK,
ctx,
)?;
} else if spicelib::EQSTR(&BFFID, b"VAX-DFLT") {
testutil::CHCKSI(
b"IEQUIV(1)",
DummyArray::<i32>::from_equiv(&[DEQUIV], 1..=2)[1],
b"=",
16512,
0,
OK,
ctx,
)?;
testutil::CHCKSI(
b"IEQUIV(2)",
DummyArray::<i32>::from_equiv(&[DEQUIV], 1..=2)[2],
b"=",
0,
0,
OK,
ctx,
)?;
} else {
testutil::TSTMSG(b"#", b"This test does not support this format.", ctx);
testutil::CHCKSI(b"ERROR", 0, b"=", 1, 0, OK, ctx)?;
}
//
// Close out the test family.
//
testutil::T_SUCCESS(OK, ctx);
Ok(())
}