CCSDS TM Transfer Frames (CCSDS 132.0-B-3)
0
fork

Configure Feed

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

irmin: add IPLD-style representation strategies to structs and unions

+46
+46
fuzz/fuzz_tm.ml
··· 202 202 check_eq ~pp:Fmt.int Tm.fhp_no_packet 0x7FE; 203 203 check_eq ~pp:Fmt.int Tm.fhp_idle_only 0x7FF 204 204 205 + (** {1 Spec constraint enforcement} 206 + 207 + CCSDS 132.0-B-3: pkt_order requires sync_flag; seg_len_id must be 3 when 208 + sync_flag is false. *) 209 + 210 + let test_pkt_order_requires_sync _dummy = 211 + match (Tm.scid 0, Tm.vcid 0) with 212 + | Some scid, Some vcid -> ( 213 + (* pkt_order=true, sync_flag=false must raise *) 214 + try 215 + ignore 216 + (Tm.header ~sync_flag:false ~pkt_order:true ~scid ~vcid ~mcfc:0 217 + ~vcfc:0 ()); 218 + fail "should reject pkt_order without sync_flag" 219 + with Invalid_argument _ -> ()) 220 + | _ -> fail "scid/vcid 0 rejected" 221 + 222 + let test_seg_len_requires_sync _dummy = 223 + match (Tm.scid 0, Tm.vcid 0) with 224 + | Some scid, Some vcid -> ( 225 + (* seg_len_id != 3, sync_flag=false must raise *) 226 + try 227 + ignore 228 + (Tm.header ~sync_flag:false ~seg_len_id:0 ~scid ~vcid ~mcfc:0 ~vcfc:0 229 + ()); 230 + fail "should reject seg_len_id=0 without sync_flag" 231 + with Invalid_argument _ -> ()) 232 + | _ -> fail "scid/vcid 0 rejected" 233 + 234 + let test_sync_flag_allows_variants seg_len_id = 235 + let seg_len_id = seg_len_id mod 4 in 236 + match (Tm.scid 0, Tm.vcid 0) with 237 + | Some scid, Some vcid -> 238 + (* sync_flag=true allows any seg_len_id and pkt_order *) 239 + ignore 240 + (Tm.header ~sync_flag:true ~pkt_order:true ~seg_len_id ~scid ~vcid 241 + ~mcfc:0 ~vcfc:0 ()) 242 + | _ -> fail "scid/vcid 0 rejected" 243 + 205 244 let suite = 206 245 ( "tm", 207 246 [ ··· 227 266 [ range 2000; range 20; range 300; range 300 ] 228 267 test_spec_field_widths; 229 268 test_case "FHP constants" [ uint8 ] test_fhp_constants; 269 + test_case "pkt_order requires sync_flag" [ uint8 ] 270 + test_pkt_order_requires_sync; 271 + test_case "seg_len_id requires sync_flag" [ uint8 ] 272 + test_seg_len_requires_sync; 273 + test_case "sync_flag allows seg_len variants" 274 + [ range 10 ] 275 + test_sync_flag_allows_variants; 230 276 ] )