diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2017-08-10 09:07:53 +0200 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2017-08-11 18:17:19 +0200 |
commit | 9210293d9e861e16a296da2cdf8cd4df30b85544 (patch) | |
tree | 5d74150edfbaffa0bb8b4a5560c0883ee5c1aa3f /src/csharp/Grpc.Core.Tests/Internal | |
parent | 271cb36f5639ed465f919c9736015bd98a7b7540 (diff) |
dont use generic version of Marshal.SizeOf
Diffstat (limited to 'src/csharp/Grpc.Core.Tests/Internal')
-rw-r--r-- | src/csharp/Grpc.Core.Tests/Internal/CompletionQueueEventTest.cs | 7 | ||||
-rw-r--r-- | src/csharp/Grpc.Core.Tests/Internal/TimespecTest.cs | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueEventTest.cs b/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueEventTest.cs index 27c2fa8bf0..259520846f 100644 --- a/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueEventTest.cs +++ b/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueEventTest.cs @@ -29,9 +29,12 @@ namespace Grpc.Core.Internal.Tests public class CompletionQueueEventTest { [Test] - public void CreateAndDestroy() + public void CompletionQueueEventSizeIsNativeSize() { - Assert.AreEqual(CompletionQueueEvent.NativeSize, Marshal.SizeOf<CompletionQueueEvent>()); + #pragma warning disable 0618 + // We need to use the obsolete non-generic version of Marshal.SizeOf because the generic version is not available in net45 + Assert.AreEqual(CompletionQueueEvent.NativeSize, Marshal.SizeOf(typeof(CompletionQueueEvent))); + #pragma warning restore 0618 } } } diff --git a/src/csharp/Grpc.Core.Tests/Internal/TimespecTest.cs b/src/csharp/Grpc.Core.Tests/Internal/TimespecTest.cs index c2ece97ba0..be35f31c36 100644 --- a/src/csharp/Grpc.Core.Tests/Internal/TimespecTest.cs +++ b/src/csharp/Grpc.Core.Tests/Internal/TimespecTest.cs @@ -60,7 +60,10 @@ namespace Grpc.Core.Internal.Tests [Test] public void TimespecSizeIsNativeSize() { - Assert.AreEqual(Timespec.NativeSize, Marshal.SizeOf<Timespec>()); + #pragma warning disable 0618 + // We need to use the obsolete non-generic version of Marshal.SizeOf because the generic version is not available in net45 + Assert.AreEqual(Timespec.NativeSize, Marshal.SizeOf(typeof(Timespec))); + #pragma warning restore 0618 } [Test] |