diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2017-08-09 09:05:54 +0200 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2017-08-11 18:17:19 +0200 |
commit | b8c77c59c56731f9fdffc9bc9511a9da44cd3d68 (patch) | |
tree | ea801e3b5b175080de181ba420698acb642be836 | |
parent | aa135cedf9dbed32f18621882ed0998a67193c85 (diff) |
Fix warnings in Grpc.Examples
11 files changed, 16 insertions, 8 deletions
diff --git a/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj b/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj index 08df026a53..74deed6584 100755 --- a/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj +++ b/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj @@ -9,6 +9,7 @@ <OutputType>Exe</OutputType> <PackageId>Grpc.Examples.MathClient</PackageId> <RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> diff --git a/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj b/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj index a02937474a..1abf261498 100755 --- a/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj +++ b/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj @@ -9,6 +9,7 @@ <OutputType>Exe</OutputType> <PackageId>Grpc.Examples.MathServer</PackageId> <RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj index 9a8e62cc8b..d2a13ed6e1 100755 --- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj +++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj @@ -10,6 +10,7 @@ <PackageId>Grpc.Examples.Tests</PackageId> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45</PackageTargetFallback> <RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> diff --git a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs index 8e6d685e0f..ded80ffba5 100644 --- a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs +++ b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs @@ -37,7 +37,7 @@ namespace Math.Tests Channel channel; Math.MathClient client; - [TestFixtureSetUp] + [OneTimeSetUp] public void Init() { // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755 @@ -51,7 +51,7 @@ namespace Math.Tests client = new Math.MathClient(channel); } - [TestFixtureTearDown] + [OneTimeTearDown] public void Cleanup() { channel.ShutdownAsync().Wait(); @@ -130,7 +130,7 @@ namespace Math.Tests } [Test] - public async Task FibWithDeadline() + public void FibWithDeadline() { using (var call = client.Fib(new FibArgs { Limit = 0 }, deadline: DateTime.UtcNow.AddMilliseconds(500))) diff --git a/src/csharp/Grpc.Examples/Grpc.Examples.csproj b/src/csharp/Grpc.Examples/Grpc.Examples.csproj index 625c1723bc..491d313f17 100755 --- a/src/csharp/Grpc.Examples/Grpc.Examples.csproj +++ b/src/csharp/Grpc.Examples/Grpc.Examples.csproj @@ -8,6 +8,7 @@ <AssemblyName>Grpc.Examples</AssemblyName> <PackageId>Grpc.Examples</PackageId> <RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> diff --git a/src/csharp/Grpc.Examples/MathServiceImpl.cs b/src/csharp/Grpc.Examples/MathServiceImpl.cs index 85b5e2dd96..0cc1b79137 100644 --- a/src/csharp/Grpc.Examples/MathServiceImpl.cs +++ b/src/csharp/Grpc.Examples/MathServiceImpl.cs @@ -52,9 +52,10 @@ namespace Math public override async Task<Num> Sum(IAsyncStreamReader<Num> requestStream, ServerCallContext context) { long sum = 0; - await requestStream.ForEachAsync(async num => + await requestStream.ForEachAsync(num => { sum += num.Num_; + return TaskUtils.CompletedTask; }); return new Num { Num_ = sum }; } diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj index b0e2716e7e..2ccf46b9b9 100755 --- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj +++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj @@ -10,6 +10,7 @@ <PackageId>Grpc.HealthCheck.Tests</PackageId> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45</PackageTargetFallback> <RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> diff --git a/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs b/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs index 7dadba75ff..45e8ad9062 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs +++ b/src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs @@ -37,7 +37,7 @@ namespace Grpc.HealthCheck.Tests Grpc.Health.V1.Health.HealthClient client; Grpc.HealthCheck.HealthServiceImpl serviceImpl; - [TestFixtureSetUp] + [OneTimeSetUp] public void Init() { serviceImpl = new HealthServiceImpl(); @@ -54,7 +54,7 @@ namespace Grpc.HealthCheck.Tests client = new Grpc.Health.V1.Health.HealthClient(channel); } - [TestFixtureTearDown] + [OneTimeTearDown] public void Cleanup() { channel.ShutdownAsync().Wait(); diff --git a/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj b/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj index 26a940e488..17797e1e1e 100644 --- a/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj +++ b/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj @@ -10,6 +10,7 @@ <PackageId>Grpc.Microbenchmarks</PackageId> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45</PackageTargetFallback> <RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> diff --git a/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj b/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj index af6ade852b..cf756c68ad 100755 --- a/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj +++ b/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj @@ -10,6 +10,7 @@ <PackageId>Grpc.Reflection.Tests</PackageId> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45</PackageTargetFallback> <RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> diff --git a/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs b/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs index 7e894edd31..76f8cfadcf 100644 --- a/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs +++ b/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs @@ -38,7 +38,7 @@ namespace Grpc.Reflection.Tests ServerReflection.ServerReflectionClient client; ReflectionServiceImpl serviceImpl; - [TestFixtureSetUp] + [OneTimeSetUp] public void Init() { serviceImpl = new ReflectionServiceImpl(ServerReflection.Descriptor); @@ -55,7 +55,7 @@ namespace Grpc.Reflection.Tests client = new ServerReflection.ServerReflectionClient(channel); } - [TestFixtureTearDown] + [OneTimeTearDown] public void Cleanup() { channel.ShutdownAsync().Wait(); |