Skip to content

Undefined behavior invoked in unittest framework #27

@cmlsharp

Description

@cmlsharp

This is #24 at work. The trace macro uses try/catch and potentially clobbers the variables that it is testing. GCC actually warns about this if you compile with warnings at a higher optimization level than -O0. This occurs 33 times across the library. It was fairly trivial to mark the variables declared in unit tests within the library as volatile (see db1aa2b), but this framework is public (though undocumented), so if a user wanted to write unit tests using it, they would run into this same issue. This also means that removing exceptions from the library would also mean removing the unit tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions