-
-
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
AnalyzerWaveformTest refactoring as a foundation for more tests #11488
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.
The canary test is definitely a little weird and would still break if the analyzer would overrun its buffer significantly. Why do we not bounds check instead?
for (std::size_t i = 0; i < kCanarySize; i++) { | ||
m_canaryBigBuf[i] = kCanaryFloat; | ||
} | ||
for (std::size_t i = kCanarySize; i < kCanarySize + kBigBufSize; i++) { | ||
m_canaryBigBuf[i] = kMagicFloat; | ||
} | ||
for (std::size_t i = kCanarySize + kBigBufSize; i < 2 * kCanarySize + kBigBufSize; i++) { | ||
m_canaryBigBuf[i] = kCanaryFloat; | ||
} |
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.
couldn't these be memset
s?
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.
memset() works with char arrays only. We can do a lot more refactoring here, but I like to stop at this point.
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.
Right, I forgot about that.
The whole test is kind of pointless, because the buffer is passed to the analyzer as const. So there must be went a lot of things wrong to make this test fail. Maybe it was relevant for an early version of the analyzer? We may consider to remove it. |
The next step is to add a test the compares the resulting waveform.