chore: replace UnitTestConfig with INTERCEPT #5733
Merged
+23
−191
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.
This is a follow-up to #5725 which added the
INTERCEPTcapability to inject essentially arbitrary code into pre-defined points in the execution of the core library (when enabled by the feature, of course).This pull request uses this new capability to replace an older class whose goal was quite similar: the
UnitTestConfig. This class was a singleton with some predefined parameters which could be set by unit tests and then checked in-line by the library code in order to simulate specific behaviors. Based on its broad inclusion in test sources, this class probably used to do more than it does now; as of this writing it has just one parameter which is used in one place.This is an excellent use case for interception since we can move the test parameter exclusively into the test code, with the library code just intercepting relevant variables from its stack frame. So, this pull request replaces the old with the new.
TYPE: NO_HISTORY
DESC: replace UnitTestConfig with INTERCEPT