Commits

Paweł Wieczorek committed 6bc1744

ManagedRef tests uses pa_ounit

Comments (0)

Files changed (1)

unittests/Utilities/Test_ManagedRef.ml

  * Tests
  ********************************************************************************************************************)
 
-let test_create = "create" >:: begin fun () ->
+Testlist tests begin
+
+test create =
         ignore (ManagedRef.create ())
-    end
 
-let test_is_empty_on_empty = "is_empty_on_empty" >:: begin fun () ->
+test is_empty_on_empty = 
         let mr = ManagedRef.create () in
         assert_true (ManagedRef.is_empty mr)
-    end
 
-let test_is_initialized_on_empty = "is_initialized_on_empty" >:: begin fun () ->
+test is_initialized_on_empty =
         let mr = ManagedRef.create () in
         assert_false (ManagedRef.is_initialized mr)
-    end
 
-
-let test_is_empty_on_initialized = "is_empty_on_initialized" >:: begin fun () ->
+test is_empty_on_initialized = 
         let mr = ManagedRef.create () in
         ManagedRef.replace mr 5;
         assert_false (ManagedRef.is_empty mr)
-    end
 
-
-let test_is_initialized_on_initialized = "is_initialized_on_initialized" >:: begin fun () ->
+test is_initialized_on_initialized = 
         let mr = ManagedRef.create () in
         ManagedRef.replace mr "5";
         assert_true (ManagedRef.is_initialized mr)
-    end
 
 
-let test_release = "release" >:: begin fun () ->
+test release =
         let mr = ManagedRef.create () in
         ManagedRef.replace mr true;
         let y = ManagedRef.release mr in
         assert_true y
-    end
 
-let test_is_empty_on_released = "is_empty_on_released" >:: begin fun () ->
+test is_empty_on_released = 
         let mr = ManagedRef.create () in
         ManagedRef.replace mr 'a';
         ignore (ManagedRef.release mr);
         assert_true (ManagedRef.is_empty mr)
-    end
 
+end
 
-
-
-(*********************************************************************************************************************
- * Test suite
- ********************************************************************************************************************)
-
-let tests =
-    [ test_create
-    ; test_is_empty_on_empty
-    ; test_is_initialized_on_empty
-    ; test_is_empty_on_initialized
-    ; test_is_initialized_on_initialized
-    ; test_release
-    ; test_is_empty_on_released 
-    ]