diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-08-25 15:06:04 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-08-26 10:03:37 -0500 |
commit | a37208d9a26ec7886870cc17f0726676a285bf7f (patch) | |
tree | e620e863cd16801d126cee93eaca7b63293914cf /src/internal/WixBuildTools.TestSupport | |
parent | 6bd9fb04a9a8c1805a3e909583cca85c54dea7e4 (diff) | |
download | wix-a37208d9a26ec7886870cc17f0726676a285bf7f.tar.gz wix-a37208d9a26ec7886870cc17f0726676a285bf7f.tar.bz2 wix-a37208d9a26ec7886870cc17f0726676a285bf7f.zip |
Make sure error codes are translated correctly for per-machine packages.
Diffstat (limited to 'src/internal/WixBuildTools.TestSupport')
-rw-r--r-- | src/internal/WixBuildTools.TestSupport/XunitExtensions/SpecificReturnCodeException.cs | 9 | ||||
-rw-r--r-- | src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SpecificReturnCodeException.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/SpecificReturnCodeException.cs index c66890f8..c703e90a 100644 --- a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SpecificReturnCodeException.cs +++ b/src/internal/WixBuildTools.TestSupport/XunitExtensions/SpecificReturnCodeException.cs | |||
@@ -7,11 +7,12 @@ namespace WixBuildTools.TestSupport | |||
7 | 7 | ||
8 | public class SpecificReturnCodeException : XunitException | 8 | public class SpecificReturnCodeException : XunitException |
9 | { | 9 | { |
10 | public SpecificReturnCodeException(int hr, string userMessage) | 10 | public SpecificReturnCodeException(int hrExpected, int hr, string userMessage) |
11 | : base(String.Format("WixAssert.SpecificReturnCode() Failure\r\n" + | 11 | : base(String.Format("WixAssert.SpecificReturnCode() Failure\r\n" + |
12 | "HRESULT: 0x{0:X8}\r\n" + | 12 | "Expected HRESULT: 0x{0:X8}\r\n" + |
13 | "Message: {1}", | 13 | "Actual HRESULT: 0x{1:X8}\r\n" + |
14 | hr, userMessage)) | 14 | "Message: {2}", |
15 | hrExpected, hr, userMessage)) | ||
15 | { | 16 | { |
16 | this.HResult = hr; | 17 | this.HResult = hr; |
17 | } | 18 | } |
diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs index d8d02746..a8513bfb 100644 --- a/src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs +++ b/src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs | |||
@@ -58,7 +58,7 @@ namespace WixBuildTools.TestSupport | |||
58 | { | 58 | { |
59 | if (hrExpected != hr) | 59 | if (hrExpected != hr) |
60 | { | 60 | { |
61 | throw new SpecificReturnCodeException(hr, String.Format(format, formatArgs)); | 61 | throw new SpecificReturnCodeException(hrExpected, hr, String.Format(format, formatArgs)); |
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||