aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-05-13 13:50:50 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-05-14 11:12:31 -0500
commit6a6974a15deb6edf593736cdb8043bfb93064782 (patch)
tree0ae2afffcd02967ba3fe0f0a5d3e9273811f1e6f /src/test
parent7d56566b7c51c49ded526466dfae6af9e1709040 (diff)
downloadwix-6a6974a15deb6edf593736cdb8043bfb93064782.tar.gz
wix-6a6974a15deb6edf593736cdb8043bfb93064782.tar.bz2
wix-6a6974a15deb6edf593736cdb8043bfb93064782.zip
Move infinite loop detection into the hosts.
Tell the BA during Destroy whether it will be reloaded, and let the BA decide then whether it's module should be unloaded. Show error when infinite prereq loop detected. Only clip the exit code if they're Win32 errors. Set related bundle type to none to avoid downgrades during preqba.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/burn/TestBA/TestBA.cs8
-rw-r--r--src/test/burn/TestData/Manual/BafThmutilTesting/precomp.cpp2
-rw-r--r--src/test/burn/WixToolset.WixBA/WixBA.cs9
-rw-r--r--src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs6
4 files changed, 21 insertions, 4 deletions
diff --git a/src/test/burn/TestBA/TestBA.cs b/src/test/burn/TestBA/TestBA.cs
index 5f492efd..1548c05b 100644
--- a/src/test/burn/TestBA/TestBA.cs
+++ b/src/test/burn/TestBA/TestBA.cs
@@ -171,7 +171,13 @@ namespace WixToolset.Test.BA
171 this.dummyWindow.Dispose(); 171 this.dummyWindow.Dispose();
172 } 172 }
173 173
174 this.Engine.Quit(this.result & 0xFFFF); // return plain old Win32 error, not HRESULT. 174 var exitCode = this.result;
175 if ((exitCode & 0xFFFF0000) == unchecked(0x80070000))
176 {
177 exitCode &= 0xFFFF; // return plain old Win32 error, not HRESULT.
178 }
179
180 this.Engine.Quit(exitCode);
175 } 181 }
176 182
177 protected override void OnDetectUpdateBegin(DetectUpdateBeginEventArgs args) 183 protected override void OnDetectUpdateBegin(DetectUpdateBeginEventArgs args)
diff --git a/src/test/burn/TestData/Manual/BafThmutilTesting/precomp.cpp b/src/test/burn/TestData/Manual/BafThmutilTesting/precomp.cpp
index b20f4230..fc9d1177 100644
--- a/src/test/burn/TestData/Manual/BafThmutilTesting/precomp.cpp
+++ b/src/test/burn/TestData/Manual/BafThmutilTesting/precomp.cpp
@@ -40,6 +40,8 @@ LExit:
40} 40}
41 41
42extern "C" void WINAPI BAFunctionsDestroy( 42extern "C" void WINAPI BAFunctionsDestroy(
43 __in const BA_FUNCTIONS_DESTROY_ARGS* /*pArgs*/,
44 __inout BA_FUNCTIONS_DESTROY_RESULTS* /*pResults*/
43 ) 45 )
44{ 46{
45 BalUninitialize(); 47 BalUninitialize();
diff --git a/src/test/burn/WixToolset.WixBA/WixBA.cs b/src/test/burn/WixToolset.WixBA/WixBA.cs
index 68288f2d..60426ca8 100644
--- a/src/test/burn/WixToolset.WixBA/WixBA.cs
+++ b/src/test/burn/WixToolset.WixBA/WixBA.cs
@@ -179,7 +179,14 @@ namespace WixToolset.WixBA
179 Threading.Dispatcher.Run(); 179 Threading.Dispatcher.Run();
180 180
181 this.PostTelemetry(); 181 this.PostTelemetry();
182 this.Engine.Quit(WixBA.Model.Result); 182
183 var exitCode = WixBA.Model.Result;
184 if ((exitCode & 0xFFFF0000) == unchecked(0x80070000))
185 {
186 exitCode &= 0xFFFF; // return plain old Win32 error, not HRESULT.
187 }
188
189 this.Engine.Quit(exitCode);
183 } 190 }
184 191
185 private void PostTelemetry() 192 private void PostTelemetry()
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs
index ec828f89..52e165b4 100644
--- a/src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs
+++ b/src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs
@@ -12,6 +12,8 @@ namespace WixToolsetTest.BurnE2E
12 { 12 {
13 public PrereqBaTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } 13 public PrereqBaTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
14 14
15 const int E_PREREQBA_INFINITE_LOOP = -2_114_714_646;
16
15 /// <summary> 17 /// <summary>
16 /// This bundle purposely provides a .runtimeconfig.json file that requires a version of .NET Core that doesn't exist, 18 /// This bundle purposely provides a .runtimeconfig.json file that requires a version of .NET Core that doesn't exist,
17 /// with an MSI package to represent the prerequisite package. 19 /// with an MSI package to represent the prerequisite package.
@@ -32,7 +34,7 @@ namespace WixToolsetTest.BurnE2E
32 // Source file should *not* be installed 34 // Source file should *not* be installed
33 Assert.False(File.Exists(packageASourceCodeInstalled), $"Package A payload should not be there on test start: {packageASourceCodeInstalled}"); 35 Assert.False(File.Exists(packageASourceCodeInstalled), $"Package A payload should not be there on test start: {packageASourceCodeInstalled}");
34 36
35 bundleA.Install(); 37 bundleA.Install(E_PREREQBA_INFINITE_LOOP);
36 38
37 // Part of the test is Install actually completing. 39 // Part of the test is Install actually completing.
38 40
@@ -63,7 +65,7 @@ namespace WixToolsetTest.BurnE2E
63 // Source file should *not* be installed 65 // Source file should *not* be installed
64 Assert.False(File.Exists(packageBSourceCodeInstalled), $"Package B payload should not be there on test start: {packageBSourceCodeInstalled}"); 66 Assert.False(File.Exists(packageBSourceCodeInstalled), $"Package B payload should not be there on test start: {packageBSourceCodeInstalled}");
65 67
66 bundleB.Install(); 68 bundleB.Install(E_PREREQBA_INFINITE_LOOP);
67 69
68 // Part of the test is Install actually completing. 70 // Part of the test is Install actually completing.
69 71