Skip to content

ASSERT_EQUAL should not assume integer #53

@digitalentity

Description

@digitalentity

In certain test-cases it's necessary to test for an exact float-point value. ASSERT_EQUAL is not suitable for this because it assumes arguments to be integers. ASSERT_FLT_NEAR is not suitable either, because it will accept not equal values.

The workaround I currently use is ASSERT_TRUE(function_under_test() == 1.0f), which works as expected, but is not as readable as ASSERT_EQUAL(function_under_test(), 1.0f).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions