limitedmap fixes and tests#6561
Merged
laanwj merged 3 commits intobitcoin:masterfrom Aug 19, 2015
casey:limitedmap
Merged
Conversation
Member
|
ACK |
Contributor
|
utACK |
Member
|
utACK. Thanks a lot for adding tests! |
Contributor
|
Is it worth adding a test to verify that |
Contributor
Author
|
It does this already, unless you were thinking of a more substantial test: 11 elements are added (one one off, and then ten in a loop) and then line 39 checks that there are only 10 elements. |
Contributor
|
Sorry, I missed that first insert @casey. utACK :) |
luke-jr
pushed a commit
to luke-jr/bitcoin
that referenced
this pull request
Jan 9, 2016
Github-Pull: bitcoin#6561 Rebased-From: fd2d862
luke-jr
pushed a commit
to luke-jr/bitcoin
that referenced
this pull request
Jan 9, 2016
Github-Pull: bitcoin#6561 Rebased-From: 7bd57bb
luke-jr
pushed a commit
to luke-jr/bitcoin
that referenced
this pull request
Jan 10, 2016
Github-Pull: bitcoin#6561 Rebased-From: fd2d862
zkbot
added a commit
to zcash/zcash
that referenced
this pull request
Feb 19, 2021
Bitcoin 0.12 misc P2P/Net PRs Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#5288 - Only the reorg, option was removed in bitcoin/bitcoin#6374 which we merged in #1258 - bitcoin/bitcoin#6561 - bitcoin/bitcoin#6728 - bitcoin/bitcoin#6829 - bitcoin/bitcoin#6974 - bitcoin/bitcoin#7075 - bitcoin/bitcoin#7166 Part of #2074.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 PR consists of three commits.
The first fixes a bug where the size of a limited map was actually one less than the maximum size set. This shouldn't matter at all for the existing code, since there is only one limitedmap, and its size is very large.
The second disallows unlimited limited maps, since that doesn't make very much sense, and simplifies the code a little bit. (I'm not too attached to this, in case anyone doesn't like this change I can just remove it.)
The third adds unit tests for limitedmap, which were previously absent.
I elected to leave the commits unsquashed for review, since they're logically separate, but I can squash if desired.