[Xamarin.Android.Build.Tests] Fix BuildAppCheckDebugSymbols in monodroid (#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.
This commit is contained in:
Dean Ellis 2017-10-27 20:05:08 +01:00 коммит произвёл Jonathan Pryor
Родитель b2cf680146
Коммит bd2640e17e
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -609,6 +609,8 @@ namespace App1
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);
}