diff options
| author | Alex Kubiesa <alex.kubiesa@outlook.com> | 2021-02-15 20:08:21 +0000 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-02-15 16:39:59 -0800 |
| commit | 0ce3a9b66da80c505fd8901df88d31b0ad43dac6 (patch) | |
| tree | 8b35cbcbb5d5985d73fef64e7cb81994f3820d7f /src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | |
| parent | c6e2213e818b869c44c1af7355fc06f45ebf1a1f (diff) | |
| download | wix-0ce3a9b66da80c505fd8901df88d31b0ad43dac6.tar.gz wix-0ce3a9b66da80c505fd8901df88d31b0ad43dac6.tar.bz2 wix-0ce3a9b66da80c505fd8901df88d31b0ad43dac6.zip | |
Fix file size overflow error in ProcessPayloadsCommand.
Fixes #4008
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs index 094e4df2..0660dd7b 100644 --- a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | |||
| @@ -366,5 +366,57 @@ namespace WixToolsetTest.CoreIntegration | |||
| 366 | Assert.InRange(result.ExitCode, 2, Int32.MaxValue); | 366 | Assert.InRange(result.ExitCode, 2, Int32.MaxValue); |
| 367 | } | 367 | } |
| 368 | } | 368 | } |
| 369 | |||
| 370 | [Fact] | ||
| 371 | public void CanBuildBundleWithLargePayload() | ||
| 372 | { | ||
| 373 | var folder = TestData.Get(@"TestData\LargePayload"); | ||
| 374 | |||
| 375 | // Overwrite the payload with a 2.5 GiB file. We do this dynamically to avoid committing such | ||
| 376 | // a large file to source control. | ||
| 377 | var largeFile = Path.Combine(folder, "data", "large_file.dat"); | ||
| 378 | const long TwoAndAHalfGigabytes = 2_684_354_560; | ||
| 379 | using (var stream = File.Create(largeFile)) | ||
| 380 | { | ||
| 381 | stream.Seek(TwoAndAHalfGigabytes - 1, SeekOrigin.Begin); | ||
| 382 | stream.WriteByte(1); | ||
| 383 | } | ||
| 384 | |||
| 385 | using (var fs = new DisposableFileSystem()) | ||
| 386 | { | ||
| 387 | var baseFolder = fs.GetFolder(); | ||
| 388 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 389 | var exePath = Path.Combine(baseFolder, @"bin\test.exe"); | ||
| 390 | var pdbPath = Path.Combine(baseFolder, @"bin\test.wixpdb"); | ||
| 391 | |||
| 392 | var result = WixRunner.Execute(new[] | ||
| 393 | { | ||
| 394 | "build", | ||
| 395 | Path.Combine(folder, "Bundle.wxs"), | ||
| 396 | "-loc", Path.Combine(folder, "Bundle.en-us.wxl"), | ||
| 397 | "-bindpath", Path.Combine(folder, "data"), | ||
| 398 | "-intermediateFolder", intermediateFolder, | ||
| 399 | "-o", exePath, | ||
| 400 | }); | ||
| 401 | |||
| 402 | result.AssertSuccess(); | ||
| 403 | Assert.Empty(result.Messages.Where(m => m.Level == MessageLevel.Warning)); | ||
| 404 | |||
| 405 | Assert.True(File.Exists(exePath)); | ||
| 406 | Assert.True(File.Exists(pdbPath)); | ||
| 407 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\large_file.dat"))); | ||
| 408 | |||
| 409 | using (var wixOutput = WixOutput.Read(pdbPath)) | ||
| 410 | { | ||
| 411 | var intermediate = Intermediate.Load(wixOutput); | ||
| 412 | var section = intermediate.Sections.Single(); | ||
| 413 | |||
| 414 | var payloadSymbol = section.Symbols.OfType<WixBundlePayloadSymbol>().Where(x => x.Name == "large_file.dat").Single(); | ||
| 415 | Assert.Equal(TwoAndAHalfGigabytes, payloadSymbol.FileSize); | ||
| 416 | } | ||
| 417 | } | ||
| 418 | |||
| 419 | File.Delete(largeFile); | ||
| 420 | } | ||
| 369 | } | 421 | } |
| 370 | } | 422 | } |
