Fix unit tests on Windows.

Close the file descriptors before attempting to reopen the files.
This commit is contained in:
Peter Huene
2020-02-24 17:56:55 -08:00
parent 11dec4d788
commit 8dff0fc121

View File

@@ -197,6 +197,7 @@ namespace Wasmtime.Tests
Assert.Equal(0, inst.call_fd_write(fd, 0, 1, 32)); Assert.Equal(0, inst.call_fd_write(fd, 0, 1, 32));
Assert.Equal(MESSAGE.Length, memory.ReadInt32(32)); Assert.Equal(MESSAGE.Length, memory.ReadInt32(32));
Assert.Equal(0, inst.call_fd_close(fd));
Assert.Equal(MESSAGE, File.ReadAllText(file.Path)); Assert.Equal(MESSAGE, File.ReadAllText(file.Path));
} }
} }
@@ -241,9 +242,8 @@ namespace Wasmtime.Tests
Assert.Equal(0, inst.call_fd_write(fileFd, 0, 1, 64)); Assert.Equal(0, inst.call_fd_write(fileFd, 0, 1, 64));
Assert.Equal(MESSAGE.Length, memory.ReadInt32(64)); Assert.Equal(MESSAGE.Length, memory.ReadInt32(64));
Assert.Equal(MESSAGE, File.ReadAllText(file.Path));
Assert.Equal(0, inst.call_fd_close(fileFd)); Assert.Equal(0, inst.call_fd_close(fileFd));
Assert.Equal(MESSAGE, File.ReadAllText(file.Path));
} }
} }
} }