From baa41697446631b0117f2d3723de56fe64c9c871 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 28 May 2026 08:35:21 +0100 Subject: [PATCH] Fix windows tests --- .../sys/windows/test_windows_generated.odin | 18 +++++++-------- tests/core/sys/windows/win32gen/win32gen.cpp | 22 +++++++++++-------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/tests/core/sys/windows/test_windows_generated.odin b/tests/core/sys/windows/test_windows_generated.odin index c9c7f6729..f859a8bed 100644 --- a/tests/core/sys/windows/test_windows_generated.odin +++ b/tests/core/sys/windows/test_windows_generated.odin @@ -680,17 +680,17 @@ verify_error_codes :: proc(t: ^testing.T) { @(test) verify_error_helpers :: proc(t: ^testing.T) { // winerror.h - expect_value(t, win32.SUCCEEDED(-1), 0x00000000) - expect_value(t, win32.SUCCEEDED(0), 0x00000001) - expect_value(t, win32.SUCCEEDED(1), 0x00000001) + expect_value(t, uint(win32.SUCCEEDED(-1)), 0x00000000) + expect_value(t, uint(win32.SUCCEEDED(0)), 0x00000001) + expect_value(t, uint(win32.SUCCEEDED(1)), 0x00000001) - expect_value(t, win32.FAILED(-1), 0x00000001) - expect_value(t, win32.FAILED(0), 0x00000000) - expect_value(t, win32.FAILED(1), 0x00000000) + expect_value(t, uint(win32.FAILED(-1)), 0x00000001) + expect_value(t, uint(win32.FAILED(0)), 0x00000000) + expect_value(t, uint(win32.FAILED(1)), 0x00000000) - expect_value(t, win32.IS_ERROR(-1), 0x00000001) - expect_value(t, win32.IS_ERROR(0), 0x00000000) - expect_value(t, win32.IS_ERROR(1), 0x00000000) + expect_value(t, uint(win32.IS_ERROR(-1)), 0x00000001) + expect_value(t, uint(win32.IS_ERROR(0)), 0x00000000) + expect_value(t, uint(win32.IS_ERROR(1)), 0x00000000) expect_value(t, win32.HRESULT_CODE(0xFFFFCCCC), 0x0000CCCC) expect_value(t, win32.HRESULT_FACILITY(0xFFFFCCCC), 0x00001FFF) diff --git a/tests/core/sys/windows/win32gen/win32gen.cpp b/tests/core/sys/windows/win32gen/win32gen.cpp index 13b9c25d4..a2ff66d09 100644 --- a/tests/core/sys/windows/win32gen/win32gen.cpp +++ b/tests/core/sys/windows/win32gen/win32gen.cpp @@ -55,6 +55,10 @@ static std::string ConvertLPCWSTRToString(const LPCWSTR lpcwszStr) << '\t' << "expect_value(t, win32." << #s << ", " \ << "0x" << std::uppercase << std::setfill('0') << std::setw(8) << std::hex << s << ")" << endl +#define expect_value_bool(s) out \ + << '\t' << "expect_value(t, uint(win32." << #s << "), " \ + << "0x" << std::uppercase << std::setfill('0') << std::setw(8) << std::hex << s << ")" << endl + #define expect_value_32(s) out \ << '\t' << "expect_value(t, u32(win32." << #s << "), " \ << "0x" << std::uppercase << std::setfill('0') << std::setw(8) << std::hex << (ULONG)(ULONG_PTR)(s) << ")" << endl @@ -882,17 +886,17 @@ static void verify_error_helpers(ofstream& out) { test_proc_begin(); test_proc_comment("winerror.h"); - expect_value(SUCCEEDED(-1)); - expect_value(SUCCEEDED(0)); - expect_value(SUCCEEDED(1)); + expect_value_bool(SUCCEEDED(-1)); + expect_value_bool(SUCCEEDED(0)); + expect_value_bool(SUCCEEDED(1)); out << endl; - expect_value(FAILED(-1)); - expect_value(FAILED(0)); - expect_value(FAILED(1)); + expect_value_bool(FAILED(-1)); + expect_value_bool(FAILED(0)); + expect_value_bool(FAILED(1)); out << endl; - expect_value(IS_ERROR(-1)); - expect_value(IS_ERROR(0)); - expect_value(IS_ERROR(1)); + expect_value_bool(IS_ERROR(-1)); + expect_value_bool(IS_ERROR(0)); + expect_value_bool(IS_ERROR(1)); out << endl; expect_value(HRESULT_CODE(0xFFFFCCCC)); expect_value(HRESULT_FACILITY(0xFFFFCCCC));