-
Notifications
You must be signed in to change notification settings - Fork 226
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
SE: Add IInvocationOperationExtensions.Target
tests
#9513
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review 1
analyzers/src/SonarAnalyzer.CSharp/SymbolicExecution/Roslyn/HardcodedBytesRuleBase.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.CSharp/SymbolicExecution/Roslyn/HardcodedBytesRuleBase.cs
Outdated
Show resolved
Hide resolved
analyzers/src/SonarAnalyzer.CSharp/SymbolicExecution/Roslyn/HardcodedBytesRuleBase.cs
Outdated
Show resolved
Hide resolved
...src/SonarAnalyzer.CSharp/SymbolicExecution/Roslyn/SecureRandomSeedsShouldNotBePredictable.cs
Outdated
Show resolved
Hide resolved
...src/SonarAnalyzer.CSharp/SymbolicExecution/Roslyn/SecureRandomSeedsShouldNotBePredictable.cs
Outdated
Show resolved
Hide resolved
...zers/tests/SonarAnalyzer.Test/SymbolicExecution/Roslyn/IInvocationOperationExtensionsTest.cs
Outdated
Show resolved
Hide resolved
...zers/tests/SonarAnalyzer.Test/SymbolicExecution/Roslyn/IInvocationOperationExtensionsTest.cs
Outdated
Show resolved
Hide resolved
...zers/tests/SonarAnalyzer.Test/SymbolicExecution/Roslyn/IInvocationOperationExtensionsTest.cs
Outdated
Show resolved
Hide resolved
...zers/tests/SonarAnalyzer.Test/SymbolicExecution/Roslyn/IInvocationOperationExtensionsTest.cs
Outdated
Show resolved
Hide resolved
...zers/tests/SonarAnalyzer.Test/SymbolicExecution/Roslyn/IInvocationOperationExtensionsTest.cs
Outdated
Show resolved
Hide resolved
5cc5a3d
to
6ea30bf
Compare
@@ -97,7 +97,7 @@ public override void ExecutionCompleted() | |||
protected override ProgramState PreProcessSimple(SymbolicContext context) | |||
{ | |||
if (context.Operation.Instance.AsInvocation() is { } invocation | |||
&& invocation.Instance is { } instance | |||
&& invocation.Target(context.State) is { } instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a test with a fake extension method 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good over all, still missing a test, I think.
...narAnalyzer.Test/TestCases/SymbolicExecution/Roslyn/EmptyCollectionsShouldNotBeEnumerated.cs
Show resolved
Hide resolved
...s/src/SonarAnalyzer.Common/SymbolicExecution/Roslyn/OperationProcessors/CollectionTracker.cs
Outdated
Show resolved
Hide resolved
6f75804
to
1c95755
Compare
@@ -720,6 +721,7 @@ public void Invocation_CollectionMethods_SetCollectionConstraint() | |||
Verify("clear", ObjectConstraint.NotNull, CollectionConstraint.Empty); | |||
Verify("add", ObjectConstraint.NotNull, CollectionConstraint.NotEmpty); | |||
Verify("remove", ObjectConstraint.NotNull); | |||
Verify("addExtension", ObjectConstraint.NotNull, CollectionConstraint.NotEmpty); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was not adding notempty before that change in the collectionTracker that I missed adding a UT for.
Quality Gate passed for 'Sonar .NET Java Plugin'Issues Measures |
Quality Gate passed for 'SonarAnalyzer for .NET'Issues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
IInvocationOperationExtensions.GetInstance
testsIInvocationOperationExtensions..Target
tests
IInvocationOperationExtensions..Target
testsIInvocationOperationExtensions.Target
tests
No description provided.