From 73df5947b8f28548ba8dd2c444fd72d8ef8c7de3 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard Date: Wed, 15 Jan 2025 10:59:01 +0100 Subject: [PATCH 1/3] Adjust generators in Lin Bytes test, turning it into a negative test --- src/bytes/lin_tests.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bytes/lin_tests.ml b/src/bytes/lin_tests.ml index c39d72bb9..98348b4b4 100644 --- a/src/bytes/lin_tests.ml +++ b/src/bytes/lin_tests.ml @@ -7,7 +7,7 @@ module BConf = struct let cleanup _ = () open Lin - + let int,string = nat_small, string_small_printable let api = [ val_ "Bytes.get" Bytes.get (t @-> int @-> returning_or_exc char); val_ "Bytes.sub_string" Bytes.sub_string (t @-> int @-> int @-> returning_or_exc string); @@ -21,6 +21,6 @@ module BT_domain = Lin_domain.Make(BConf) module BT_thread = Lin_thread.Make(BConf) [@alert "-experimental"] ;; QCheck_base_runner.run_tests_main [ - BT_domain.lin_test ~count:1000 ~name:"Lin Bytes test with Domain"; + BT_domain.neg_lin_test ~count:1000 ~name:"Lin Bytes test with Domain"; BT_thread.lin_test ~count:1000 ~name:"Lin Bytes test with Thread"; ] From 3918d5d769af308d27ee20acb931dbd5f642a1ae Mon Sep 17 00:00:00 2001 From: Jan Midtgaard Date: Wed, 15 Jan 2025 11:22:19 +0100 Subject: [PATCH 2/3] Reduce Lin Bytes Thread count --- src/bytes/lin_tests.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bytes/lin_tests.ml b/src/bytes/lin_tests.ml index 98348b4b4..dd6757c25 100644 --- a/src/bytes/lin_tests.ml +++ b/src/bytes/lin_tests.ml @@ -22,5 +22,5 @@ module BT_thread = Lin_thread.Make(BConf) [@alert "-experimental"] ;; QCheck_base_runner.run_tests_main [ BT_domain.neg_lin_test ~count:1000 ~name:"Lin Bytes test with Domain"; - BT_thread.lin_test ~count:1000 ~name:"Lin Bytes test with Thread"; + BT_thread.lin_test ~count:250 ~name:"Lin Bytes test with Thread"; ] From c586d899ec23fff0558279a5c4e9c094066b0833 Mon Sep 17 00:00:00 2001 From: Jan Midtgaard Date: Wed, 15 Jan 2025 11:25:46 +0100 Subject: [PATCH 3/3] Add Bytes.set to Lin Bytes test --- src/bytes/lin_tests.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bytes/lin_tests.ml b/src/bytes/lin_tests.ml index dd6757c25..69497ccef 100644 --- a/src/bytes/lin_tests.ml +++ b/src/bytes/lin_tests.ml @@ -10,6 +10,7 @@ module BConf = struct let int,string = nat_small, string_small_printable let api = [ val_ "Bytes.get" Bytes.get (t @-> int @-> returning_or_exc char); + val_ "Bytes.set" Bytes.set (t @-> int @-> char @-> returning_or_exc unit); val_ "Bytes.sub_string" Bytes.sub_string (t @-> int @-> int @-> returning_or_exc string); val_ "Bytes.length" Bytes.length (t @-> returning int); val_ "Bytes.fill" Bytes.fill (t @-> int @-> int @-> char @-> returning_or_exc unit);