Skip to content

app_test: convert to TEST_F fixture (remove cvcapp singleton use)#14

Merged
transfix merged 1 commit into
masterfrom
cvc-singleton/app-test
May 2, 2026
Merged

app_test: convert to TEST_F fixture (remove cvcapp singleton use)#14
transfix merged 1 commit into
masterfrom
cvc-singleton/app-test

Conversation

@transfix
Copy link
Copy Markdown
Owner

@transfix transfix commented May 1, 2026

Restructures the 72 free TEST(AppTest, ...) cases into TEST_F under a fixture that owns its own cvc::app ctx, so each test runs against an independent app instance instead of the global cvcapp singleton.

  • s/cvcapp/ctx/g across all ~331 reference sites
  • Replace SingletonInstance test with ConstructionYieldsValidInstance (equivalent check on the local ctx reference)
  • Capture this in the data_reader lambda in ReadDataWithReaders
  • Pass ctx explicitly to scoped_lock and thread_feedback ctors so they don't silently fall back on app::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.

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).
@transfix transfix merged commit e89645c into master May 2, 2026
19 checks passed
@transfix transfix deleted the cvc-singleton/app-test branch May 2, 2026 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant