Skip to content

Commit

Permalink
[tests][link sdk] Re-enable test for Ping for dotnet
Browse files Browse the repository at this point in the history
ref: dotnet/runtime#41355

Unlike what we have today for legacy support for Ping was added in
dotnet/runtime#52240
  • Loading branch information
Sebastien Pouliot committed Jun 16, 2021
1 parent 2ecbb07 commit 8f5f412
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/linker/ios/link sdk/DllImportTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,21 @@ public void Sqlite3 ()
}
}

#if NET
[Ignore ("https://github.com/dotnet/runtime/issues/41355")]
#endif
[Test]
public void LackOfCapget ()
public void PingSend ()
{
// OSX/iOS libc (libSystem.dylib) does not have a capget - which breaks dlsym=false (required for tvOS)
// iOS (tvOS/watchOS) does not support Process to run ping either so it ends up with a InvalidOperationException
// which is now "optimized" to reduce code size (and remove DllImport) until we implement ping (see: #964)
var p = new Ping ();
#if __WATCHOS__
// no socket support
Assert.Throws<PlatformNotSupportedException> (delegate { p.Send ("localhost"); });
#elif NET
// support was implemented with https://github.com/dotnet/runtime/pull/52240
var reply = p.Send ("localhost");
Assert.That (reply.Status, Is.EqualTo (IPStatus.Success), "Pong");
#else
// OSX/iOS libc (libSystem.dylib) does not have a capget - which breaks dlsym=false (required for tvOS)
// iOS (tvOS/watchOS) does not support Process to run ping either so it ends up with a InvalidOperationException
// which is now "optimized" to reduce code size (and remove DllImport) until we implement ping (see: #964)
Assert.Throws<InvalidOperationException> (delegate { p.Send ("localhost"); });
#endif
}
Expand Down

0 comments on commit 8f5f412

Please sign in to comment.