Stop using allocation trick in fastpath functions (OCaml 4.02).
[ocaml-bitstring.git] / tests / test_36_is_zeroes_ones.ml
1 (* Test if bitstrings are all zeroes or all ones.
2  * $Id$
3  *)
4
5 open Printf
6
7 let () =
8   for i = 0 to 33 do
9     let bits = Bitstring.zeroes_bitstring i in
10     if not (Bitstring.is_zeroes_bitstring bits) then (
11       eprintf "is_zeros_bitstring failed %d\n" i;
12       exit 1
13     );
14     if i > 0 && Bitstring.is_ones_bitstring bits then (
15       eprintf "false match is_ones_bitstring %d\n" i;
16       exit 1
17     )
18   done;
19   for i = 0 to 33 do
20     let bits = Bitstring.ones_bitstring i in
21     if not (Bitstring.is_ones_bitstring bits) then (
22       eprintf "is_ones_bitstring failed %d\n" i;
23       exit 1
24     );
25     if i > 0 && Bitstring.is_zeroes_bitstring bits then (
26       eprintf "false match is_zeroes_bitstring %d\n" i;
27       exit 1
28     )
29   done