@@ -26,6 +26,12 @@ fn test_case<T: PartialEq + std::fmt::Debug>(test_case_name: &str, actual: T, ex
2626 }
2727}
2828
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+
2935#[ allow( overflowing_literals) ]
3036fn main ( ) -> Result < ( ) , ni_fpga:: Error > {
3137 let mut tmp_bitfile = NamedTempFile :: new ( ) . unwrap ( ) ;
@@ -34,7 +40,7 @@ fn main() -> Result<(), ni_fpga::Error> {
3440 let session = Session :: open (
3541 tmp_bitfile. path ( ) . to_str ( ) . unwrap ( ) ,
3642 "D08F17F77A45A5692FA2342C6B86E0EE" ,
37- "RIO0" ,
43+ RESOURCE ,
3844 ) ?;
3945
4046 test_case ( "read plain U8" , session. read :: < u8 > ( 98306 ) ?, 0b00000001 ) ;
@@ -98,15 +104,12 @@ fn main() -> Result<(), ni_fpga::Error> {
98104 session. read :: < TestCluster > ( 98360 ) ?,
99105 TestCluster { b : false , u : 1337 } ,
100106 ) ;
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.
104107 test_case (
105108 "read cluster array" ,
106- session. read :: < [ TestCluster ; 2 ] > ( 98360 ) ?,
109+ session. read :: < [ TestCluster ; 2 ] > ( 98364 ) ?,
107110 [
108- TestCluster { b : true , u : 255 } ,
109- TestCluster { b : false , u : 1337 } ,
111+ TestCluster { b : true , u : 1234 } ,
112+ TestCluster { b : false , u : 5678 } ,
110113 ] ,
111114 ) ;
112115
0 commit comments