Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

ArchiveDB and other small fixes #5867

Merged
merged 4 commits into from
Jun 19, 2017
Merged

Conversation

guanqun
Copy link
Contributor

@guanqun guanqun commented Jun 18, 2017

Add test cases, spaces to tab etc.

@rphmeier rphmeier added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Jun 18, 2017
@@ -296,6 +296,7 @@ mod test {
assert!(check_vault_name("vault_with_underscores"));
assert!(check_vault_name("vault-with-dashes"));
assert!(check_vault_name("vault-with-digits-123"));
assert!(check_vault_name("vault中文名字"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea to check that unicode works fully :)

jdb.remove(&h);
jdb.remove(&h);
// commit_batch would call journal_under(),
// and we don't allow multiple owned removals.
Copy link
Contributor

@rphmeier rphmeier Jun 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semantics of journaldb are a little weird as it never deletes the key from the backing store, so it actually wouldn't panic if the two removals were done on opposite sides of a journal_under operation...but as this test it will panic if you remove twice in a single batch.

Copy link
Contributor Author

@guanqun guanqun Jun 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I deliberately remove twice in a single batch and so mark this test as should_panic. This basically tests the assert logic, if you think it's un-necessary, I can revert this change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't hurt to have the test case -- it will let us know if that behavior changes.

@arkpar arkpar added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jun 19, 2017
@rphmeier rphmeier merged commit bedce59 into openethereum:master Jun 19, 2017
@guanqun guanqun deleted the small-fixes branch June 19, 2017 15:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants