Skip to content

Commit

Permalink
(cqfn#215) LCOM4 static fields are now called by FQN (rounding error …
Browse files Browse the repository at this point in the history
…as a param)
  • Loading branch information
ilyakharlamov committed Jan 25, 2019
1 parent 1712cc7 commit 4ae3d32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/test/java/org/jpeek/metrics/Lcom4Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* @since 0.28
* @checkstyle JavadocMethodCheck (500 lines)
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
* @checkstyle MagicNumberCheck (500 lines)
*/
public final class Lcom4Test {

Expand Down Expand Up @@ -100,7 +101,7 @@ public void methodMethodCalls() throws Exception {
).size()
);
report.assertVariable(Lcom4Test.ATTRIBUTES, 1);
report.assertValue(1.0f, 0.001);
report.assertValue(1.0f, 0.001f);
}

/**
Expand All @@ -126,7 +127,7 @@ public void oneCommonAttribute() throws Exception {
);
report.assertVariable(Lcom4Test.ATTRIBUTES, 1);
report.assertVariable(Lcom4Test.PAIRS, 1);
report.assertValue(1.0f, 0.001d);
report.assertValue(1.0f, 0.001f);
}

/**
Expand All @@ -146,7 +147,7 @@ public void notCommonAttributes() throws Exception {
);
report.assertVariable(Lcom4Test.ATTRIBUTES, 2);
report.assertVariable(Lcom4Test.PAIRS, 0);
report.assertValue(2.0f, 0.001);
report.assertValue(2.0f, 0.001f);
}

/**
Expand All @@ -162,6 +163,6 @@ public void notCommonAttributesWithAllArgsConstructor() throws Exception {
);
report.assertVariable(Lcom4Test.ATTRIBUTES, 2);
report.assertVariable(Lcom4Test.PAIRS, 0);
report.assertValue(2.0f);
report.assertValue(2.0f, 0.001f);
}
}
2 changes: 1 addition & 1 deletion src/test/java/org/jpeek/metrics/MetricBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void assertVariable(final String variable,
* @param error Rounding tolerance since the metric is float number
* @throws Exception String format exception
*/
public void assertValue(final double value, double error) {
public void assertValue(final double value, final double error) {
new Assertion<>(
"The metric value is not calculated properly",
() -> Double.parseDouble(
Expand Down

0 comments on commit 4ae3d32

Please sign in to comment.