Skip to content

Commit 9978a74

Browse files
authored
[Test] Fix socket test on macos. (#2555)
* [Test] Fix socket test on macos. Signed-off-by: Tricster <[email protected]> * [CI] Turn on verbose log on macOS. Signed-off-by: Tricster <[email protected]> * [CI] Inspect return value. Signed-off-by: Tricster <[email protected]> * [Test] Statically cast int32 to bool on macOS. Signed-off-by: Tricster <[email protected]> * [CI] Add debug info. Signed-off-by: Tricster <[email protected]> * [Test] Remove reinterpret_cast from uint8_t* to bool* Signed-off-by: Tricster <[email protected]> * [CI] Add full test on macOS. Signed-off-by: Tricster <[email protected]> * [Test] Remove unneeded line. Signed-off-by: Tricster <[email protected]> --------- Signed-off-by: Tricster <[email protected]>
1 parent 8da0110 commit 9978a74

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

.github/workflows/reusable-build-on-macos.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,7 @@ jobs:
5050
run: |
5151
export DYLD_LIBRARY_PATH="$(pwd)/build/lib/api:$DYLD_LIBRARY_PATH"
5252
cd build
53-
ctest -E wasiSocketTests
54-
- name: Test WasmEdge (continue on error)
55-
continue-on-error: true
56-
run: |
57-
export DYLD_LIBRARY_PATH="$(pwd)/build/lib/api:$DYLD_LIBRARY_PATH"
58-
cd build
59-
ctest -R wasiSocketTests
53+
ctest
6054
- name: Create package tarball
6155
run: |
6256
cmake --build build --target package

test/host/socket/wasi_socket.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,8 @@ TEST(WasiSockTest, SockOpt) {
995995
Errno);
996996

997997
EXPECT_EQ(Errno[0].get<int32_t>(), __WASI_ERRNO_SUCCESS);
998-
EXPECT_TRUE(*MemInst.getPointer<const int32_t *>(ResBufPtr));
998+
EXPECT_TRUE(
999+
static_cast<bool>(*MemInst.getPointer<decltype(&Opt)>(ResBufPtr)));
9991000

10001001
WasiFdClose.run(CallFrame, std::array<WasmEdge::ValVariant, 1>{Fd}, Errno);
10011002
EXPECT_EQ(Errno[0].get<int32_t>(), __WASI_ERRNO_SUCCESS);

0 commit comments

Comments
 (0)