From fb4f8c7108f43d2341ba299424646c4963b21188 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 26 May 2022 17:33:15 -0500 Subject: Replace PathIsAbsolute with PathIsRooted and add PathIsFullyQualified. --- .../WixBuildTools.TestSupport.Native/NativeAssert.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/internal/WixBuildTools.TestSupport.Native/NativeAssert.h') diff --git a/src/internal/WixBuildTools.TestSupport.Native/NativeAssert.h b/src/internal/WixBuildTools.TestSupport.Native/NativeAssert.h index 62ace4a9..b0206b14 100644 --- a/src/internal/WixBuildTools.TestSupport.Native/NativeAssert.h +++ b/src/internal/WixBuildTools.TestSupport.Native/NativeAssert.h @@ -64,6 +64,27 @@ namespace TestSupport { WixAssert::Succeeded(hr, gcnew String(zFormat), formatArgs); } + static void SpecificReturnCode(HRESULT hrExpected, HRESULT hr, LPCSTR zFormat, LPCSTR zArg, ... array^ zArgs) + { + array^ formatArgs = gcnew array(zArgs->Length + 1); + formatArgs[0] = NativeAssert::LPSTRToString(zArg); + for (int i = 0; i < zArgs->Length; ++i) + { + formatArgs[i + 1] = NativeAssert::LPSTRToString(zArgs[i]); + } + WixAssert::SpecificReturnCode(hrExpected, hr, gcnew String(zFormat), formatArgs); + } + + static void SpecificReturnCode(HRESULT hrExpected, HRESULT hr, LPCSTR zFormat, ... array^ wzArgs) + { + array^ formatArgs = gcnew array(wzArgs->Length); + for (int i = 0; i < wzArgs->Length; ++i) + { + formatArgs[i] = NativeAssert::LPWSTRToString(wzArgs[i]); + } + WixAssert::SpecificReturnCode(hrExpected, hr, gcnew String(zFormat), formatArgs); + } + static void ValidReturnCode(HRESULT hr, ... array^ validReturnCodes) { Assert::Contains(hr, (IEnumerable^)validReturnCodes); -- cgit v1.2.3-55-g6feb