Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid tests generated for Newtonsoft.Json.KeyValuePairConverter #201

Open
mxprshn opened this issue Dec 16, 2022 · 0 comments
Open

Invalid tests generated for Newtonsoft.Json.KeyValuePairConverter #201

mxprshn opened this issue Dec 16, 2022 · 0 comments

Comments

@mxprshn
Copy link
Member

mxprshn commented Dec 16, 2022

  • Clone and publish https://github.com/JamesNK/Newtonsoft.Json (commit c908de3017ee32278c5330f715cef0e9733ce9db), Release, net6.0
  • Run V# runner (commit 56d2a46) CLI as follows: --public-methods-of-class KeyValuePairConverter ...\Newtonsoft.Json.dll
  • 4 tests are generated and they all fail with incorrect exception thrown or exception not thrown at all:
Test test1.vst throws System.NullReferenceException: Object reference not set to an instance of an object.
   at Newtonsoft.Json.Converters.KeyValuePairConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer) in D:\Newtonsoft.Json\Src\Newtonsoft.Json\Convert
ers\KeyValuePairConverter.cs:line 63 when the expected exception was System.ArgumentOutOfRangeException!
Error (test1.vst): System.NullReferenceException: Object reference not set to an instance of an object.
   at VSharp.TestRunner.TestRunner.ReproduceTest(FileInfo fileInfo, SuiteType suiteType, Boolean checkResult, Boolean fileMode) in D:\VSharp-fork\VSharp.TestRunner\TestRunner
Tool.cs:line 114
Starting reproducing test2.vst for method System.Object ReadJson(Newtonsoft.Json.JsonReader, System.Type, System.Object, Newtonsoft.Json.JsonSerializer)
Test test2.vst throws System.NullReferenceException: Object reference not set to an instance of an object.
   at Newtonsoft.Json.Converters.KeyValuePairConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in D:\Newtonsoft.Json\Src
\Newtonsoft.Json\Converters\KeyValuePairConverter.cs:line 89 when the expected exception was System.ArgumentOutOfRangeException!
Error (test2.vst): System.NullReferenceException: Object reference not set to an instance of an object.
   at VSharp.TestRunner.TestRunner.ReproduceTest(FileInfo fileInfo, SuiteType suiteType, Boolean checkResult, Boolean fileMode) in D:\VSharp-fork\VSharp.TestRunner\TestRunner
Tool.cs:line 114
Starting reproducing test3.vst for method Boolean CanConvert(System.Type)
Test test3.vst throws System.ArgumentNullException: Value cannot be null. (Parameter 't')
   at Newtonsoft.Json.Utilities.ValidationUtils.ArgumentNotNull(Object value, String parameterName) in D:\Newtonsoft.Json\Src\Newtonsoft.Json\Utilities\ValidationUtils.cs:lin
e 38
   at Newtonsoft.Json.Utilities.ReflectionUtils.IsNullableType(Type t) in D:\Newtonsoft.Json\Src\Newtonsoft.Json\Utilities\ReflectionUtils.cs:line 278
   at Newtonsoft.Json.Converters.KeyValuePairConverter.CanConvert(Type objectType) in D:\Newtonsoft.Json\Src\Newtonsoft.Json\Converters\KeyValuePairConverter.cs:line 147 when
 the expected exception was System.ArgumentOutOfRangeException!
Error (test3.vst): System.ArgumentNullException: Value cannot be null. (Parameter 't')
   at VSharp.TestRunner.TestRunner.ReproduceTest(FileInfo fileInfo, SuiteType suiteType, Boolean checkResult, Boolean fileMode) in D:\VSharp-fork\VSharp.TestRunner\TestRunner
Tool.cs:line 114
Starting reproducing test4.vst for method Void .ctor()
Test test4.vst failed! The expe
```cted exception System.ArgumentOutOfRangeException was not thrown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant