oss-slu / oss-slu/PilotDataSynchronization

gtest target tests a locally redefined function, not production code

Open
#191 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

testing
Dominant language
Rust
Stars
4
Forks
8
Avg merge
5d 17h
Merged PRs (30d)
2

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with xplane_plugin/tests/test_threading_tools.cpp and xplane_plugin/meson.build, then compare the local generate_packet definition and test calls with threading-tools.h. Review related issues #190, #66, and #103 before deciding whether the target can test production code or should be removed. Done means meson test no longer presents a passing test target that exercises only locally defined code.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.