Skip to content

Commit b2301e6

Browse files
committed
Bump ocamlformat version and format tests
1 parent bb24e87 commit b2301e6

File tree

10 files changed

+34
-17
lines changed

10 files changed

+34
-17
lines changed

.ocamlformat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
profile = default
2-
version = 0.25.1
2+
version = 0.26.0

src_lockfree/ws_deque.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module CArray = struct
5454
(* Because [size t] is a power of two, [i mod (size t)] is the same as
5555
[i land (size t - 1)], that is, [i land (mask t)]. *)
5656
Int.logand i (mask t)
57-
[@@inline]
57+
[@@inline]
5858

5959
let get t i = Array.unsafe_get t (index i t) [@@inline]
6060
let put t i v = Array.unsafe_set t (index i t) v [@@inline]
@@ -66,7 +66,7 @@ module CArray = struct
6666
dst
6767
(index top dst) (* number of elements: *)
6868
num
69-
[@@inline]
69+
[@@inline]
7070

7171
let grow t top bottom =
7272
let sz = size t in
@@ -138,7 +138,7 @@ module M : S = struct
138138
deque array get garbage collected *)
139139
ptr := Obj.magic ();
140140
res
141-
[@@inline]
141+
[@@inline]
142142

143143
let pop q =
144144
if size q = 0 then raise Exit

test/michael_scott_queue/dune

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
(test
88
(name michael_scott_queue_dscheck)
99
(libraries atomic dscheck alcotest)
10-
(enabled_if (not (and (= %{arch_sixtyfour} false) (= %{architecture} arm))))
10+
(enabled_if
11+
(not
12+
(and
13+
(= %{arch_sixtyfour} false)
14+
(= %{architecture} arm))))
1115
(modules backoff michael_scott_queue michael_scott_queue_dscheck))
1216

1317
(test
@@ -19,6 +23,7 @@
1923
(name stm_michael_scott_queue)
2024
(modules stm_michael_scott_queue)
2125
(libraries saturn qcheck-stm.sequential qcheck-stm.domain)
22-
(enabled_if (= %{arch_sixtyfour} true))
26+
(enabled_if
27+
(= %{arch_sixtyfour} true))
2328
(action
2429
(run %{test} --verbose)))

test/mpmc_relaxed_queue/test_mpmc_relaxed_queue.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ let two_threads_spin_test () =
134134
Domain.join dequeuer |> ignore;
135135
()
136136

137-
let doms1 = if (Sys.word_size >= 64) then 4 else 1
138-
let doms2 = if (Sys.word_size >= 64) then 8 else 1
137+
let doms1 = if Sys.word_size >= 64 then 4 else 1
138+
let doms2 = if Sys.word_size >= 64 then 8 else 1
139139

140140
let () =
141141
let open Alcotest in
@@ -151,7 +151,7 @@ let () =
151151
[
152152
test_case " 4 prod. 4 cons." `Slow (run_test doms1 doms1);
153153
test_case " 8 prod. 1 cons." `Slow (run_test doms2 1);
154-
test_case " 1 prod. 8 cons." `Slow (run_test 1 doms2)
154+
test_case " 1 prod. 8 cons." `Slow (run_test 1 doms2);
155155
] );
156156
]
157157
@

test/mpsc_queue/dune

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
(name stm_mpsc_queue)
1616
(modules stm_mpsc_queue)
1717
(libraries saturn qcheck-stm.sequential qcheck-stm.domain)
18-
(enabled_if (= %{arch_sixtyfour} true))
18+
(enabled_if
19+
(= %{arch_sixtyfour} true))
1920
(action
2021
(run %{test} --verbose)))

test/mpsc_queue/stm_mpsc_queue.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module MPSCConf = struct
5050
(is_closed, if not is_closed then i :: List.rev s |> List.rev else s)
5151
| Push_head i -> (is_closed, if not (is_closed && s = []) then i :: s else s)
5252
| Is_empty -> (is_closed, s)
53-
| Pop -> ( (is_closed, match s with [] -> s | _ :: s' -> s'))
53+
| Pop -> (is_closed, match s with [] -> s | _ :: s' -> s')
5454
| Close -> (true, s)
5555

5656
let precond _ _ = true

test/spsc_queue/dune

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
(name stm_spsc_queue)
2121
(modules stm_spsc_queue)
2222
(libraries saturn qcheck-stm.sequential qcheck-stm.domain)
23-
(enabled_if (= %{arch_sixtyfour} true))
23+
(enabled_if
24+
(= %{arch_sixtyfour} true))
2425
(action
2526
(run %{test} --verbose)))

test/treiber_stack/dune

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
(test
88
(name treiber_stack_dscheck)
99
(libraries atomic dscheck alcotest)
10-
(enabled_if (not (and (= %{arch_sixtyfour} false) (= %{architecture} arm))))
10+
(enabled_if
11+
(not
12+
(and
13+
(= %{arch_sixtyfour} false)
14+
(= %{architecture} arm))))
1115
(modules backoff treiber_stack treiber_stack_dscheck))
1216

1317
(test
@@ -19,6 +23,7 @@
1923
(name stm_treiber_stack)
2024
(modules stm_treiber_stack)
2125
(libraries saturn qcheck-stm.sequential qcheck-stm.domain)
22-
(enabled_if (= %{arch_sixtyfour} true))
26+
(enabled_if
27+
(= %{arch_sixtyfour} true))
2328
(action
2429
(run %{test} --verbose)))

test/ws_deque/dune

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,18 @@
1717
(test
1818
(name qcheck_ws_deque)
1919
(libraries barrier saturn qcheck "qcheck-alcotest")
20-
(enabled_if (not (and (= %{arch_sixtyfour} false) (= %{architecture} arm))))
20+
(enabled_if
21+
(not
22+
(and
23+
(= %{arch_sixtyfour} false)
24+
(= %{architecture} arm))))
2125
(modules qcheck_ws_deque))
2226

2327
(test
2428
(name stm_ws_deque)
2529
(modules stm_ws_deque)
2630
(libraries saturn qcheck-stm.sequential qcheck-stm.domain)
27-
(enabled_if (= %{arch_sixtyfour} true))
31+
(enabled_if
32+
(= %{arch_sixtyfour} true))
2833
(action
2934
(run %{test} --verbose)))

test/ws_deque/test_ws_deque.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ let test_concurrent_workload () =
3939
(* The desired number of steal attempts per thief. *)
4040
let attempts = 100000 in
4141
(* The number of thieves. *)
42-
let thieves = if (Sys.word_size >= 64) then 16 else 2 in
42+
let thieves = if Sys.word_size >= 64 then 16 else 2 in
4343
(* The queue. *)
4444
let q = create () in
4545
(* A generator of fresh elements. *)

0 commit comments

Comments
 (0)