-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial DB tests for CrateStorage #1309
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! I have a few small comments to help make the intent of the code easier to understand.
src/test/cratestorage_test.cpp
Outdated
ASSERT_TRUE(crateId.isValid()); | ||
} | ||
|
||
// Find crate by id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be helpful to clarify this comment a little: "Find the same crate as above, this time by ID instead of name"
src/test/cratestorage_test.cpp
Outdated
|
||
// Update crate name | ||
const auto kNewCrateName = QString("New%1").arg(kCrateName); | ||
Crate crateUpdated = crateById; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why create a new Crate variable here? I think the intention would be clearer by reusing crateById
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. During each step a new, empty crate object should be populated directly from the database. Otherwise you can not be sure if it got its values from the previous read operation.
Ideally the test would be split up into smaller tests, each with a special purpose. But here it was convenient to cover the whole lifecycle by a single test.
Thank you! LGTM |
I've added a simple test for CrateStorage, we did'nt have one yet 🙈 Maybe also helpful for @gramanas how to test the new code for crate hierarchy at the persistent layer.