-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Alter testutuil::*Doc to return shared_ptrs. #2546
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
Conversation
i.e.: std::shared_ptr<T> x = ...; *x.get() -> *x;
Summary: The mutations require shared_ptrs, everything else does not. This sets up an awkward split between mutation_test.cc and everythingelse_test.cc. But it may still be worth it. For the everythingelse case, there's two approaches we could take:
We should settle on one of those two before submitting. |
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.
I didn't realize how many Document
s and related classes were used by value, but it seems like adding all those dereferences might still be the lesser of two evils.
const Document doc = testutil::Doc("bar/doc", 7654321); | ||
EXPECT_TRUE(none.IsValidFor(&deleted_doc)); | ||
EXPECT_TRUE(none.IsValidFor(&doc)); | ||
const std::shared_ptr<NoDocument> deleted_doc = |
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.
Optional: there was previously an agreement to avoid const
values, so consider omitting those const
s. Entirely optional, because they weren't added in this PR.
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.
Done throughout this file. I've not attempted to apply this more broadly though.
No description provided.