aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-05-23 21:54:53 +1000
committerSean Hall <r.sean.hall@gmail.com>2020-05-23 21:59:28 +1000
commit9c54d2fce80983bbee5f0f113b5aa30f22bc8a23 (patch)
tree77712f1e3ac68e9f2de2172d035aaae0b27f5de2 /src/test
parent96e966ce322bc630afed6d0ca8c9ec68191c5f83 (diff)
downloadwix-9c54d2fce80983bbee5f0f113b5aa30f22bc8a23.tar.gz
wix-9c54d2fce80983bbee5f0f113b5aa30f22bc8a23.tar.bz2
wix-9c54d2fce80983bbee5f0f113b5aa30f22bc8a23.zip
Add failing test for RegistryKey without Id and child extension element.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs36
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/BadInput/RegistryKey.wxs13
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj1
3 files changed, 50 insertions, 0 deletions
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 @@
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
3namespace 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}
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 @@
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>
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 @@
22 <Content Include="TestData\AppSearch\NestedDirSearchUnderRegSearch.msi" CopyToOutputDirectory="PreserveNewest" /> 22 <Content Include="TestData\AppSearch\NestedDirSearchUnderRegSearch.msi" CopyToOutputDirectory="PreserveNewest" />
23 <Content Include="TestData\AppSearch\RegistrySearch.wxs" CopyToOutputDirectory="PreserveNewest" /> 23 <Content Include="TestData\AppSearch\RegistrySearch.wxs" CopyToOutputDirectory="PreserveNewest" />
24 <Content Include="TestData\BadEnsureTable\BadEnsureTable.wxs" CopyToOutputDirectory="PreserveNewest" /> 24 <Content Include="TestData\BadEnsureTable\BadEnsureTable.wxs" CopyToOutputDirectory="PreserveNewest" />
25 <Content Include="TestData\BadInput\RegistryKey.wxs" CopyToOutputDirectory="PreserveNewest" />
25 <Content Include="TestData\BundleCustomTable\BundleCustomTable.wxs" CopyToOutputDirectory="PreserveNewest" /> 26 <Content Include="TestData\BundleCustomTable\BundleCustomTable.wxs" CopyToOutputDirectory="PreserveNewest" />
26 <Content Include="TestData\BundleExtension\BundleExtension.wxs" CopyToOutputDirectory="PreserveNewest" /> 27 <Content Include="TestData\BundleExtension\BundleExtension.wxs" CopyToOutputDirectory="PreserveNewest" />
27 <Content Include="TestData\BundleExtension\BundleExtensionSearches.wxs" CopyToOutputDirectory="PreserveNewest" /> 28 <Content Include="TestData\BundleExtension\BundleExtensionSearches.wxs" CopyToOutputDirectory="PreserveNewest" />