From faaa23eb9e4b87ef020a0f69888e859d2f282bbb Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Mon, 15 Oct 2018 13:41:57 +1300 Subject: [PATCH] Clean up test warnings (#1882) --- Src/Newtonsoft.Json.Tests/Benchmarks/Runner.cs | 7 ++----- Src/Newtonsoft.Json.Tests/JsonConvertTest.cs | 7 ++----- .../Linq/JsonPath/JPathExecuteTests.cs | 8 ++++++-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Src/Newtonsoft.Json.Tests/Benchmarks/Runner.cs b/Src/Newtonsoft.Json.Tests/Benchmarks/Runner.cs index 4b8778ff..bfa462c3 100644 --- a/Src/Newtonsoft.Json.Tests/Benchmarks/Runner.cs +++ b/Src/Newtonsoft.Json.Tests/Benchmarks/Runner.cs @@ -46,16 +46,13 @@ namespace Newtonsoft.Json.Tests.Benchmarks [TestFixture] public class Runner : TestFixtureBase { -#if DNXCORE50 - [Test(Skip = "Don't run with other unit tests")] -#else - [Ignore("Don't run with other unit tests")] +#if false [Test] -#endif public void RunBenchmarks() { new BenchmarkSwitcher(typeof(Runner).GetTypeInfo().Assembly).Run(new []{ "*" }); } +#endif } } diff --git a/Src/Newtonsoft.Json.Tests/JsonConvertTest.cs b/Src/Newtonsoft.Json.Tests/JsonConvertTest.cs index 32d91bd9..9862161b 100644 --- a/Src/Newtonsoft.Json.Tests/JsonConvertTest.cs +++ b/Src/Newtonsoft.Json.Tests/JsonConvertTest.cs @@ -1165,12 +1165,8 @@ namespace Newtonsoft.Json.Tests Assert.AreEqual(typeof(DateTime), jsonReader.ValueType); } -#if DNXCORE50 - [Test(Skip = "Don't run with other unit tests")] -#else - [Ignore("Don't run with other unit tests")] +#if false [Test] -#endif public void StackOverflowTest() { StringBuilder sb = new StringBuilder(); @@ -1192,6 +1188,7 @@ namespace Newtonsoft.Json.Tests JsonSerializer serializer = new JsonSerializer() { }; serializer.Deserialize(new JsonTextReader(new StringReader(json))); } +#endif public class Nest { diff --git a/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathExecuteTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathExecuteTests.cs index b06e144d..bb781a54 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathExecuteTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathExecuteTests.cs @@ -1541,7 +1541,12 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath foreach (var item in StrictMatchTestData()) { yield return new object[] { item[0], item[1], item[2] }; - yield return new object[] { item[1], item[0], item[2] }; + + if (!item[0].Equals(item[1])) + { + // Test the inverse + yield return new object[] { item[1], item[0], item[2] }; + } } } @@ -1558,7 +1563,6 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath yield return new object[] { "1", "null", false }; yield return new object[] { "null", "null", true }; yield return new object[] { "null", "'null'", false }; - yield return new object[] { "null", "1", false }; } } } \ No newline at end of file