Commit 18033693 authored by Julien Lopez's avatar Julien Lopez

More OUnit tests added

parent 7a3ef961
......@@ -28,7 +28,7 @@ a:
cdsdl:
$(CAML) -c -I `ocamlfind query sdl` $@.mli
$(CDUCE) --compile -I `ocamlfind query sdl` $@.cd
$(CDO2ML) $@.cdo > $@.ml
$(CDO2ML) -I `ocamlfind query sdl` $@.cdo > $@.ml
ocamlfind $(CAML) -package cduce,sdl,oUnit -linkpkg -o $@ $@.ml $@test.ml
./$@
......@@ -55,7 +55,7 @@ cdnum:
./$@
clean:
rm -f *.cmo *.cmx *.o *.cdo *.cmi a.ml c.ml cdnum cdnum.ml eval cdsdl cdmysql a oUnit-*
rm -f *.cmo *.cmx *.o *.cdo *.cmi a.ml c.ml cdnum cdnum.ml cdsdl.ml eval cdsdl cdmysql a oUnit-*
check:
./check.sh
let sdl_version = string_of (Sdl.version [])
let sdl_version = Sdl.string_of_version (Sdl.version [])
let sdl_init = Sdl.init [ `true ] [ `EVERYTHING ]
......@@ -8,10 +8,4 @@ let sdl_num_drives = Sdlcdrom.get_num_drives []
let sdl_cd_open = Sdlcdrom.cd_open
let [] =
print [ 'Sdl version' !sdl_version '\n' ];
Sdl.init [ `true ] [ `EVERYTHING ];
let n = string_of (Sdlcdrom.get_num_drives []) in
print [ 'Drives:' !n '\n' ];
let cd = Sdlcdrom.cd_open 0 in
Sdlcdrom.cd_eject cd
let sdl_cd_eject = Sdlcdrom.cd_eject
val sdl_version : string
val sdl_init : unit
val sdl_quit : unit -> unit
val sdl_num_drives : int
val sdl_cd_open : int -> Sdlcdrom.cdrom_drive
val sdl_cd_eject : Sdlcdrom.cdrom_drive -> unit
open OUnit2
open Big_int
let tests = "Cdsdl" >:::
[
"sdl_version" >:: ( fun test_ctxt ->
assert_equal ~msg:"Test Cdsdl.sdl_version.1 failed"
(Sdl.string_of_version (Sdl.version ())) (Cdsdl.sdl_version);
);
"sdl_num_drives" >:: ( fun test_ctxt ->
assert_equal ~msg:"Test Cdsdl.sdl_num_drives.1 failed"
(Sdlcdrom.get_num_drives ()) (Cdsdl.sdl_num_drives);
);
"sdl_complete_example" >:: ( fun test_ctxt ->
Cdsdl.sdl_init;
let cd = Cdsdl.sdl_cd_open 0 in
Cdsdl.sdl_cd_eject cd;
Cdsdl.sdl_quit ();
);
]
let _ = run_test_tt_main tests
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment