-
Notifications
You must be signed in to change notification settings - Fork 712
introduce sanity check when creating bufferdatasink #8709
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/8709
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit ee32958 with merge base f9dc6ef ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This pull request was exported from Phabricator. Differential Revision: D70190912 |
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.
seems reasonable
|
@pytorchbot label "topic: not user facing" |
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.
This is a great change; a static factory is a much better way to handle creation in our exception-free system.
| TEST_F(BufferDataSinkTest, StorageSizeCheck) { | ||
| Result<size_t> ret = data_sink_->get_storage_size(); | ||
| Result<BufferDataSink> buffer_data_sink = BufferDataSink::create(buffer_); | ||
| ASSERT_EQ(buffer_data_sink.error(), Error::Ok); |
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'd be good to put this same ASSERT after all create calls in this file
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 the suggestion! Making buffer_data_sink as a private variable in BufferDataSinkTest class, and putting ASSERT after creations, for better structure.
Summary: This diff introduces sanity check on data alignment when creating buffer_data_sink. Also, for better control the raised error, we changed to use static function instead of constructor for constuction. Reviewed By: swolchok Differential Revision: D70190912
ce31605 to
21384eb
Compare
|
This pull request was exported from Phabricator. Differential Revision: D70190912 |
Summary: This diff introduces sanity check on data alignment when creating buffer_data_sink. Also, for better control the raised error, we changed to use static function instead of constructor for constuction. Reviewed By: swolchok Differential Revision: D70190912
21384eb to
264c73e
Compare
|
This pull request was exported from Phabricator. Differential Revision: D70190912 |
Summary: This diff introduces sanity check on data alignment when creating buffer_data_sink. Also, for better control the raised error, we changed to use static function instead of constructor for constuction. Reviewed By: swolchok Differential Revision: D70190912
264c73e to
ee32958
Compare
|
This pull request was exported from Phabricator. Differential Revision: D70190912 |
Summary: This diff introduces sanity check on data alignment when creating buffer_data_sink. Also, for better control the raised error, we changed to use static function instead of constructor for constuction.
Differential Revision: D70190912