aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-persist/src/testing.rs
Commit message (Collapse)AuthorAgeFilesLines
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* add feature annotation not added by doc_auto_cfgtrinity-1686a2022-08-241-0/+1
|
* tor-persist: Big refactoring on Error type.Nick Mathewson2022-07-061-5/+28
| | | | | | | | | | | Every error now has an action (what we were trying to do), a resource (what we were trying to do it to), and a source (what problem we encountered). Initially I tried to add "action" and "resource" fields to error variants individually, but that led to a combinatorial explosion. Part of #323.
* tor-persist: Move Error to a module.Nick Mathewson2022-07-061-3/+2
|
* Fix clippy::significant_drop_in_scrutinee warningsNick Mathewson2022-06-151-1/+2
| | | | | | | | | This is apparently a new warning from clippy nightly, documented in https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_in_scrutinee . I'm not in love with the temporary variables that this warning wants me to introduce, but it does seem like a decent way to avoid some kinds of deadlock.
* arti-client: Unlock the state manager on failure to bootstrapeta2022-02-241-5/+18
| | | | | | | | | | | | `StateMgr` got a new `unlock()` method that does what it says on the tin. We now call it from `bootstrap()` using the new `util::StateMgrUnlockGuard`, which works in a manner similar to the `BoolResetter` from `tor_dirmgr`. (A decent small little task in future might be to unify these types in some sort of general arti utility crate?) closes arti#335
* tor-persist: Distinguish load vs. store json errorsIan Jackson2022-02-041-2/+3
| | | | | | | | Serialisation errors ought not to occur, since they would represent an attempt to store malformed data, or something. (We always convert to a string, so the JSON error never contains IO errors or the like.) Deserialisation errors mean the persistent state is corrupt.
* address clippy's latest lintDaniel Eades2021-12-201-0/+1
|
* 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