app_test: convert to TEST_F fixture (remove cvcapp singleton use)#14
Merged
Conversation
Restructure the 72 free TEST(AppTest, ...) cases into TEST_F under a
fixture that owns a fresh `cvc::app ctx` member, so each test runs
against an independent app instance instead of the global `cvcapp`
singleton. Mechanical s/cvcapp/ctx/g for the ~331 reference sites,
plus the following targeted edits:
- Replace the SingletonInstance test (which asserted that two
cvcapp references compare equal) with ConstructionYieldsValidInstance
that does the equivalent check on the local `ctx` reference.
- Capture `this` in the data_reader lambda in ReadDataWithReaders
so it can read the fixture's ctx member.
- Pass `ctx` explicitly to scoped_lock and thread_feedback ctors;
the legacy string-only ctors otherwise silently fall back on
app::instance(), giving false negatives on the per-fixture state.
ctest -R AppTest -j4: 72/72 passed.
Part of cvc-singleton-removal-plan.md (PR 8 — app piece).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restructures the 72 free
TEST(AppTest, ...)cases intoTEST_Funder a fixture that owns its owncvc::app ctx, so each test runs against an independent app instance instead of the globalcvcappsingleton.SingletonInstancetest withConstructionYieldsValidInstance(equivalent check on the localctxreference)thisin the data_reader lambda inReadDataWithReadersctxexplicitly toscoped_lockandthread_feedbackctors so they don't silently fall back onapp::instance()ctest -R AppTest -j4: 72/72 passed.Part of cvc-singleton-removal-plan.md (PR 8 \u2014 app_test piece). Stacks on top of #11/#12/#13.