From 9c54d2fce80983bbee5f0f113b5aa30f22bc8a23 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 23 May 2020 21:54:53 +1000 Subject: Add failing test for RegistryKey without Id and child extension element. --- .../BadInputFixture.cs | 36 ++++++++++++++++++++++ .../TestData/BadInput/RegistryKey.wxs | 13 ++++++++ .../WixToolsetTest.CoreIntegration.csproj | 1 + 3 files changed, 50 insertions(+) create mode 100644 src/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/RegistryKey.wxs diff --git a/src/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs new file mode 100644 index 00000000..8482dcbe --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs @@ -0,0 +1,36 @@ +// 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. + +namespace WixToolsetTest.CoreIntegration +{ + using System; + using System.IO; + using WixBuildTools.TestSupport; + using WixToolset.Core.TestPackage; + using Xunit; + + public class BadInputFixture + { + [Fact(Skip = "Test demonstrates failure")] + public void RegistryKeyWithoutAttributesDoesntCrash() + { + var folder = TestData.Get(@"TestData\BadInput"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib"); + + var result = WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "RegistryKey.wxs"), + "-intermediateFolder", intermediateFolder, + "-o", wixlibPath, + }); + + Assert.InRange(result.ExitCode, 2, Int32.MaxValue); + } + } + } +} diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/RegistryKey.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/RegistryKey.wxs new file mode 100644 index 00000000..c717680b --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/RegistryKey.wxs @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 9d2cf1d6..f9f1ba44 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj @@ -22,6 +22,7 @@ + -- cgit v1.2.3-55-g6feb