Consistently use override
in tests
#3934
Merged
+104
−105
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.
As a general rule, we avoid significant cleanups of test code. This is partly because some tests are deliberately doing strange things to exercise weird corners of the product, and "cleaning up" the strangeness could affect test coverage. It's also because test code is much less important for long-term maintainability - if the tests keep passing, we generally don't care about them after they've been written.
However, we do try to enforce some basic conventions across the entire codebase including the tests. In the product code, we now follow a convention of saying only
override
. This avoids redundancy and allowsvirtual
andoverride
to serve different purposes (now when we seevirtual
we know we're introducing a new virtual member function). And usingoverride
is much safer than not using it.This is so important for safety, and so non-disruptive, that it's worth making the tests consistent. (Including within the legacy
tr1
test suite that we even more strongly avoid changing.) This PR consists of two commits performing related systematic changes:virtual
when weoverride
.override
instead ofvirtual
.