Skip to content

Commit 915f5a9

Browse files
committed
Add a initialization test
Just to make sure we didn't screw up init
1 parent 7b6fbc1 commit 915f5a9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/test.ml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ end
3636

3737
module T = struct
3838

39+
let init () =
40+
let maxfds = 1024 in
41+
let poll = Poll.create ~maxfds () in
42+
for i = 0 to maxfds - 1 do
43+
let v = (Poll.get_fd poll i) = Poll.invalid_fd in
44+
check_bool "initialized" v true
45+
done
46+
3947
let basic () =
4048
let poll = Poll.create ~maxfds:16 () in
4149
let r, w = Unix.pipe () in
@@ -103,6 +111,7 @@ module T = struct
103111
let open Alcotest in
104112
let wlc = U.with_leak_checker in
105113
run "Iomux" [
114+
"init", [ test_case "" `Quick (wlc init) ];
106115
"unit", [ test_case "" `Quick (wlc basic) ];
107116
"ppoll_timo", [ test_case "" `Quick (wlc ppoll_timo) ];
108117
"ppoll_or_poll", [ test_case "" `Quick (wlc ppoll_or_poll) ];

0 commit comments

Comments
 (0)