aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core.Tests/PInvokeTest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/csharp/Grpc.Core.Tests/PInvokeTest.cs')
-rw-r--r--src/csharp/Grpc.Core.Tests/PInvokeTest.cs35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/csharp/Grpc.Core.Tests/PInvokeTest.cs b/src/csharp/Grpc.Core.Tests/PInvokeTest.cs
index 9db08d2f02..3beffc3955 100644
--- a/src/csharp/Grpc.Core.Tests/PInvokeTest.cs
+++ b/src/csharp/Grpc.Core.Tests/PInvokeTest.cs
@@ -33,13 +33,13 @@
using System;
using System.Diagnostics;
+using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Internal;
using Grpc.Core.Utils;
using NUnit.Framework;
-using System.Runtime.InteropServices;
namespace Grpc.Core.Tests
{
@@ -73,14 +73,13 @@ namespace Grpc.Core.Tests
{
BenchmarkUtil.RunBenchmark(
100000, 1000000,
- () => {
+ () =>
+ {
CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.Create();
cq.Dispose();
- }
- );
+ });
}
-
/// <summary>
/// Approximate results:
/// (~80ns Mono Linux)
@@ -94,10 +93,10 @@ namespace Grpc.Core.Tests
counter = 0;
BenchmarkUtil.RunBenchmark(
1000000, 10000000,
- () => {
+ () =>
+ {
grpcsharp_test_callback(handler);
- }
- );
+ });
Assert.AreNotEqual(0, counter);
}
@@ -113,10 +112,10 @@ namespace Grpc.Core.Tests
counter = 0;
BenchmarkUtil.RunBenchmark(
10000, 10000,
- () => {
- grpcsharp_test_callback(new CompletionCallbackDelegate(Handler));
- }
- );
+ () =>
+ {
+ grpcsharp_test_callback(new CompletionCallbackDelegate(Handler));
+ });
Assert.AreNotEqual(0, counter);
}
@@ -129,15 +128,15 @@ namespace Grpc.Core.Tests
{
BenchmarkUtil.RunBenchmark(
1000000, 100000000,
- () => {
+ () =>
+ {
grpcsharp_test_nop(IntPtr.Zero);
- }
- );
+ });
}
- private void Handler(GRPCOpError op, IntPtr ptr) {
- counter ++;
+ private void Handler(GRPCOpError op, IntPtr ptr)
+ {
+ counter++;
}
}
}
-