Skip to content

Commit

Permalink
Refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
dboris committed Aug 1, 2024
1 parent c7a7906 commit dd779c9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/test-dispatch/test_dispatch.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ module A = Alcotest
let concur_queue = dispatch_queue_create "TestQueue1" _DISPATCH_QUEUE_CONCURRENT
let serial_queue = dispatch_queue_create "TestQueue2" _DISPATCH_QUEUE_SERIAL

let dispatch_queue_concurrent () =
let test_dispatch_queue_concurrent () =
let handler_called = ref false in
dispatch_sync_f concur_queue null (fun _ctx -> handler_called := true);
A.check A.bool "dispatched function was called" true !handler_called
;;

let dispatch_queue_concurrent_with_block () =
let test_dispatch_queue_concurrent_with_block () =
let handler_called = ref false in
let handler_block =
Block.make ~args: Objc_t.[] ~return: Objc_t.void
Expand All @@ -22,16 +22,16 @@ let dispatch_queue_concurrent_with_block () =
A.check A.bool "dispatched block was called" true !handler_called
;;

let dispatch_queue_serial () =
let test_dispatch_queue_serial () =
let handler_called = ref false in
dispatch_sync_f serial_queue null (fun _ctx -> handler_called := true);
A.check A.bool "dispatched function was called" true !handler_called
;;

let suite =
[ "dispatch_queue_concurrent", `Quick, dispatch_queue_concurrent
; "dispatch_queue_concurrent_with_block", `Quick, dispatch_queue_concurrent_with_block
; "dispatch_queue_serial", `Quick, dispatch_queue_serial
[ "test_dispatch_queue_concurrent", `Quick, test_dispatch_queue_concurrent
; "test_dispatch_queue_concurrent_with_block", `Quick, test_dispatch_queue_concurrent_with_block
; "test_dispatch_queue_serial", `Quick, test_dispatch_queue_serial
]

let () = A.run "dispatch" [ "dispatch", suite ]

0 comments on commit dd779c9

Please sign in to comment.