aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2024-04-04 15:41:57 -0700
committerRob Mensching <rob@firegiant.com>2024-04-04 16:33:49 -0700
commitba93485c940b0bae6e0b6a005fdd1819652f3984 (patch)
treef887f83dc535fc108e399e0f2a886beb71945bde /src/test
parentf9ae2561ac4a39ba810234db3b562ca2898ccaf4 (diff)
downloadwix-ba93485c940b0bae6e0b6a005fdd1819652f3984.tar.gz
wix-ba93485c940b0bae6e0b6a005fdd1819652f3984.tar.bz2
wix-ba93485c940b0bae6e0b6a005fdd1819652f3984.zip
Report E_MOREDATA from Bal functions when string buffer too small
WiX v4 (and probably v3) standardized on the error code E_MOREDATA when string buffers were too small instead of E_INSUFFICIIENT_BUFFER. This fixes v5 to match in a few missing cases. Fixes 8094
Diffstat (limited to 'src/test')
-rw-r--r--src/test/burn/TestData/WixStdBaTests/BalCondition/BalCondition.wixproj18
-rw-r--r--src/test/burn/TestData/WixStdBaTests/BalCondition/BalCondition.wxs18
-rw-r--r--src/test/burn/WixToolsetTest.BurnE2E/WixStdBaTests.cs17
3 files changed, 53 insertions, 0 deletions
diff --git a/src/test/burn/TestData/WixStdBaTests/BalCondition/BalCondition.wixproj b/src/test/burn/TestData/WixStdBaTests/BalCondition/BalCondition.wixproj
new file mode 100644
index 00000000..7e0224e2
--- /dev/null
+++ b/src/test/burn/TestData/WixStdBaTests/BalCondition/BalCondition.wixproj
@@ -0,0 +1,18 @@
1<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
3<Project Sdk="WixToolset.Sdk">
4 <PropertyGroup>
5 <OutputType>Bundle</OutputType>
6 <BA>hyperlinkLicense</BA>
7 <UpgradeCode>{42CCE8AB-777A-481F-9EA2-0B5B10179E8A}</UpgradeCode>
8 <DefineConstants>$(DefineConstants);Version=1.0</DefineConstants>
9 </PropertyGroup>
10
11 <ItemGroup>
12 <ProjectReference Include="..\PackageA\PackageA.wixproj" />
13 </ItemGroup>
14
15 <ItemGroup>
16 <PackageReference Include="WixToolset.BootstrapperApplications.wixext" />
17 </ItemGroup>
18</Project>
diff --git a/src/test/burn/TestData/WixStdBaTests/BalCondition/BalCondition.wxs b/src/test/burn/TestData/WixStdBaTests/BalCondition/BalCondition.wxs
new file mode 100644
index 00000000..e3c36df7
--- /dev/null
+++ b/src/test/burn/TestData/WixStdBaTests/BalCondition/BalCondition.wxs
@@ -0,0 +1,18 @@
1<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
3<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
4 <Bundle Name="~$(var.TestGroupName) - $(var.BundleName)" Version="$(var.Version)" UpgradeCode="$(var.UpgradeCode)" Compressed="yes">
5 <Log Prefix="~$(var.TestGroupName)_$(var.BundleName)" />
6
7 <BootstrapperApplication>
8 <bal:WixStandardBootstrapperApplication LicenseUrl="" Theme="hyperlinkLargeLicense" SuppressOptionsUI="yes" SuppressDowngradeFailure="yes" />
9 </BootstrapperApplication>
10
11 <bal:Condition Condition="1" Message="This is a first condition that we need to meet" />
12 <bal:Condition Condition="1" Message="This is a second condition that we need to meet with a longer message" />
13
14 <Chain>
15 <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)" />
16 </Chain>
17 </Bundle>
18</Wix>
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/WixStdBaTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/WixStdBaTests.cs
index ec7bca6f..45a122a4 100644
--- a/src/test/burn/WixToolsetTest.BurnE2E/WixStdBaTests.cs
+++ b/src/test/burn/WixToolsetTest.BurnE2E/WixStdBaTests.cs
@@ -10,6 +10,23 @@ namespace WixToolsetTest.BurnE2E
10 public WixStdBaTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } 10 public WixStdBaTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
11 11
12 [RuntimeFact] 12 [RuntimeFact]
13 public void SucceedsWithMultipleConditions()
14 {
15 var packageA = this.CreatePackageInstaller("PackageA");
16 var bundle = this.CreateBundleInstaller("BalCondition");
17
18 packageA.VerifyInstalled(false);
19
20 bundle.Install();
21 bundle.VerifyRegisteredAndInPackageCache();
22 packageA.VerifyInstalled(true);
23
24 bundle.Uninstall();
25 bundle.VerifyUnregisteredAndRemovedFromPackageCache();
26 packageA.VerifyInstalled(false);
27 }
28
29 [RuntimeFact]
13 public void ExitsWithErrorWhenDowngradingWithoutSuppression() 30 public void ExitsWithErrorWhenDowngradingWithoutSuppression()
14 { 31 {
15 var packageA = this.CreatePackageInstaller("PackageA"); 32 var packageA = this.CreatePackageInstaller("PackageA");