Skip to content

gtest target tests a locally redefined function, not production code #191

Description

@Phlabry

Describe the bug
xplane_plugin/tests/test_threading_tools.cpp includes threading-tools.h, which declares generate_packet(vector<string>), then defines its own generate_packet(const string&, const string&, const string&, const string&) at line 11. Both tests call the local four-string version, so overload resolution never reaches the header's declaration. That is also why the header's missing definitions never cause a link error.

test_threading_tools is the only test target in xplane_plugin/meson.build, so the C++ suite currently exercises no production code at all. meson test passing means nothing.

Expected behavior
The suite tests real production code, or the target is removed so a passing run is not mistaken for coverage.

Additional context
ThreadMessage in the header is a four-float struct, predating the current eight-value payload, so the test reflects an obsolete data model. Related to #66 and #103. Should be resolved together with #190.

Found while writing the setup documentation in #138 / #178.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions