From dd779c963d2dad5a663200b0f6a48b6c92bde656 Mon Sep 17 00:00:00 2001 From: "Boris D." Date: Thu, 1 Aug 2024 15:43:28 -0700 Subject: [PATCH] Refactor. --- test/test-dispatch/test_dispatch.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/test-dispatch/test_dispatch.ml b/test/test-dispatch/test_dispatch.ml index b243c004..c50c1027 100644 --- a/test/test-dispatch/test_dispatch.ml +++ b/test/test-dispatch/test_dispatch.ml @@ -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 @@ -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 ]