Skip to content

Commit

Permalink
[Xamarin.Android.Build.Tests] Fix BuildAppCheckDebugSymbols in monodr…
Browse files Browse the repository at this point in the history
…oid (#987)

The `BuildAppCheckDebugSymbols()` test does not take into account
that when building in debug mode on monodroid the assemblies
are not embedded in the apk. As a result when trying to get
`Library1.pdb` from the apk we get a `null` back. This causes
a `NullReferenceException` when we try to get a length.

The fix is to look in the `assets` directory if we can't get
the file from the `.apk`. This will allow the test to work in
both xamarin-android and monodroid.
  • Loading branch information
dellis1972 authored and jonpryor committed Oct 27, 2017
1 parent b2cf680 commit bd2640e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,8 @@ public Class2 ()
var outputPath = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath);
using (var apk = ZipHelper.OpenZip (Path.Combine (outputPath, proj.PackageName + ".apk"))) {
var data = ZipHelper.ReadFileFromZip (apk, "assemblies/Library1.pdb");
if (data == null)
data = File.ReadAllBytes (assetsPdb);
var filedata = File.ReadAllBytes (linkSrc);
Assert.AreEqual (filedata.Length, data.Length, "Library1.pdb in the apk should match {0}", linkSrc);
}
Expand Down

0 comments on commit bd2640e

Please sign in to comment.