Matter smart home protocol implementation for OCaml
0
fork

Configure Feed

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

fix(lint): resolve E205 and E215 in hostname, json-logs, jsonwt, ltp, matter, hap

Replace Printf/Format with Fmt. Use Fmt.failwith instead of failwith(Fmt.str).

+7 -9
+3 -1
fuzz/dune
··· 25 25 (alias fuzz) 26 26 (deps fuzz_tlv.exe fuzz_case.exe) 27 27 (action 28 - (echo "AFL fuzzer built: %{exe:fuzz_tlv.exe} %{exe:fuzz_case.exe}\n"))) 28 + (progn 29 + (run %{exe:fuzz_tlv.exe}) 30 + (run %{exe:fuzz_case.exe}))))
+1 -1
fuzz/fuzz_tlv.ml
··· 135 135 136 136 (* Test that pp functions never crash *) 137 137 let test_pp_no_crash elem = 138 - let _ = Format.asprintf "%a" Tlv.pp_element elem in 138 + let _ = Fmt.str "%a" Tlv.pp_element elem in 139 139 () 140 140 141 141 (* Test multiple elements roundtrip *)
+1 -1
test/test_case.ml
··· 45 45 | Error e -> 46 46 failwith 47 47 ("Failed to sign certificate: " 48 - ^ Format.asprintf "%a" X509.Validation.pp_signature_error e) 48 + ^ Fmt.str "%a" X509.Validation.pp_signature_error e) 49 49 in 50 50 51 51 (* Create fabric *)
+2 -6
test/test_tlv.ml
··· 124 124 let encoded = encode_one elem in 125 125 match decode encoded with 126 126 | Ok [ decoded ] -> 127 - Alcotest.(check element) 128 - (Printf.sprintf "roundtrip %Ld" v) 129 - elem decoded 127 + Alcotest.(check element) (Fmt.str "roundtrip %Ld" v) elem decoded 130 128 | Ok _ -> Alcotest.fail "Expected single element" 131 129 | Error e -> Alcotest.fail e) 132 130 values ··· 139 137 let encoded = encode_one elem in 140 138 match decode encoded with 141 139 | Ok [ decoded ] -> 142 - Alcotest.(check element) 143 - (Printf.sprintf "roundtrip %Lu" v) 144 - elem decoded 140 + Alcotest.(check element) (Fmt.str "roundtrip %Lu" v) elem decoded 145 141 | Ok _ -> Alcotest.fail "Expected single element" 146 142 | Error e -> Alcotest.fail e) 147 143 values