From 9ca5e0a95d0858a177fe1efdc15a962e5f7c1d84 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 18 Oct 2019 10:50:34 +1000 Subject: Add failing test for decompiler with database that has old schemas and missing foreign key relationships. --- .../DecompileFixture.cs | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs') diff --git a/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs b/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs index 3a9781df..bace97b3 100644 --- a/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs @@ -65,5 +65,36 @@ namespace WixToolsetTest.CoreIntegration Assert.Equal(expected, actualFormatted); } } + + [Fact(Skip = "Test demonstrates failure")] + public void CanDecompileOldClassTableDefinition() + { + // The input MSI was not created using standard methods, it is an example of a real world database that needs to be decompiled. + // The Class/@Feature_ column has length of 32, the File/@Attributes has length of 2, + // and numerous foreign key relationships are missing. + var folder = TestData.Get(@"TestData\Class"); + + using (var fs = new DisposableFileSystem()) + { + var intermediateFolder = fs.GetFolder(); + var outputPath = Path.Combine(intermediateFolder, @"Actual.wxs"); + + var result = WixRunner.Execute(new[] + { + "decompile", + Path.Combine(folder, "OldClassTableDef.msi"), + "-intermediateFolder", intermediateFolder, + "-o", outputPath + }); + + result.AssertSuccess(); + + var actual = File.ReadAllText(outputPath); + var actualFormatted = XDocument.Parse(actual, LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo).ToString(); + var expected = XDocument.Load(Path.Combine(folder, "DecompiledOldClassTableDef.wxs"), LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo).ToString(); + + Assert.Equal(expected, actualFormatted); + } + } } } -- cgit v1.2.3-55-g6feb