Skip to content

Missing <limits> include in 'CppUnitTestFramework.hpp' #23

@fventuri

Description

@fventuri

I am running Linux (Fedora 36 to be exact) here, and when I try to compile some unit tests using this framework, they fail to build with this error message:

CppUnitTestFramework.hpp:561:47: error: ‘numeric_limits’ is not a member of ‘std’
561 | if ((b < 1.0f) && (a > b*std::numeric_limits::max())) {

Looking at this 'c++ reference' site: https://en.cppreference.com/w/cpp/types/numeric_limits it seems that using 'std::numeric_limits' would require '#include <limits>', and indeed if I add that include between lines 7 and 8 of 'CppUnitTestFramework.hpp', I am then able to build my unit tests successfully.

Thanks,
Franco

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