@joebigelow / wix / commits / 9c54d2fc

Add failing test for RegistryKey without Id and child extension element.

Sean Hall committed May 23, 2020 at 21:54 UTC 9c54d2fce80983bbee5f0f113b5aa30f22bc8a23
3 files changed +50
src/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs new
+36
@@ -0,0 +1,36 @@
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 +namespace WixToolsetTest.CoreIntegration
4 +{
5 + using System;
6 + using System.IO;
7 + using WixBuildTools.TestSupport;
8 + using WixToolset.Core.TestPackage;
9 + using Xunit;
10 +
11 + public class BadInputFixture
12 + {
13 + [Fact(Skip = "Test demonstrates failure")]
14 + public void RegistryKeyWithoutAttributesDoesntCrash()
15 + {
16 + var folder = TestData.Get(@"TestData\BadInput");
17 +
18 + using (var fs = new DisposableFileSystem())
19 + {
20 + var baseFolder = fs.GetFolder();
21 + var intermediateFolder = Path.Combine(baseFolder, "obj");
22 + var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib");
23 +
24 + var result = WixRunner.Execute(new[]
25 + {
26 + "build",
27 + Path.Combine(folder, "RegistryKey.wxs"),
28 + "-intermediateFolder", intermediateFolder,
29 + "-o", wixlibPath,
30 + });
31 +
32 + Assert.InRange(result.ExitCode, 2, Int32.MaxValue);
33 + }
34 + }
35 + }
36 +}
src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/RegistryKey.wxs new
+13
@@ -0,0 +1,13 @@
1 +<?xml version="1.0" encoding="utf-8" ?>
2 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
3 + xmlns:ex="http://www.example.com/scheams/v1/wxs">
4 + <Fragment>
5 + <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
6 + <Component Id="MiscComponent" Guid="7C40C257-AB36-4B8C-8FD1-C56E0AC4AAEF">
7 + <RegistryKey>
8 + <ex:Example />
9 + </RegistryKey>
10 + </Component>
11 + </ComponentGroup>
12 + </Fragment>
13 +</Wix>
src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+1
@@ -22,6 +22,7 @@
22 <Content Include="TestData\AppSearch\NestedDirSearchUnderRegSearch.msi" CopyToOutputDirectory="PreserveNewest" />
23 <Content Include="TestData\AppSearch\RegistrySearch.wxs" CopyToOutputDirectory="PreserveNewest" />
24 <Content Include="TestData\BadEnsureTable\BadEnsureTable.wxs" CopyToOutputDirectory="PreserveNewest" />
25 + <Content Include="TestData\BadInput\RegistryKey.wxs" CopyToOutputDirectory="PreserveNewest" />
26 <Content Include="TestData\BundleCustomTable\BundleCustomTable.wxs" CopyToOutputDirectory="PreserveNewest" />
27 <Content Include="TestData\BundleExtension\BundleExtension.wxs" CopyToOutputDirectory="PreserveNewest" />
28 <Content Include="TestData\BundleExtension\BundleExtensionSearches.wxs" CopyToOutputDirectory="PreserveNewest" />