AX.25 Amateur Radio Link-Layer Protocol
0
fork

Configure Feed

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

ax25: fix merlint issues (Fmt.str, rename test_ functions)

+8 -8
+8 -8
test/interop/pyax25/test.ml
··· 79 79 let len = Bytes.length buf in 80 80 let hex = Buffer.create (len * 2) in 81 81 for i = 0 to len - 1 do 82 - Buffer.add_string hex (Printf.sprintf "%02x" (Bytes.get_uint8 buf i)) 82 + Buffer.add_string hex (Fmt.str "%02x" (Bytes.get_uint8 buf i)) 83 83 done; 84 84 Buffer.contents hex 85 85 86 86 (* {1 UI Frame Interop Tests} *) 87 87 88 - let test_ui_frame_encoding () = 88 + let ui_frame_encoding () = 89 89 let rows = 90 90 match Csvt.decode_file ui_frame_codec (trace "ui_frames.csv") with 91 91 | Ok rows -> rows ··· 114 114 115 115 (* {1 Extension Bit Interop Tests} *) 116 116 117 - let test_extension_bits () = 117 + let extension_bits () = 118 118 let rows = 119 119 match Csvt.decode_file ext_bit_codec (trace "extension_bits.csv") with 120 120 | Ok rows -> rows ··· 129 129 let ext = Bytes.get_uint8 frame_bytes ssid_off land 0x01 in 130 130 if i = r.last_index then 131 131 Alcotest.(check int) 132 - (Printf.sprintf "%s: callsign %d ext=1 (last)" r.name i) 132 + (Fmt.str "%s: callsign %d ext=1 (last)" r.name i) 133 133 1 ext 134 134 else 135 135 Alcotest.(check int) 136 - (Printf.sprintf "%s: callsign %d ext=0" r.name i) 136 + (Fmt.str "%s: callsign %d ext=0" r.name i) 137 137 0 ext 138 138 done; 139 139 (* Decode with our implementation and re-encode *) ··· 145 145 let our_ext = Bytes.get_uint8 our_bytes ssid_off land 0x01 in 146 146 let ref_ext = Bytes.get_uint8 frame_bytes ssid_off land 0x01 in 147 147 Alcotest.(check int) 148 - (Printf.sprintf "%s: our ext[%d] matches ref" r.name i) 148 + (Fmt.str "%s: our ext[%d] matches ref" r.name i) 149 149 ref_ext our_ext 150 150 done 151 151 | Error e -> Alcotest.failf "%s: decode failed: %a" r.name Ax25.pp_error e) ··· 157 157 ( "ui_frames", 158 158 [ 159 159 Alcotest.test_case "encoding matches aioax25" `Quick 160 - test_ui_frame_encoding; 160 + ui_frame_encoding; 161 161 ] ); 162 162 ( "extension_bits", 163 163 [ 164 164 Alcotest.test_case "extension bits match aioax25" `Quick 165 - test_extension_bits; 165 + extension_bits; 166 166 ] ); 167 167 ]