Skip to content
Snippets Groups Projects
Commit a7db28fe authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

dont call into C core to get Timespec.InfPast and Timespec.InfFuture

parent f4a961df
No related branches found
No related tags found
No related merge requests found
......@@ -61,15 +61,15 @@ namespace Grpc.Core.Internal.Tests
}
[Test]
public void InfFuture()
public void InfFutureMatchesNativeValue()
{
var timespec = Timespec.InfFuture;
Assert.AreEqual(Timespec.NativeInfFuture, Timespec.InfFuture);
}
[Test]
public void InfPast()
public void InfPastMatchesNativeValue()
{
var timespec = Timespec.InfPast;
Assert.AreEqual(Timespec.NativeInfPast, Timespec.InfPast);
}
[Test]
......
......@@ -71,7 +71,7 @@ namespace Grpc.Core.Internal
{
get
{
return Native.gprsharp_inf_future(GPRClockType.Realtime);
return new Timespec(long.MaxValue, 0, GPRClockType.Realtime);
}
}
......@@ -82,7 +82,7 @@ namespace Grpc.Core.Internal
{
get
{
return Native.gprsharp_inf_past(GPRClockType.Realtime);
return new Timespec(long.MinValue, 0, GPRClockType.Realtime);
}
}
......@@ -231,6 +231,7 @@ namespace Grpc.Core.Internal
}
}
// for tests only
internal static int NativeSize
{
get
......@@ -238,5 +239,23 @@ namespace Grpc.Core.Internal
return Native.gprsharp_sizeof_timespec();
}
}
// for tests only
internal static Timespec NativeInfFuture
{
get
{
return Native.gprsharp_inf_future(GPRClockType.Realtime);
}
}
// for tests only
public static Timespec NativeInfPast
{
get
{
return Native.gprsharp_inf_past(GPRClockType.Realtime);
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment