Correct asserts/error handling in MTimeDB
ClosedPublic

Authored by bruns on Apr 6 2019, 6:51 PM.

Details

Summary

Mtime == 0 is valid (see commits 7842142c3288 and 628daced19b8), so
remove any contradicting asserts.
Also allow a zero docId for anything but MTimeDB::put, and replace the
assert in put with a warning message. (E.g. deleting a 0 docId may be useful
for cleanup, as inserting it was possible in Release builds).

For actual errors print warning messages (instead of debug), but silence
any NOTFOUND conditions (empty ranges are a valid condition).

Test Plan

make (debug build)
ctest

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Apr 6 2019, 6:51 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptApr 6 2019, 6:51 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Apr 6 2019, 6:51 PM
dfaure added a comment.Apr 6 2019, 9:51 PM

+1 from me, thanks for the quick patch. Needs approval from someone who knows the code though.

ngraham accepted this revision.Apr 6 2019, 10:54 PM

Nicely done.

This revision is now accepted and ready to land.Apr 6 2019, 10:54 PM
This revision was automatically updated to reflect the committed changes.