···1717let config ?(block_size = 16) ?(bits_per_sample = 16) ?rsi () =
1818 if block_size < 8 || block_size > 64 then
1919 invalid_arg
2020- (Printf.sprintf "block_size must be in 8..64, got %d" block_size);
2020+ (Fmt.str "block_size must be in 8..64, got %d" block_size);
2121 if bits_per_sample < 1 || bits_per_sample > 32 then
2222 invalid_arg
2323- (Printf.sprintf "bits_per_sample must be in 1..32, got %d" bits_per_sample);
2323+ (Fmt.str "bits_per_sample must be in 1..32, got %d" bits_per_sample);
2424 let rsi = match rsi with Some r -> r | None -> block_size in
2525 { block_size; bits_per_sample; predictor = Unit_delay; rsi }
2626
+1-1
test/interop/libaec/test.ml
···1818let hex_of_bytes b =
1919 let buf = Buffer.create (Bytes.length b * 2) in
2020 Bytes.iter
2121- (fun c -> Buffer.add_string buf (Printf.sprintf "%02x" (Char.code c)))
2121+ (fun c -> Buffer.add_string buf (Fmt.str "%02x" (Char.code c)))
2222 b;
2323 Buffer.contents buf
2424
+5-5
test/test_rice.ml
···117117 let cfg = Rice.config ~block_size:bs ~bits_per_sample:8 () in
118118 let result = roundtrip ~bps:8 cfg data in
119119 Alcotest.(check bytes_eq)
120120- (Printf.sprintf "block_size=%d roundtrip" bs)
120120+ (Fmt.str "block_size=%d roundtrip" bs)
121121 data result)
122122 [ 8; 16; 32; 64 ]
123123···142142 let cfg = Rice.config ~block_size:16 ~bits_per_sample:bps () in
143143 let result = roundtrip ~bps cfg buf in
144144 Alcotest.(check bytes_eq)
145145- (Printf.sprintf "bps=%d roundtrip" bps)
145145+ (Fmt.str "bps=%d roundtrip" bps)
146146 buf result)
147147 [ 8; 16; 24; 32 ]
148148···263263 (* Single sample with value 0 *)
264264 let buf0 = Bytes.make bps_bytes '\000' in
265265 let r0 = roundtrip ~bps cfg buf0 in
266266- Alcotest.(check bytes_eq) (Printf.sprintf "single 0, bps=%d" bps) buf0 r0;
266266+ Alcotest.(check bytes_eq) (Fmt.str "single 0, bps=%d" bps) buf0 r0;
267267 (* Single sample with max value *)
268268 let bufmax = Bytes.make bps_bytes '\000' in
269269 (* Write max_val big-endian *)
···274274 done;
275275 let rmax = roundtrip ~bps cfg bufmax in
276276 Alcotest.(check bytes_eq)
277277- (Printf.sprintf "single max, bps=%d" bps)
277277+ (Fmt.str "single max, bps=%d" bps)
278278 bufmax rmax)
279279 [ 1; 2; 4; 8; 12; 16; 24; 32 ]
280280···309309 done;
310310 let result = roundtrip ~bps cfg buf in
311311 Alcotest.(check bytes_eq)
312312- (Printf.sprintf "alternating 0/max bps=%d" bps)
312312+ (Fmt.str "alternating 0/max bps=%d" bps)
313313 buf result)
314314 [ 8; 16 ]
315315