Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

[test] Uniform failure strings #117

Merged
merged 1 commit into from
Sep 23, 2020
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
12 changes: 6 additions & 6 deletions test/core/bulk.wast
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@
(invoke "drop_passive")
(invoke "drop_passive")
(assert_return (invoke "init_passive" (i32.const 0)))
(assert_trap (invoke "init_passive" (i32.const 1)) "out of bounds")
(assert_trap (invoke "init_passive" (i32.const 1)) "out of bounds memory access")
(invoke "init_passive" (i32.const 0))
(invoke "drop_active")
(assert_return (invoke "init_active" (i32.const 0)))
(assert_trap (invoke "init_active" (i32.const 1)) "out of bounds")
(assert_trap (invoke "init_active" (i32.const 1)) "out of bounds memory access")
(invoke "init_active" (i32.const 0))

;; Test that the data segment index is properly encoded as an unsigned (not
Expand Down Expand Up @@ -262,11 +262,11 @@
(invoke "drop_passive")
(invoke "drop_passive")
(assert_return (invoke "init_passive" (i32.const 0)))
(assert_trap (invoke "init_passive" (i32.const 1)) "out of bounds")
(assert_trap (invoke "init_passive" (i32.const 1)) "out of bounds table access")
(invoke "init_passive" (i32.const 0))
(invoke "drop_active")
(assert_return (invoke "init_active" (i32.const 0)))
(assert_trap (invoke "init_active" (i32.const 1)) "out of bounds")
(assert_trap (invoke "init_active" (i32.const 1)) "out of bounds table access")
(invoke "init_active" (i32.const 0))

;; Test that the elem segment index is properly encoded as an unsigned (not
Expand Down Expand Up @@ -346,6 +346,6 @@

;; Fail on out-of-bounds when copying 0 elements outside of table.
(assert_trap (invoke "copy" (i32.const 11) (i32.const 0) (i32.const 0))
"out of bounds")
"out of bounds table access")
(assert_trap (invoke "copy" (i32.const 0) (i32.const 11) (i32.const 0))
"out of bounds")
"out of bounds table access")
28 changes: 14 additions & 14 deletions test/core/data.wast
Original file line number Diff line number Diff line change
Expand Up @@ -175,37 +175,37 @@
(memory 0)
(data (i32.const 0) "a")
)
"out of bounds"
"out of bounds memory access"
)

(assert_trap
(module
(memory 0 0)
(data (i32.const 0) "a")
)
"out of bounds"
"out of bounds memory access"
)

(assert_trap
(module
(memory 0 1)
(data (i32.const 0) "a")
)
"out of bounds"
"out of bounds memory access"
)
(assert_trap
(module
(memory 0)
(data (i32.const 1))
)
"out of bounds"
"out of bounds memory access"
)
(assert_trap
(module
(memory 0 1)
(data (i32.const 1))
)
"out of bounds"
"out of bounds memory access"
)

;; This seems to cause a time-out on Travis.
Expand All @@ -223,68 +223,68 @@
(memory 0)
(data (global.get 0) "a")
)
"out of bounds"
"out of bounds memory access"
)

(assert_trap
(module
(memory 1 2)
(data (i32.const 0x1_0000) "a")
)
"out of bounds"
"out of bounds memory access"
)
(assert_trap
(module
(import "spectest" "memory" (memory 1))
(data (i32.const 0x1_0000) "a")
)
"out of bounds"
"out of bounds memory access"
)

(assert_trap
(module
(memory 2)
(data (i32.const 0x2_0000) "a")
)
"out of bounds"
"out of bounds memory access"
)

(assert_trap
(module
(memory 2 3)
(data (i32.const 0x2_0000) "a")
)
"out of bounds"
"out of bounds memory access"
)

(assert_trap
(module
(memory 1)
(data (i32.const -1) "a")
)
"out of bounds"
"out of bounds memory access"
)
(assert_trap
(module
(import "spectest" "memory" (memory 1))
(data (i32.const -1) "a")
)
"out of bounds"
"out of bounds memory access"
)

(assert_trap
(module
(memory 2)
(data (i32.const -100) "a")
)
"out of bounds"
"out of bounds memory access"
)
(assert_trap
(module
(import "spectest" "memory" (memory 1))
(data (i32.const -100) "a")
)
"out of bounds"
"out of bounds memory access"
)

;; Data without memory
Expand Down
28 changes: 14 additions & 14 deletions test/core/elem.wast
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
(func $f)
(elem (i32.const 0) $f)
)
"out of bounds"
"out of bounds table access"
)

(assert_trap
Expand All @@ -220,7 +220,7 @@
(func $f)
(elem (i32.const 0) $f)
)
"out of bounds"
"out of bounds table access"
)

(assert_trap
Expand All @@ -229,31 +229,31 @@
(func $f)
(elem (i32.const 0) $f)
)
"out of bounds"
"out of bounds table access"
)

(assert_trap
(module
(table 0 funcref)
(elem (i32.const 1))
)
"out of bounds"
"out of bounds table access"
)
(assert_trap
(module
(table 10 funcref)
(func $f)
(elem (i32.const 10) $f)
)
"out of bounds"
"out of bounds table access"
)
(assert_trap
(module
(import "spectest" "table" (table 10 funcref))
(func $f)
(elem (i32.const 10) $f)
)
"out of bounds"
"out of bounds table access"
)

(assert_trap
Expand All @@ -262,15 +262,15 @@
(func $f)
(elem (i32.const 10) $f)
)
"out of bounds"
"out of bounds table access"
)
(assert_trap
(module
(import "spectest" "table" (table 10 funcref))
(func $f)
(elem (i32.const 10) $f)
)
"out of bounds"
"out of bounds table access"
)

(assert_trap
Expand All @@ -279,15 +279,15 @@
(func $f)
(elem (i32.const -1) $f)
)
"out of bounds"
"out of bounds table access"
)
(assert_trap
(module
(import "spectest" "table" (table 10 funcref))
(func $f)
(elem (i32.const -1) $f)
)
"out of bounds"
"out of bounds table access"
)

(assert_trap
Expand All @@ -296,15 +296,15 @@
(func $f)
(elem (i32.const -10) $f)
)
"out of bounds"
"out of bounds table access"
)
(assert_trap
(module
(import "spectest" "table" (table 10 funcref))
(func $f)
(elem (i32.const -10) $f)
)
"out of bounds"
"out of bounds table access"
)

;; Implicitly dropped elements
Expand All @@ -317,7 +317,7 @@
(table.init $e (i32.const 0) (i32.const 0) (i32.const 1))
)
)
(assert_trap (invoke "init") "out of bounds")
(assert_trap (invoke "init") "out of bounds table access")

(module
(table 10 funcref)
Expand All @@ -327,7 +327,7 @@
(table.init $e (i32.const 0) (i32.const 0) (i32.const 1))
)
)
(assert_trap (invoke "init") "out of bounds")
(assert_trap (invoke "init") "out of bounds table access")

;; Element without table

Expand Down
Loading