diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2019-10-18 10:50:34 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2019-10-18 10:59:16 +1000 |
| commit | 9ca5e0a95d0858a177fe1efdc15a962e5f7c1d84 (patch) | |
| tree | e459b759ca002176478b857707299c08d7361ec0 /src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs | |
| parent | aa5a5e492f9a7060720056c27963cf1d06b4737f (diff) | |
| download | wix-9ca5e0a95d0858a177fe1efdc15a962e5f7c1d84.tar.gz wix-9ca5e0a95d0858a177fe1efdc15a962e5f7c1d84.tar.bz2 wix-9ca5e0a95d0858a177fe1efdc15a962e5f7c1d84.zip | |
Add failing test for decompiler with database that has old schemas and missing foreign key relationships.
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/DecompileFixture.cs | 31 |
1 files changed, 31 insertions, 0 deletions
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 | |||
| 65 | Assert.Equal(expected, actualFormatted); | 65 | Assert.Equal(expected, actualFormatted); |
| 66 | } | 66 | } |
| 67 | } | 67 | } |
| 68 | |||
| 69 | [Fact(Skip = "Test demonstrates failure")] | ||
| 70 | public void CanDecompileOldClassTableDefinition() | ||
| 71 | { | ||
| 72 | // The input MSI was not created using standard methods, it is an example of a real world database that needs to be decompiled. | ||
| 73 | // The Class/@Feature_ column has length of 32, the File/@Attributes has length of 2, | ||
| 74 | // and numerous foreign key relationships are missing. | ||
| 75 | var folder = TestData.Get(@"TestData\Class"); | ||
| 76 | |||
| 77 | using (var fs = new DisposableFileSystem()) | ||
| 78 | { | ||
| 79 | var intermediateFolder = fs.GetFolder(); | ||
| 80 | var outputPath = Path.Combine(intermediateFolder, @"Actual.wxs"); | ||
| 81 | |||
| 82 | var result = WixRunner.Execute(new[] | ||
| 83 | { | ||
| 84 | "decompile", | ||
| 85 | Path.Combine(folder, "OldClassTableDef.msi"), | ||
| 86 | "-intermediateFolder", intermediateFolder, | ||
| 87 | "-o", outputPath | ||
| 88 | }); | ||
| 89 | |||
| 90 | result.AssertSuccess(); | ||
| 91 | |||
| 92 | var actual = File.ReadAllText(outputPath); | ||
| 93 | var actualFormatted = XDocument.Parse(actual, LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo).ToString(); | ||
| 94 | var expected = XDocument.Load(Path.Combine(folder, "DecompiledOldClassTableDef.wxs"), LoadOptions.PreserveWhitespace | LoadOptions.SetBaseUri | LoadOptions.SetLineInfo).ToString(); | ||
| 95 | |||
| 96 | Assert.Equal(expected, actualFormatted); | ||
| 97 | } | ||
| 98 | } | ||
| 68 | } | 99 | } |
| 69 | } | 100 | } |
