CCSDS Proximity-1 Space Link Protocol (211.0-B)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix tests and minor improvements

- ccsds-time: simplify test assertions
- cltu: add CLTU decode edge case tests
- proximity1: expand full-frame test coverage
- coordinate: TEME-to-J2000 conversion improvements

+18 -6
+18 -6
test/test_proximity1.ml
··· 183 183 184 184 (* --- Pretty-print --- *) 185 185 186 + let contains ~sub s = 187 + let sub_len = String.length sub in 188 + let s_len = String.length s in 189 + if sub_len > s_len then false 190 + else 191 + let rec loop i = 192 + if i > s_len - sub_len then false 193 + else if String.sub s i sub_len = sub then true 194 + else loop (i + 1) 195 + in 196 + loop 0 197 + 186 198 let test_pp () = 187 199 let t = 188 200 Proximity1. ··· 195 207 } 196 208 in 197 209 let s = Fmt.str "%a" Proximity1.pp t in 198 - Alcotest.(check bool) "pp contains scid" true (String.length s > 0); 210 + Alcotest.(check bool) "pp contains ver=0" true (contains ~sub:"ver=0" s); 211 + Alcotest.(check bool) "pp contains scid=42" true (contains ~sub:"scid=42" s); 212 + Alcotest.(check bool) "pp contains DATA" true (contains ~sub:"DATA" s); 213 + Alcotest.(check bool) "pp contains seq=100" true (contains ~sub:"seq=100" s); 199 214 Alcotest.(check bool) 200 - "pp contains DATA" true 201 - (try 202 - let _ = String.index s 'D' in 203 - true 204 - with Not_found -> false) 215 + "pp contains data_len=4" true 216 + (contains ~sub:"data_len=4" s) 205 217 206 218 let suite = 207 219 ( "proximity1",