Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert everything #14

Merged
merged 3 commits into from
Aug 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ml-proto/src/flags.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ let version = "0.1"

let interactive = ref false
let trace = ref false
let print_sig = ref true
let print_sig = ref false
let dry = ref false
8 changes: 0 additions & 8 deletions ml-proto/test/expected-output/fac.wasm.log

This file was deleted.

7 changes: 0 additions & 7 deletions ml-proto/test/expected-output/memory.wasm.log
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
export "data" : () -> i32
export "aligned" : () -> i32
export "unaligned" : () -> i32
export "cast" : () -> f64
1 : i32
1 : i32
1 : i32
-3.10552331246e+231 : f64
8 changes: 4 additions & 4 deletions ml-proto/test/fac.wasm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
(export "fac-iter-named" $fac-iter)
)

(invoke "fac-rec" (const.i64 25)) ;; 7034535277573963776 : i64
(invoke "fac-iter" (const.i64 25)) ;; 7034535277573963776 : i64
(invoke "fac-rec-named" (const.i64 25)) ;; 7034535277573963776 : i64
(invoke "fac-iter-named" (const.i64 25)) ;; 7034535277573963776 : i64
(asserteq (invoke "fac-rec" (const.i64 25)) (const.i64 7034535277573963776))
(asserteq (invoke "fac-iter" (const.i64 25)) (const.i64 7034535277573963776))
(asserteq (invoke "fac-rec-named" (const.i64 25)) (const.i64 7034535277573963776))
(asserteq (invoke "fac-iter-named" (const.i64 25)) (const.i64 7034535277573963776))
6 changes: 3 additions & 3 deletions ml-proto/test/memory.wasm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
(export "cast" $cast)
)

(invoke "data") ;; 1 : i32
(invoke "aligned") ;; 1 : i32
(invoke "unaligned") ;; 1 : i32
(asserteq (invoke "data") (const.i32 1))
(asserteq (invoke "aligned") (const.i32 1))
(asserteq (invoke "unaligned") (const.i32 1))
(invoke "cast") ;; -3.10552331246e+231 : f64
22 changes: 11 additions & 11 deletions ml-proto/test/multivalue.wasm
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@
(export "test" $test)
)

(invoke "test" (const.i32 1)) ;; (2 1) : (i32 i32)
(invoke "test" (const.i32 2)) ;; (2 1) : (i32 i32)
(invoke "test" (const.i32 3)) ;; (1 2) : (i32 i32)
(invoke "test" (const.i32 4)) ;; (1 2) : (i32 i32)
(invoke "test" (const.i32 5)) ;; (2 1) : (i32 i32)
(invoke "test" (const.i32 6)) ;; (3 1) : (i32 i32)
(invoke "test" (const.i32 7)) ;; (1 2) : (i32 i32)
(invoke "test" (const.i32 8)) ;; (2 1) : (i32 i32)
(invoke "test" (const.i32 9)) ;; (2 1) : (i32 i32)
(invoke "test" (const.i32 10)) ;; (1 2) : (i32 i32)
(invoke "test" (const.i32 11)) ;; (1 1) : (i32 i32)
(asserteq (invoke "test" (const.i32 1)) (const.i32 2) (const.i32 1))
(asserteq (invoke "test" (const.i32 2)) (const.i32 2) (const.i32 1))
(asserteq (invoke "test" (const.i32 3)) (const.i32 1) (const.i32 2))
(asserteq (invoke "test" (const.i32 4)) (const.i32 1) (const.i32 2))
(asserteq (invoke "test" (const.i32 5)) (const.i32 2) (const.i32 1))
(asserteq (invoke "test" (const.i32 6)) (const.i32 3) (const.i32 1))
(asserteq (invoke "test" (const.i32 7)) (const.i32 1) (const.i32 2))
(asserteq (invoke "test" (const.i32 8)) (const.i32 2) (const.i32 1))
(asserteq (invoke "test" (const.i32 9)) (const.i32 2) (const.i32 1))
(asserteq (invoke "test" (const.i32 10)) (const.i32 1) (const.i32 2))
(asserteq (invoke "test" (const.i32 11)) (const.i32 1) (const.i32 1))
32 changes: 16 additions & 16 deletions ml-proto/test/switch.wasm
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@
(export "expr" $expr)
)

(invoke "stmt" (const.i32 0)) ;; 0 : i32
(invoke "stmt" (const.i32 1)) ;; -1 : i32
(invoke "stmt" (const.i32 2)) ;; -2 : i32
(invoke "stmt" (const.i32 3)) ;; -3 : i32
(invoke "stmt" (const.i32 4)) ;; 100 : i32
(invoke "stmt" (const.i32 5)) ;; 101 : i32
(invoke "stmt" (const.i32 6)) ;; 102 : i32
(invoke "stmt" (const.i32 7)) ;; 102 : i32
(invoke "stmt" (const.i32 -10)) ;; 102 : i32
(asserteq (invoke "stmt" (const.i32 0)) (const.i32 0))
(asserteq (invoke "stmt" (const.i32 1)) (const.i32 -1))
(asserteq (invoke "stmt" (const.i32 2)) (const.i32 -2))
(asserteq (invoke "stmt" (const.i32 3)) (const.i32 -3))
(asserteq (invoke "stmt" (const.i32 4)) (const.i32 100))
(asserteq (invoke "stmt" (const.i32 5)) (const.i32 101))
(asserteq (invoke "stmt" (const.i32 6)) (const.i32 102))
(asserteq (invoke "stmt" (const.i32 7)) (const.i32 102))
(asserteq (invoke "stmt" (const.i32 -10)) (const.i32 102))

(invoke "expr" (const.i64 0)) ;; 0 : i64
(invoke "expr" (const.i64 1)) ;; -1 : i64
(invoke "expr" (const.i64 2)) ;; -2 : i64
(invoke "expr" (const.i64 3)) ;; -3 : i64
(invoke "expr" (const.i64 6)) ;; 101 : i64
(invoke "expr" (const.i64 7)) ;; 100 : i64
(invoke "expr" (const.i64 -10)) ;; 100 : i64
(asserteq (invoke "expr" (const.i64 0)) (const.i64 0))
(asserteq (invoke "expr" (const.i64 1)) (const.i64 -1))
(asserteq (invoke "expr" (const.i64 2)) (const.i64 -2))
(asserteq (invoke "expr" (const.i64 3)) (const.i64 -3))
(asserteq (invoke "expr" (const.i64 6)) (const.i64 101))
(asserteq (invoke "expr" (const.i64 7)) (const.i64 100))
(asserteq (invoke "expr" (const.i64 -10)) (const.i64 100))