Skip to content

Commit

Permalink
Reproducer for S2252 FP (#5429)
Browse files Browse the repository at this point in the history
  • Loading branch information
csaba-sagi-sonarsource authored Feb 25, 2022
1 parent 1eef25a commit 525e4d5
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ void LoopTest(int x, int y)
var z = 0;
for (int i = 0; i < z; i++) { } // FN - we only check for literals in the condition
for (; z < 0; z++) { } // FN - we only check for initializers inside the loop statement

// Reproducer for https://github.com/SonarSource/sonar-dotnet/issues/5428
for (float n = 0.0F; n > -0.1F; n -= 0.005F) { } // Noncompliant FP
for (double n = 0.0; n > -0.1; n -= 0.005) { } // Noncompliant FP
for (var n = 0.0; n > -0.1; n -= 0.005) { } // Noncompliant FP
}
}
}

0 comments on commit 525e4d5

Please sign in to comment.