Skip to content

Commit 4eccd70

Browse files
authored
Fix failing tests after the changes in bytecodealliance/wasmtime#7285. (#280)
Since that change, threads, multi-memory, and relaxed-simd are enabled by default.
1 parent 2ddb909 commit 4eccd70

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

tests/ConfigTests.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public void ItSetsSIMD()
109109
{
110110
var config = new Config();
111111
config.WithSIMD(false);
112+
config.WithRelaxedSIMD(false, false);
112113

113114
Action act = () =>
114115
{
@@ -123,17 +124,23 @@ public void ItSetsSIMD()
123124
public void ItSetsRelaxedSIMD()
124125
{
125126
var config = new Config();
126-
config.WithRelaxedSIMD(true, true);
127+
config.WithRelaxedSIMD(false, false);
127128

128-
using var engine = new Engine(config);
129-
using var module = Module.FromTextFile(engine, Path.Combine("Modules", "RelaxedSIMD.wat"));
129+
Action act = () =>
130+
{
131+
using var engine = new Engine(config);
132+
using var module = Module.FromTextFile(engine, Path.Combine("Modules", "RelaxedSIMD.wat"));
133+
};
134+
135+
act.Should().Throw<WasmtimeException>();
130136
}
131137

132138
[Fact]
133139
public void ItSetsBulkMemory()
134140
{
135141
var config = new Config();
136142
config.WithBulkMemory(false);
143+
config.WithWasmThreads(false);
137144
config.WithReferenceTypes(false);
138145

139146
Action act = () =>

tests/MultiMemoryTests.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Linq;
32
using FluentAssertions;
43
using Xunit;
54

@@ -8,9 +7,9 @@ namespace Wasmtime.Tests
87
public class MultiMemoryTests
98
{
109
[Fact]
11-
public void ItFailsWithoutMultiMemoryEnabled()
10+
public void ItFailsWithMultiMemoryDisabled()
1211
{
13-
using var engine = new Engine();
12+
using var engine = new Engine(new Config().WithMultiMemory(false));
1413
Action action = () =>
1514
{
1615
using var module = Module.FromText(engine, "test", @"(module (memory 0 1) (memory 0 1))");
@@ -23,9 +22,9 @@ public void ItFailsWithoutMultiMemoryEnabled()
2322
}
2423

2524
[Fact]
26-
public void ItSucceedsWithMultiMemoryEnabled()
25+
public void ItSucceedsWithoutMultiMemoryDisabled()
2726
{
28-
using var engine = new Engine(new Config().WithMultiMemory(true));
27+
using var engine = new Engine();
2928
using var module = Module.FromText(engine, "test", @"(module (memory 0 1) (memory 0 1))");
3029
}
3130
}

0 commit comments

Comments
 (0)