From 8dff0fc121f451747ab00860a96006bfce7ec9e1 Mon Sep 17 00:00:00 2001 From: Peter Huene Date: Mon, 24 Feb 2020 17:56:55 -0800 Subject: [PATCH] Fix unit tests on Windows. Close the file descriptors before attempting to reopen the files. --- crates/misc/dotnet/tests/WasiTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/misc/dotnet/tests/WasiTests.cs b/crates/misc/dotnet/tests/WasiTests.cs index 48736f5ccb..5739a5c438 100644 --- a/crates/misc/dotnet/tests/WasiTests.cs +++ b/crates/misc/dotnet/tests/WasiTests.cs @@ -197,6 +197,7 @@ namespace Wasmtime.Tests Assert.Equal(0, inst.call_fd_write(fd, 0, 1, 32)); Assert.Equal(MESSAGE.Length, memory.ReadInt32(32)); + Assert.Equal(0, inst.call_fd_close(fd)); 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(MESSAGE.Length, memory.ReadInt32(64)); - Assert.Equal(MESSAGE, File.ReadAllText(file.Path)); - Assert.Equal(0, inst.call_fd_close(fileFd)); + Assert.Equal(MESSAGE, File.ReadAllText(file.Path)); } } }