Skip to content

Commit 13aa17a

Browse files
etrclaude
andcommitted
Fix CI: gate iovec_entry_test struct iovec bridge on !_WIN32
Same MSYS2/mingw constraint as iovec_response.cpp / body.cpp: no <sys/uio.h>, so the POSIX struct iovec reinterpret_cast bridge test must be gated. The MHD_IoVec bridge test below it covers the actual production cast on every platform and stays unconditional. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 098759d commit 13aa17a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

test/unit/iovec_entry_test.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
// is asserted separately by `header_hygiene_iovec_test.cpp`.
2626

2727
#include <microhttpd.h>
28-
#include <sys/uio.h>
28+
#ifndef _WIN32
29+
#include <sys/uio.h> // POSIX struct iovec — bridge test only on POSIX
30+
#endif
2931

3032
#include <cstddef>
3133
#include <type_traits>
@@ -73,6 +75,10 @@ LT_END_AUTO_TEST(brace_init_assigns_members)
7375
// POSIX struct iovec. This is the cast the library performs when feeding
7476
// libmicrohttpd, and what TASK-010 will rely on when it lands the
7577
// std::span<const iovec_entry> factory.
78+
//
79+
// Gated on !_WIN32: MSYS2/mingw does not ship <sys/uio.h>. The MHD_IoVec
80+
// bridge test below covers the actual production cast on every platform.
81+
#ifndef _WIN32
7682
LT_BEGIN_AUTO_TEST(iovec_entry_suite, reinterpret_cast_to_struct_iovec_preserves_data)
7783
const char* a = "abc";
7884
const char* b = "wxyz";
@@ -87,6 +93,7 @@ LT_BEGIN_AUTO_TEST(iovec_entry_suite, reinterpret_cast_to_struct_iovec_preserves
8793
LT_CHECK_EQ(posix[1].iov_base, const_cast<void*>(static_cast<const void*>(b)));
8894
LT_CHECK_EQ(posix[1].iov_len, 4u);
8995
LT_END_AUTO_TEST(reinterpret_cast_to_struct_iovec_preserves_data)
96+
#endif // !_WIN32
9097

9198
// Runtime bridge test for the actual production cast path: iovec_entry →
9299
// MHD_IoVec. Mirrors the struct iovec test above but exercises the type

0 commit comments

Comments
 (0)