Cover restoring the tree expansion state and the viewer element map - #4246
Open
vogella wants to merge 1 commit into
Open
Cover restoring the tree expansion state and the viewer element map#4246vogella wants to merge 1 commit into
vogella wants to merge 1 commit into
Conversation
Restoring the expansion state by tree path had thin coverage. The one test that exercised it, MultipleEqualElementsTreeViewerTest, ran without an element comparer, although the comparer decides how a tree path hashes and compares, and nothing checked what happens to the items the walk reaches after the last path to expand has been found. TreeViewerExpansionStateTest covers the round trip with and without a comparer, restoring a subset and an empty set, restoring from equal but distinct elements the way a content provider does after a refresh, and the state of the containers the walk passes once its work is done. The hash table a viewer keeps to map elements to items had no coverage of its own at all. It is package private, so StructuredViewerElementMapTest reaches it the way a client does, through a comparer that decides the hashes: several keys in one slot, keys whose hashes differ but share a slot, a table grown well past its initial capacity, and removal. Also gives TreeViewerExpansionTest a second shape, a few large containers with one of them expanded, which is where restoring is most expensive.
Contributor
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.
Restoring the expansion state by tree path had thin coverage. The only test that exercised it,
MultipleEqualElementsTreeViewerTest, ran without an element comparer, although the comparer is what decides how a tree path hashes and compares, and nothing checked what happens to the items the walk reaches after the last path to expand has been found.TreeViewerExpansionStateTestcovers the round trip with and without a comparer, restoring a subset and an empty set, restoring from equal but distinct elements the way a content provider does after a refresh, and the state of the containers the walk passes once its work is done.The hash table a viewer keeps to map elements to items had no coverage of its own at all, which is uncomfortable for a hand-written table that every viewer with hash lookup depends on. It is package private, so
StructuredViewerElementMapTestreaches it the way a client does, through a comparer that decides the hashes: several keys in one slot, keys whose hashes differ but share a slot, a table grown well past its initial capacity, and removal.All of it passes on master unchanged, since this is coverage for existing behaviour rather than a fix.