log/full: Fix log level unit test #3430
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unit test was broken in several ways and pass verdict was not reliable.
First of log_offset used for starting walk was never initialized and received random data.
By accident this data had non zero ts_stamp that resulted in expected start from the beginning (it stack was different it could look for timestamp instead).
log_last_walk function that is called on each enumerated entry used uninitialized lo_index value to report last entry index. The assumption that lo_index has means something in this context was also incorrect as this value never changes in walk functions. It looks like original code expected this value to have index of log entry which it never does.
Code also did not expected that very first entry added to the log will have index 0 (which was never modified correctly). To read entry index log_read function must be called.
So now walk callback function does read index of the log.
After fixing incorrect code few more conditions are tested.