You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2019/03/30 19:58:44 UTC

[ignite] 03/04: Suppress compiler warnings

This is an automated email from the ASF dual-hosted git repository.

ptupitsyn pushed a commit to branch ignite-11525
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 01a59bc35c88f19d7b41176408a3079dc183012d
Author: Pavel Tupitsyn <pt...@apache.org>
AuthorDate: Sat Mar 30 22:56:51 2019 +0300

    Suppress compiler warnings
---
 .../Cache/Query/CacheQueriesTest.cs                      | 16 +++++++++++-----
 .../Client/Cache/CacheClientAsyncWrapper.cs              |  4 +++-
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
index 110fa1e..be35850 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs
@@ -265,18 +265,18 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
         [Test]
         public void TestSqlQueryArguments()
         {
+#pragma warning disable 618
             Cache().Put(1, new QueryPerson("Ivanov", 30));
             Cache().Put(2, new QueryPerson("Petrov", 40));
             Cache().Put(3, new QueryPerson("Sidorov", 50));
 
             // 1. Empty result set.
-            using (
-                IQueryCursor<ICacheEntry<int, QueryPerson>> cursor =
-                    Cache().Query(new SqlQuery(typeof(QueryPerson), "age < ?", 50)))
+            using (var cursor = Cache().Query(new SqlQuery(typeof(QueryPerson), "age < ?", 50)))
             {
                 foreach (ICacheEntry<int, QueryPerson> entry in cursor.GetAll())
                     Assert.IsTrue(entry.Key == 1 || entry.Key == 2);
             }
+#pragma warning restore 618
         }
 
         /// <summary>
@@ -301,6 +301,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
         /// Check query result for enumerator test.
         /// </summary>
         /// <param name="qry">QUery.</param>
+#pragma warning disable 618
         private void CheckEnumeratorQuery(SqlQuery qry)
         {
             using (IQueryCursor<ICacheEntry<int, QueryPerson>> cursor = Cache().Query(qry))
@@ -339,6 +340,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
                 Assert.IsTrue(first && second && third);
             }
         }
+#pragma warning restore 618
 
         /// <summary>
         /// Check SQL query.
@@ -353,14 +355,14 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
             var exp = PopulateCache(cache, loc, MaxItemCnt, x => x < 50);
 
             // 2. Validate results.
+#pragma warning disable 618
             var qry = new SqlQuery(typeof(QueryPerson), "age < 50", loc)
             {
                 EnableDistributedJoins = distrJoin,
-#pragma warning disable 618
                 ReplicatedOnly = false,
-#pragma warning restore 618
                 Timeout = TimeSpan.FromSeconds(3)
             };
+#pragma warning restore 618
 
             Assert.AreEqual(string.Format("SqlQuery [Sql=age < 50, Arguments=[], Local={0}, " +
                                           "PageSize=1024, EnableDistributedJoins={1}, Timeout={2}, " +
@@ -530,7 +532,9 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
                 "Use setIndexedTypes or setTypeMetadata methods on CacheConfiguration to enable.", err.Message);
 
             // SQL query.
+#pragma warning disable 618
             err = Assert.Throws<IgniteException>(() => cache.Query(new SqlQuery(typeof(QueryPerson), "age < 50")));
+#pragma warning restore 618
 
             Assert.AreEqual("Failed to find SQL table for type: QueryPerson", err.Message);
         }
@@ -773,10 +777,12 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
             var cache = Cache();
             PopulateCache(cache, false, 30000, x => true);
 
+#pragma warning disable 618
             var sqlQry = new SqlQuery(typeof(QueryPerson), "WHERE age < 2000")
             {
                 Timeout = TimeSpan.FromMilliseconds(1)
             };
+#pragma warning restore 618
 
             // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
             var ex = Assert.Throws<CacheException>(() => cache.Query(sqlQry).ToArray());
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/CacheClientAsyncWrapper.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/CacheClientAsyncWrapper.cs
index 6d812cf..8ad4478 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/CacheClientAsyncWrapper.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/CacheClientAsyncWrapper.cs
@@ -134,10 +134,12 @@ namespace Apache.Ignite.Core.Tests.Client.Cache
         }
 
         /** <inheritDoc /> */
+#pragma warning disable 618
         public IQueryCursor<ICacheEntry<TK, TV>> Query(SqlQuery sqlQuery)
         {
             return _cache.Query(sqlQuery);
         }
+#pragma warning restore 618
 
         /** <inheritDoc /> */
         public IFieldsQueryCursor Query(SqlFieldsQuery sqlFieldsQuery)
@@ -349,4 +351,4 @@ namespace Apache.Ignite.Core.Tests.Client.Cache
             return _cache.WithKeepBinary<TK1, TV1>();
         }
     }
-}
\ No newline at end of file
+}