Skip to content

CodeQL flagging cast between HRESULT and boolean type #503

@DefaultRyan

Description

@DefaultRyan

tests/RegistryTests.cpp has multiple instances of

REQUIRE_FAILED(false);

The REQUIRE_FAILED macro checks an HRSESULT, and false will cast into an integer with a value of 0, which indicates success.

To fix, these should be explicit fails. Seeing as how catch2 is used, perhaps FAIL(<optional msg>); is wanted instead. https://github.com/catchorg/Catch2/blob/devel/docs/skipping-passing-failing.md#top

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcode-analysisBugs that are reported by code analysis tools, but not the compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions