From d652dda1f0e0ce8b51bb742112b79bda48e22635 Mon Sep 17 00:00:00 2001 From: kpreisser Date: Fri, 20 Oct 2023 16:35:46 +0200 Subject: [PATCH] Fix failing tests after the changes in bytecodealliance/wasmtime#7285. Since that change, threads, multi-memory, and relaxed-simd are enabled by default. --- tests/ConfigTests.cs | 13 ++++++++++--- tests/MultiMemoryTests.cs | 9 ++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/ConfigTests.cs b/tests/ConfigTests.cs index 5210889..a532857 100644 --- a/tests/ConfigTests.cs +++ b/tests/ConfigTests.cs @@ -109,6 +109,7 @@ public void ItSetsSIMD() { var config = new Config(); config.WithSIMD(false); + config.WithRelaxedSIMD(false, false); Action act = () => { @@ -123,10 +124,15 @@ public void ItSetsSIMD() public void ItSetsRelaxedSIMD() { var config = new Config(); - config.WithRelaxedSIMD(true, true); + config.WithRelaxedSIMD(false, false); - using var engine = new Engine(config); - using var module = Module.FromTextFile(engine, Path.Combine("Modules", "RelaxedSIMD.wat")); + Action act = () => + { + using var engine = new Engine(config); + using var module = Module.FromTextFile(engine, Path.Combine("Modules", "RelaxedSIMD.wat")); + }; + + act.Should().Throw(); } [Fact] @@ -134,6 +140,7 @@ public void ItSetsBulkMemory() { var config = new Config(); config.WithBulkMemory(false); + config.WithWasmThreads(false); config.WithReferenceTypes(false); Action act = () => diff --git a/tests/MultiMemoryTests.cs b/tests/MultiMemoryTests.cs index 33e669f..713b08a 100644 --- a/tests/MultiMemoryTests.cs +++ b/tests/MultiMemoryTests.cs @@ -1,5 +1,4 @@ using System; -using System.Linq; using FluentAssertions; using Xunit; @@ -8,9 +7,9 @@ namespace Wasmtime.Tests public class MultiMemoryTests { [Fact] - public void ItFailsWithoutMultiMemoryEnabled() + public void ItFailsWithMultiMemoryDisabled() { - using var engine = new Engine(); + using var engine = new Engine(new Config().WithMultiMemory(false)); Action action = () => { using var module = Module.FromText(engine, "test", @"(module (memory 0 1) (memory 0 1))"); @@ -23,9 +22,9 @@ public void ItFailsWithoutMultiMemoryEnabled() } [Fact] - public void ItSucceedsWithMultiMemoryEnabled() + public void ItSucceedsWithoutMultiMemoryDisabled() { - using var engine = new Engine(new Config().WithMultiMemory(true)); + using var engine = new Engine(); using var module = Module.FromText(engine, "test", @"(module (memory 0 1) (memory 0 1))"); } }