diff options
author | Keith Winstein <keithw@cs.stanford.edu> | 2022-07-13 18:06:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-14 01:06:53 +0000 |
commit | ec53e183716f39741bee01f8d7f4d18d76ced695 (patch) | |
tree | 3424e1f658762d129a1c265f65d355bb247f89ad /test/spec-wasm2c-prefix.c | |
parent | 54c55355c95fdbe5288c7f690fe63f626bb26b7d (diff) | |
download | wabt-ec53e183716f39741bee01f8d7f4d18d76ced695.tar.gz wabt-ec53e183716f39741bee01f8d7f4d18d76ced695.tar.bz2 wabt-ec53e183716f39741bee01f8d7f4d18d76ced695.zip |
wasm2c: implement the exception-handling proposal (#1930)
(The imports.txt and exports.txt tests require multi-table and
are disabled until reference types is supported.)
Diffstat (limited to 'test/spec-wasm2c-prefix.c')
-rw-r--r-- | test/spec-wasm2c-prefix.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/spec-wasm2c-prefix.c b/test/spec-wasm2c-prefix.c index 4415be6f..8e570588 100644 --- a/test/spec-wasm2c-prefix.c +++ b/test/spec-wasm2c-prefix.c @@ -25,6 +25,17 @@ static void error(const char* file, int line, const char* format, ...) { va_end(args); } +#define ASSERT_EXCEPTION(f) \ + do { \ + g_tests_run++; \ + if (wasm_rt_impl_try() == WASM_RT_TRAP_UNCAUGHT_EXCEPTION) { \ + g_tests_passed++; \ + } else { \ + (void)(f); \ + error(__FILE__, __LINE__, "expected " #f " to throw exception.\n"); \ + } \ + } while (0) + #define ASSERT_TRAP(f) \ do { \ g_tests_run++; \ |