Skip to content

Commit

Permalink
Move tests around
Browse files Browse the repository at this point in the history
  • Loading branch information
SoniEx2 committed Sep 12, 2024
1 parent 78cbbca commit 0be97af
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
22 changes: 22 additions & 0 deletions test/core/binary.wast
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,28 @@
"\01\00") ;; Passive data section
"data count and data section have inconsistent lengths")

;; Data count section without data segment section
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\01\04\01\60\00\00" ;; Type section: 1 type
"\03\02\01\00" ;; Function section: 1 function
"\05\03\01\00\01" ;; Memory section: 1 memory
"\08\01\00" ;; Start section: function 0
"\0c\01\01" ;; Data Count section: 1 segment
"\0a\0e\01" ;; Code section: 1 function

;; function 0
"\0c\00"
"\41\00" ;; i32.const 0
"\41\00" ;; i32.const 0
"\41\00" ;; i32.const 0
"\fc\08\00\00" ;; memory.init dataidx=0 memidx=0
"\0b" ;; end
)
"data count and data section have inconsistent lengths"
)

;; memory.init requires a datacount section
(assert_malformed
(module binary
Expand Down
23 changes: 0 additions & 23 deletions test/core/data.wast
Original file line number Diff line number Diff line change
Expand Up @@ -496,26 +496,3 @@
)
"constant expression required"
)

;; Data count without data segment

(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\01\04\01\60\00\00" ;; Type section: 1 type
"\03\02\01\00" ;; Function section: 1 function
"\05\03\01\00\01" ;; Memory section: 1 memory
"\08\01\00" ;; Start section: function 0
"\0c\01\01" ;; Data Count section: 1 segment
"\0a\0e\01" ;; Code section: 1 function

;; function 0
"\0c\00"
"\41\00" ;; i32.const 0
"\41\00" ;; i32.const 0
"\41\00" ;; i32.const 0
"\fc\08\00\00" ;; memory.init dataidx=0 memidx=0
"\0b" ;; end
)
"data count and data section have inconsistent lengths"
)

0 comments on commit 0be97af

Please sign in to comment.