summaryrefslogtreecommitdiff
path: root/crates/tor-persist/src/testing.rs
Commit message (Collapse)AuthorAgeFilesLines
* Change how TestingStateMgr handles locking.Nick Mathewson2021-11-031-43/+80
| | | | | | Previously it was either all-locked or all-not-locked. Now you can simulate having the same shared storage opened by multiple managers, only one of which has the lock.
* Add Futureproof<T> wrapper type, use for GuardDisabled enumeta2021-10-271-0/+42
| | | | | | | | | | | The Futureproof<T> type lets you serialize and deserialize types whose representations might change (most useful for enums that might grow additional variants). It uses #[serde(untagged)] to accomplish this. This gets used in order to make the `disabled` field of `Guard` more robust against future guard disablement reasons being added. A test was also added to verify correct behaviour of the new type.
* Remove try_lock from StorageHandle.Nick Mathewson2021-10-201-2/+2
|
* Replace the return type of StorageMgr::try_lock with a tristateNick Mathewson2021-10-201-8/+12
| | | | | It's useful to know now only if we now have the lock, but also if we just got it for the first time.
* Fix some typos (via the "typos" tool)Nick Mathewson2021-10-081-2/+2
|
* Change tor-persist to use json instead of toml.Nick Mathewson2021-10-071-3/+4
| | | | | | The limitations with toml seemed to be reaching a head, and I wasn't able to refactor the guardmgr code enough to actually have its state be serializable as toml. Json's limitations are much narrower.
* Add tests for tor-persist object-safe wrapper.Nick Mathewson2021-09-301-0/+34
|
* tor-persist: Add a testing-only state manager that doesn't use diskNick Mathewson2021-09-301-0/+166