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

little refactoring for Timespec

parent e1e11878
No related branches found
No related tags found
No related merge requests found
...@@ -46,6 +46,14 @@ namespace Google.GRPC.Core.Internal ...@@ -46,6 +46,14 @@ namespace Google.GRPC.Core.Internal
} }
} }
internal static int NativeSize
{
get
{
return gprsharp_sizeof_timespec();
}
}
/// <summary> /// <summary>
/// Creates a GPR deadline from current instant and given timeout. /// Creates a GPR deadline from current instant and given timeout.
/// </summary> /// </summary>
......
using System; using System;
using NUnit.Framework; using NUnit.Framework;
using System.Runtime.InteropServices;
using Google.GRPC.Core.Internal; using Google.GRPC.Core.Internal;
namespace Google.GRPC.Core.Internal.Tests namespace Google.GRPC.Core.Internal.Tests
...@@ -12,6 +13,18 @@ namespace Google.GRPC.Core.Internal.Tests ...@@ -12,6 +13,18 @@ namespace Google.GRPC.Core.Internal.Tests
var timespec = Timespec.Now; var timespec = Timespec.Now;
} }
[Test]
public void InfFuture()
{
var timespec = Timespec.InfFuture;
}
[Test]
public void TimespecSizeIsNativeSize()
{
Assert.AreEqual(Timespec.NativeSize, Marshal.SizeOf(typeof(Timespec)));
}
[Test] [Test]
public void Add() public void Add()
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment