@@ -26,6 +26,12 @@ fn test_case<T: PartialEq + std::fmt::Debug>(test_case_name: &str, actual: T, ex
26
26
}
27
27
}
28
28
29
+ #[ cfg( target_arch = "arm" ) ]
30
+ const RESOURCE : & str = "RIO0" ;
31
+
32
+ #[ cfg( not( target_arch = "arm" ) ) ]
33
+ const RESOURCE : & str = "rio://172.22.11.2/RIO0" ;
34
+
29
35
#[ allow( overflowing_literals) ]
30
36
fn main ( ) -> Result < ( ) , ni_fpga:: Error > {
31
37
let mut tmp_bitfile = NamedTempFile :: new ( ) . unwrap ( ) ;
@@ -34,7 +40,7 @@ fn main() -> Result<(), ni_fpga::Error> {
34
40
let session = Session :: open (
35
41
tmp_bitfile. path ( ) . to_str ( ) . unwrap ( ) ,
36
42
"D08F17F77A45A5692FA2342C6B86E0EE" ,
37
- "RIO0" ,
43
+ RESOURCE ,
38
44
) ?;
39
45
40
46
test_case ( "read plain U8" , session. read :: < u8 > ( 98306 ) ?, 0b00000001 ) ;
@@ -98,15 +104,12 @@ fn main() -> Result<(), ni_fpga::Error> {
98
104
session. read :: < TestCluster > ( 98360 ) ?,
99
105
TestCluster { b : false , u : 1337 } ,
100
106
) ;
101
- // TODO: Investigate cluster array memory layout in order to fix this test.
102
- // The expected array may be incorrect here, I don't exactly remember what I used for the
103
- // fixture bitfile before my LabView FPGA trial expired.
104
107
test_case (
105
108
"read cluster array" ,
106
- session. read :: < [ TestCluster ; 2 ] > ( 98360 ) ?,
109
+ session. read :: < [ TestCluster ; 2 ] > ( 98364 ) ?,
107
110
[
108
- TestCluster { b : true , u : 255 } ,
109
- TestCluster { b : false , u : 1337 } ,
111
+ TestCluster { b : true , u : 1234 } ,
112
+ TestCluster { b : false , u : 5678 } ,
110
113
] ,
111
114
) ;
112
115
0 commit comments