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

Commit 4495265

Browse files
authored
[test] Uniform failure strings (#117)
1 parent 8f5038e commit 4495265

12 files changed

+152
-152
lines changed

test/core/bulk.wast

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@
169169
(invoke "drop_passive")
170170
(invoke "drop_passive")
171171
(assert_return (invoke "init_passive" (i32.const 0)))
172-
(assert_trap (invoke "init_passive" (i32.const 1)) "out of bounds")
172+
(assert_trap (invoke "init_passive" (i32.const 1)) "out of bounds memory access")
173173
(invoke "init_passive" (i32.const 0))
174174
(invoke "drop_active")
175175
(assert_return (invoke "init_active" (i32.const 0)))
176-
(assert_trap (invoke "init_active" (i32.const 1)) "out of bounds")
176+
(assert_trap (invoke "init_active" (i32.const 1)) "out of bounds memory access")
177177
(invoke "init_active" (i32.const 0))
178178

179179
;; Test that the data segment index is properly encoded as an unsigned (not
@@ -262,11 +262,11 @@
262262
(invoke "drop_passive")
263263
(invoke "drop_passive")
264264
(assert_return (invoke "init_passive" (i32.const 0)))
265-
(assert_trap (invoke "init_passive" (i32.const 1)) "out of bounds")
265+
(assert_trap (invoke "init_passive" (i32.const 1)) "out of bounds table access")
266266
(invoke "init_passive" (i32.const 0))
267267
(invoke "drop_active")
268268
(assert_return (invoke "init_active" (i32.const 0)))
269-
(assert_trap (invoke "init_active" (i32.const 1)) "out of bounds")
269+
(assert_trap (invoke "init_active" (i32.const 1)) "out of bounds table access")
270270
(invoke "init_active" (i32.const 0))
271271

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

347347
;; Fail on out-of-bounds when copying 0 elements outside of table.
348348
(assert_trap (invoke "copy" (i32.const 11) (i32.const 0) (i32.const 0))
349-
"out of bounds")
349+
"out of bounds table access")
350350
(assert_trap (invoke "copy" (i32.const 0) (i32.const 11) (i32.const 0))
351-
"out of bounds")
351+
"out of bounds table access")

test/core/data.wast

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -175,37 +175,37 @@
175175
(memory 0)
176176
(data (i32.const 0) "a")
177177
)
178-
"out of bounds"
178+
"out of bounds memory access"
179179
)
180180

181181
(assert_trap
182182
(module
183183
(memory 0 0)
184184
(data (i32.const 0) "a")
185185
)
186-
"out of bounds"
186+
"out of bounds memory access"
187187
)
188188

189189
(assert_trap
190190
(module
191191
(memory 0 1)
192192
(data (i32.const 0) "a")
193193
)
194-
"out of bounds"
194+
"out of bounds memory access"
195195
)
196196
(assert_trap
197197
(module
198198
(memory 0)
199199
(data (i32.const 1))
200200
)
201-
"out of bounds"
201+
"out of bounds memory access"
202202
)
203203
(assert_trap
204204
(module
205205
(memory 0 1)
206206
(data (i32.const 1))
207207
)
208-
"out of bounds"
208+
"out of bounds memory access"
209209
)
210210

211211
;; This seems to cause a time-out on Travis.
@@ -223,68 +223,68 @@
223223
(memory 0)
224224
(data (global.get 0) "a")
225225
)
226-
"out of bounds"
226+
"out of bounds memory access"
227227
)
228228

229229
(assert_trap
230230
(module
231231
(memory 1 2)
232232
(data (i32.const 0x1_0000) "a")
233233
)
234-
"out of bounds"
234+
"out of bounds memory access"
235235
)
236236
(assert_trap
237237
(module
238238
(import "spectest" "memory" (memory 1))
239239
(data (i32.const 0x1_0000) "a")
240240
)
241-
"out of bounds"
241+
"out of bounds memory access"
242242
)
243243

244244
(assert_trap
245245
(module
246246
(memory 2)
247247
(data (i32.const 0x2_0000) "a")
248248
)
249-
"out of bounds"
249+
"out of bounds memory access"
250250
)
251251

252252
(assert_trap
253253
(module
254254
(memory 2 3)
255255
(data (i32.const 0x2_0000) "a")
256256
)
257-
"out of bounds"
257+
"out of bounds memory access"
258258
)
259259

260260
(assert_trap
261261
(module
262262
(memory 1)
263263
(data (i32.const -1) "a")
264264
)
265-
"out of bounds"
265+
"out of bounds memory access"
266266
)
267267
(assert_trap
268268
(module
269269
(import "spectest" "memory" (memory 1))
270270
(data (i32.const -1) "a")
271271
)
272-
"out of bounds"
272+
"out of bounds memory access"
273273
)
274274

275275
(assert_trap
276276
(module
277277
(memory 2)
278278
(data (i32.const -100) "a")
279279
)
280-
"out of bounds"
280+
"out of bounds memory access"
281281
)
282282
(assert_trap
283283
(module
284284
(import "spectest" "memory" (memory 1))
285285
(data (i32.const -100) "a")
286286
)
287-
"out of bounds"
287+
"out of bounds memory access"
288288
)
289289

290290
;; Data without memory

test/core/elem.wast

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
(func $f)
212212
(elem (i32.const 0) $f)
213213
)
214-
"out of bounds"
214+
"out of bounds table access"
215215
)
216216

217217
(assert_trap
@@ -220,7 +220,7 @@
220220
(func $f)
221221
(elem (i32.const 0) $f)
222222
)
223-
"out of bounds"
223+
"out of bounds table access"
224224
)
225225

226226
(assert_trap
@@ -229,31 +229,31 @@
229229
(func $f)
230230
(elem (i32.const 0) $f)
231231
)
232-
"out of bounds"
232+
"out of bounds table access"
233233
)
234234

235235
(assert_trap
236236
(module
237237
(table 0 funcref)
238238
(elem (i32.const 1))
239239
)
240-
"out of bounds"
240+
"out of bounds table access"
241241
)
242242
(assert_trap
243243
(module
244244
(table 10 funcref)
245245
(func $f)
246246
(elem (i32.const 10) $f)
247247
)
248-
"out of bounds"
248+
"out of bounds table access"
249249
)
250250
(assert_trap
251251
(module
252252
(import "spectest" "table" (table 10 funcref))
253253
(func $f)
254254
(elem (i32.const 10) $f)
255255
)
256-
"out of bounds"
256+
"out of bounds table access"
257257
)
258258

259259
(assert_trap
@@ -262,15 +262,15 @@
262262
(func $f)
263263
(elem (i32.const 10) $f)
264264
)
265-
"out of bounds"
265+
"out of bounds table access"
266266
)
267267
(assert_trap
268268
(module
269269
(import "spectest" "table" (table 10 funcref))
270270
(func $f)
271271
(elem (i32.const 10) $f)
272272
)
273-
"out of bounds"
273+
"out of bounds table access"
274274
)
275275

276276
(assert_trap
@@ -279,15 +279,15 @@
279279
(func $f)
280280
(elem (i32.const -1) $f)
281281
)
282-
"out of bounds"
282+
"out of bounds table access"
283283
)
284284
(assert_trap
285285
(module
286286
(import "spectest" "table" (table 10 funcref))
287287
(func $f)
288288
(elem (i32.const -1) $f)
289289
)
290-
"out of bounds"
290+
"out of bounds table access"
291291
)
292292

293293
(assert_trap
@@ -296,15 +296,15 @@
296296
(func $f)
297297
(elem (i32.const -10) $f)
298298
)
299-
"out of bounds"
299+
"out of bounds table access"
300300
)
301301
(assert_trap
302302
(module
303303
(import "spectest" "table" (table 10 funcref))
304304
(func $f)
305305
(elem (i32.const -10) $f)
306306
)
307-
"out of bounds"
307+
"out of bounds table access"
308308
)
309309

310310
;; Implicitly dropped elements
@@ -317,7 +317,7 @@
317317
(table.init $e (i32.const 0) (i32.const 0) (i32.const 1))
318318
)
319319
)
320-
(assert_trap (invoke "init") "out of bounds")
320+
(assert_trap (invoke "init") "out of bounds table access")
321321

322322
(module
323323
(table 10 funcref)
@@ -327,7 +327,7 @@
327327
(table.init $e (i32.const 0) (i32.const 0) (i32.const 1))
328328
)
329329
)
330-
(assert_trap (invoke "init") "out of bounds")
330+
(assert_trap (invoke "init") "out of bounds table access")
331331

332332
;; Element without table
333333

0 commit comments

Comments
 (0)