Commits

Alexey Kishkin committed 69c8559

add set_int32 test

Comments (0)

Files changed (1)

        assert_equal "\000\001\000\000" (let cargo = Buffer.create 4 in (set_i32 cargo 0x10000; Buffer.contents cargo));
        assert_equal "\000\255\255\255" (let cargo = Buffer.create 4 in (set_i32 cargo 0xFFFFFF; Buffer.contents cargo));
        assert_equal "\001\000\000\000" (let cargo = Buffer.create 4 in (set_i32 cargo 0x1000000; Buffer.contents cargo));
+      );
+   "set_int32" >:: (fun() ->  
+       assert_equal "\000\000\000\000" (let cargo = Buffer.create 4 in (set_int32 cargo 0l; Buffer.contents cargo)); 
+       assert_equal "\000\000\000\010" (let cargo = Buffer.create 4 in (set_int32 cargo 10l; Buffer.contents cargo)); 
+       assert_equal "\000\000\000\255" (let cargo = Buffer.create 4 in (set_int32 cargo 255l; Buffer.contents cargo));
+       assert_equal "\000\000\001\000" (let cargo = Buffer.create 4 in (set_int32 cargo 256l; Buffer.contents cargo));
+       assert_equal "\000\000\255\255" (let cargo = Buffer.create 4 in (set_int32 cargo 0xFFFFl; Buffer.contents cargo));
+       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));
       )
    ];;
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.