Commits

Alexey Kishkin  committed 6bb9e70

additional tests

  • Participants
  • Parent commits 69c8559

Comments (0)

Files changed (1)

        assert_equal "\000\001\000\000" (let cargo = Buffer.create 4 in (set_int32 cargo 0x10000l; Buffer.contents cargo));
        assert_equal "\000\255\255\255" (let cargo = Buffer.create 4 in (set_int32 cargo 0xFFFFFFl; Buffer.contents cargo));
        assert_equal "\001\000\000\000" (let cargo = Buffer.create 4 in (set_int32 cargo 0x1000000l; Buffer.contents cargo));
-      )
+      );
+    "get_i8" >:: (fun() ->
+        assert_equal 0 (get_i8 "\000" 0);  
+        assert_equal 1 (get_i8 "\001" 0);  
+        assert_equal 255 (get_i8 "\255" 0);  
+        assert_equal 128 (get_i8 "\000\128" 1);  
+      );  
+    "get_i16" >:: (fun() ->
+        assert_equal 0 (get_i16 "\000\000" 0);  
+        assert_equal 1 (get_i16 "\000\001" 0);  
+        assert_equal 255 (get_i16 "\000\255" 0);  
+        assert_equal 256 (get_i16 "\001\000" 0);  
+        assert_equal 0xFFFF (get_i16 "\255\255" 0);  
+      );  
    ];;
 
 let _ = run_test_tt ~verbose: true test_fixture