Add initial parking_lot_core tests#191
Merged
bors[bot] merged 3 commits intoAmanieu:masterfrom Nov 16, 2019
Merged
Conversation
Owner
|
LGTM. Do you think it would be possible to extend these to cover |
Collaborator
Author
|
I'm aiming for adding more tests. So we at least touch the entire public API of |
Amanieu
approved these changes
Nov 16, 2019
Owner
|
bors r+ |
bors Bot
added a commit
that referenced
this pull request
Nov 16, 2019
191: Add initial parking_lot_core tests r=Amanieu a=faern This library could use more tests, to be more robust. This was one of the things pointed out in the review of the integration into std in rust-lang/rust#56410 `WTF::ParkingLot` has a number of tests we can take inspiration from. And this is somewhat of a port of some of those tests. However, when I ported it 1:1 I found a race condition, so I had to implement the semaphore a bit differently. I also got away without the tests relying on a working mutex or condvar implementation. Because we can't make the `parking_lot_core` tests depend on the higher level `parking_lot`, nor do we want to depend on locking primitives in std if we aim to become the base for those implementations one day. Co-authored-by: Linus Färnstrand <faern@faern.net>
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.
This library could use more tests, to be more robust. This was one of the things pointed out in the review of the integration into std in rust-lang/rust#56410
WTF::ParkingLothas a number of tests we can take inspiration from. And this is somewhat of a port of some of those tests. However, when I ported it 1:1 I found a race condition, so I had to implement the semaphore a bit differently.I also got away without the tests relying on a working mutex or condvar implementation. Because we can't make the
parking_lot_coretests depend on the higher levelparking_lot, nor do we want to depend on locking primitives in std if we aim to become the base for those implementations one day.