Repository navigation
state_test/state.h: route cvcstate through file-scope cvc::app; fix valueData<T> ctx - #35
Merged
Merged
Conversation
…fix valueData<T> to use bound _ctx Replaces the deprecated cvcstate macro / cvc::state::instance() zero-arg singleton in the broad TEST(StateTest, ...) cases with a file-scope cvc::app test_ctx and cvc::state::instance(test_ctx). Fixture-based tests (StateDataFixture, StateObjectFixture) keep using their per-test cvc::app ctx member. Also fixes state::valueData<T>() in inc/cvc/state.h: it was looking up referenced data nodes through the global zero-arg singleton; it now routes through the bound _ctx so it shares the same per-app state root the parent state belongs to. 590/590 with CVC_USING_XMLRPC=ON and OFF locally.
transfix
added a commit
that referenced
this pull request
May 4, 2026
…macro (#36) All production and test callers now route through cvc::state::instance(app&) (see PRs #30-#35). Remove the deprecated singleton API surface: - cvcstate macro (inc/cvc/state.h) - cvc::state::instance() zero-arg overload (declaration + definition) - cvc::state::instancePtr() zero-arg shim - state::_instance static cache and the &ctx == &app::instance() cache-write block in instancePtr(app&) State roots are now exclusively per-app, stored on the app's data map under "__state". 590/590 with CVC_USING_XMLRPC=ON and OFF locally.
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.
Migrates the broad
TEST(StateTest, ...)cases off the deprecatedcvcstatemacro / zero-argcvc::state::instance()singleton onto a file-scopecvc::app test_ctxpluscvc::state::instance(test_ctx).Fixture-based tests (
StateDataFixture,StateObjectFixture) continue to use their per-testcvc::app ctxmember, so each test still gets its own isolated app.Also fixes
state::valueData<T>()ininc/cvc/state.h: it was looking up referenced data nodes through the global zero-arg singleton, which causedStateDataFixture.ValueDatato fail once that fixture stopped using the global root. It now routes through the bound_ctxso it shares the per-app state root the parent node belongs to.Local: 590/590 with
-DCVC_USING_XMLRPC=ONand OFF (one rare flaky concurrency test, pre-existing).