Skip to content

Commit

Permalink
Enable native tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nguerrera committed Aug 3, 2016
1 parent fad6211 commit 2ee9308
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Microsoft.DiaSymReader.PortablePdb.UnitTests
{
using System.Diagnostics;
using System.Linq;
using static SymTestHelpers;

Expand All @@ -25,14 +26,15 @@ public void EmbeddedSource_Portable()
[Fact]
public void EmbeddedSource_Native()
{
NativeNotYetImplemented();
//EmbeddedSource(TestResources.EmbeddedSource.DllAndPdb);
EmbeddedSource(TestResources.EmbeddedSource.DllAndPdb);
}

private void EmbeddedSource(KeyValuePair<byte[], byte[]> dllAndPdb)
{
ISymUnmanagedReader symReader = CreateSymReaderFromResource(dllAndPdb);

Debugger.Launch();

foreach (string file in new[] { @"C:\EmbeddedSource.cs", @"C:\EmbeddedSourceSmall.cs" })
{
bool hasEmbeddedSource;
Expand All @@ -58,7 +60,7 @@ private void EmbeddedSource(KeyValuePair<byte[], byte[]> dllAndPdb)
}
}

byte[] expectedContent, content;
byte[] expectedContent;
if (uncompressedSize == 0)
{
Assert.Equal(@"C:\EmbeddedSourceSmall.cs", file);
Expand All @@ -84,8 +86,7 @@ public void NoEmbeddedSource_Portable()
[Fact]
public void NoEmbeddedSource_Native()
{
NativeNotYetImplemented();
//NoEmbeddedSource(TestResources.Documents.DllAndPdb);
NoEmbeddedSource(TestResources.Documents.DllAndPdb);
}

private void NoEmbeddedSource(KeyValuePair<byte[], byte[]> dllAndPdb)
Expand Down Expand Up @@ -114,8 +115,7 @@ public void BadArgs_Portable()
[Fact]
public void BadArgs_Native()
{
NativeNotYetImplemented();
//EmbeddedSource(TestResources.EmbeddedSource.DllAndPdb);
BadArgs(TestResources.EmbeddedSource.DllAndPdb);
}

private void BadArgs(KeyValuePair<byte[], byte[]> dllAndPdb)
Expand Down Expand Up @@ -189,19 +189,5 @@ private static DocumentHandle GetDocumentHandle(MetadataReader portablePdbReader
Assert.False(true, "Document not found.");
throw null;
}

private void NativeNotYetImplemented()
{
// TODO: This checks the behavior of Microsoft.DiaSymReader.Native before the update that
// has native code support. When this starts to fail, remove this and uncomment the
// tests that pass native PDB to same worker routines as portable PDB.
ISymUnmanagedReader symReader = CreateSymReaderFromResource(TestResources.EmbeddedSource.DllAndPdb);

ISymUnmanagedDocument doc;
Assert.Equal(HResult.S_OK, symReader.GetDocument(@"C:\EmbeddedSource.cs", default(Guid), default(Guid), default(Guid), out doc));

bool hasEmbeddedSource;
Assert.Equal(HResult.E_NOTIMPL, doc.HasEmbeddedSource(out hasEmbeddedSource));
}
}
}
2 changes: 1 addition & 1 deletion src/Microsoft.DiaSymReader.PortablePdb/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"System.Collections.Immutable": "1.2.0",
"System.Reflection.Metadata": "1.4.1-beta-24322-03",
"System.Reflection.Metadata": "1.4.1-beta-24403-05",
"Microsoft.DiaSymReader": "1.1.0-beta1-60625-03",
"System.Collections": "4.0.11",
"System.Diagnostics.Debug": "4.0.11",
Expand Down

0 comments on commit 2ee9308

Please sign in to comment.