Menu

TestCondition::alwaysTrue, TestCondition::alwaysTrueContainer fail on some platforms

2023-09-10
2023-09-12
  • Wolfgang Stöggl

    Hi,
    in the meantime, there are 2 failing tests. In the initially reported bug, it was one [1].
    Cppcheck version: 2.12.0

    Under Fedora, the failing style tests occur under aarch64, ppc64le and s390x. The following architectures are OK: i686, x86_64.

    Output from a current build log (e.g. aarch64) [2]:

    Number of tests: 4426Number of todos: 331
    Tests failed: 2
    /builddir/build/BUILD/cppcheck-2.12.0/test/testcondition.cpp:4501(TestCondition::alwaysTrue): Assertion failed.
    Expected:
    [test.cpp:6]: (style) Condition 'o[1]=='\0'' is always false\n
    Actual:
    [test.cpp:4] -> [test.cpp:6]: (style) Condition 'o[1]=='\0'' is always false\n


    /builddir/build/BUILD/cppcheck-2.12.0/test/testcondition.cpp:5014(TestCondition::alwaysTrueContainer): Assertion failed.
    Expected:
    [test.cpp:5]: (style) Condition 'buffer.back()=='\0'' is always false\n
    Actual:
    [test.cpp:3] -> [test.cpp:5]: (style) Condition 'buffer.back()=='\0'' is always false\n


    Best regards
    Wolfgang
    [1] https://trac.cppcheck.net/ticket/11537[2] https://koji.fedoraproject.org/koji/taskinfo?taskID=105994092

     
    • Wolfgang Stöggl

      As a workaround for now, -fsigned-char can be added to CXXFLAGS.
      This makes all tests pass also on aarch64, ppc64le and s390x, where char is unsigned by default.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.