summaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_datacount.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/test_datacount.py b/test/unit/test_datacount.py
new file mode 100644
index 000000000..5ec98c549
--- /dev/null
+++ b/test/unit/test_datacount.py
@@ -0,0 +1,15 @@
+from scripts.test.shared import WASM_OPT, run_process
+from utils import BinaryenTestCase
+
+
+class DataCountTest(BinaryenTestCase):
+ def test_datacount(self):
+ self.roundtrip('bulkmem_data.wasm')
+
+ def test_bad_datacount(self):
+ path = self.input_path('bulkmem_bad_datacount.wasm')
+ p = run_process(WASM_OPT + ['-g', '-o', '-', path], check=False,
+ capture_output=True)
+ self.assertNotEqual(p.returncode, 0)
+ self.assertIn('Number of segments does not agree with DataCount section',
+ p.stderr)