-
Notifications
You must be signed in to change notification settings - Fork 200
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
Non-persistent input in incremental decoding test #1114
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.
LGTM.
tests/gtest/avifincrtest_helpers.cc
Outdated
@@ -259,7 +279,8 @@ void DecodeIncrementally(const avifRWData& encoded_avif, bool is_persistent, | |||
|
|||
// Emulate a byte-by-byte stream. | |||
PartialData data = {/*available=*/{encoded_avif.data, 0}, | |||
/*fullSize=*/encoded_avif.size}; | |||
/*fullSize=*/encoded_avif.size, | |||
/*buffer=*/{}, /*swapped_buffer=*/{}}; |
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.
IMPORTANT: The initializer needs to be updated.
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 am surprised that this doesn't break compilation. I guess I haven't mastered C++.
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.
(2) applies here, I believe: https://en.cppreference.com/w/cpp/language/zero_initialization
clang-tidy should catch the incorrect comment though.
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.
clang-tidy should catch the incorrect comment though.
Actually maybe that only works on function parameters.
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 am surprised that this doesn't break compilation. I guess I haven't mastered C++.
It is only the comments /*buffer=*/
and /*swapped_buffer=*/
that were wrong. nonpersistent_bytes
was correctly set to {}
(meaning nullptr
) and num_nonpersistent_bytes
to {}
(meaning 0
).
clang-tidy should catch the incorrect comment though.
Maybe we could have a clang-tidy test as part of the GitHub CI.
No description provided.