Skip to content

Commit

Permalink
Bugfix in Assert#assertNotEquals(float, float, float, String)
Browse files Browse the repository at this point in the history
Reproducible test:

    @test(expectedExceptions = AssertionError.class)
    public void assertNotEqualsFloatFail() {

        Assert.assertNotEquals(1.0F, 1.1F, 0.2F, "message");
    }
  • Loading branch information
RiJo committed Oct 19, 2021
1 parent 80e02ff commit 7308c97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion testng-asserts/src/main/java/org/testng/Assert.java
Original file line number Diff line number Diff line change
Expand Up @@ -2073,7 +2073,7 @@ static void assertNotEquals(int actual, int expected) {
}

public static void assertNotEquals(float actual, float expected, float delta, String message) {
if (areEqual(actual, expected)) {
if (areEqual(actual, expected, delta)) {
Assert.fail(format(actual, expected, message, false));
}
}
Expand Down

0 comments on commit 7308c97

Please sign in to comment.