fix: remove dead test variables#511
Open
Becheler wants to merge 1 commit into
Open
Conversation
|
Compiler-warning counts vs
|
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.
Refs #496
Before submitting
developbranch.Type of change
Does this PR introduce a breaking change?
What this PR does
Remove dead
-Wunused-but-set-variabletest variablesClears ~19 clang
-Wunused-but-set-variablewarnings per CI job. All changes aretest-only with no behavioral effect: each removed variable was written but never read.
test/graph.cpp(E): An edge counter (++Eon add,--Eon remove) introduced with the original graph test file (Jeremy Siek, 2000) that was never read in the entire history of the file. The actual edge-count invariant is already verified viacount_edges(g), soEwas redundant scaffolding from day one. Removed the declaration and its three writes.test/property_iter.cpp(E): The same write-only edge-counter idiom, never read. This test exercises property iterators, so the counter was never relevant. Removed the declaration and its single increment.test/csr_graph_test.cpp(edge_countblock): Originally (Douglas Gregor, 2005) this counted a vertex's out-edges to verify the CSRedge()andedge_range()functions. Those functions were deliberately removed in 2009 (Jeremiah Willcock) as unsupportable under the CSR model, along with the assertions that used the count, but the counting loop was left behind. Removed the whole orphaned block (also clearing a latent unusedoei2_endand avoiding cascading-Wunused-variable/-Wempty-bodywarnings that deleting only the variable would cause).These can't be repurposed into assertions: the
Ecounters have no readable invariant (the real edge-count check already lives incount_edges(g), andnum_edges == Ewould be wrong for multigraph configs), andedge_countonly ever backed assertions that were deliberately removed in 2009 with theedge()/edge_range()functions.Motivation
See #496
Testing
Checklist
b2in thetest/directory).