Skip to content

Commit

Permalink
Fix failing tests after the changes in bytecodealliance/wasmtime#7285. (
Browse files Browse the repository at this point in the history
#280)

Since that change, threads, multi-memory, and relaxed-simd are enabled by default.
  • Loading branch information
kpreisser authored Oct 23, 2023
1 parent 2ddb909 commit 4eccd70
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
13 changes: 10 additions & 3 deletions tests/ConfigTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public void ItSetsSIMD()
{
var config = new Config();
config.WithSIMD(false);
config.WithRelaxedSIMD(false, false);

Action act = () =>
{
Expand All @@ -123,17 +124,23 @@ 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<WasmtimeException>();
}

[Fact]
public void ItSetsBulkMemory()
{
var config = new Config();
config.WithBulkMemory(false);
config.WithWasmThreads(false);
config.WithReferenceTypes(false);

Action act = () =>
Expand Down
9 changes: 4 additions & 5 deletions tests/MultiMemoryTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Linq;
using FluentAssertions;
using Xunit;

Expand All @@ -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))");
Expand All @@ -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))");
}
}
Expand Down

0 comments on commit 4eccd70

Please sign in to comment.