Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial DB tests for CrateStorage #1309

Merged
merged 2 commits into from
Jul 13, 2017
Merged

Initial DB tests for CrateStorage #1309

merged 2 commits into from
Jul 13, 2017

Conversation

uklotzde
Copy link
Contributor

@uklotzde uklotzde commented Jul 9, 2017

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.

Copy link
Contributor

@Be-ing Be-ing left a 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.

ASSERT_TRUE(crateId.isValid());
}

// Find crate by id
Copy link
Contributor

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"


// Update crate name
const auto kNewCrateName = QString("New%1").arg(kCrateName);
Crate crateUpdated = crateById;
Copy link
Contributor

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

Copy link
Contributor Author

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.

@daschuer
Copy link
Member

Thank you! LGTM

@daschuer daschuer merged commit e05521e into mixxxdj:master Jul 13, 2017
@Be-ing Be-ing mentioned this pull request Jul 15, 2017
13 tasks
@uklotzde uklotzde deleted the cratestorage_tests branch November 25, 2017 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants