increase test coverage of taglibwriter
ClosedPublic

Authored by astippich on Sep 23 2018, 10:24 AM.

Details

Summary

increase the test coverage by testing more mimetypes, and use some unicode characters

Test Plan

taglibwriter test pass

Diff Detail

Repository
R286 KFileMetaData
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
astippich created this revision.Sep 23 2018, 10:24 AM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptSep 23 2018, 10:24 AM
Restricted Application added subscribers: Baloo, kde-frameworks-devel. · View Herald Transcript
astippich requested review of this revision.Sep 23 2018, 10:24 AM

In general this looks good, but I would like two changes:

  1. Do the conversion to QTest first, and leave out the change for unicode testing (e.g. Title1 -> Title €)
  2. Add a third column like "stringsuffix", and then add another test (row) for each format. QStringLiteral("Title1") then becomes QStringLiteral("Title1") + stringsuffix

(2.) would go in a dependent review.

astippich updated this revision to Diff 42196.Sep 23 2018, 5:13 PM
  • don't change test strings for now

Looks good to me. A nice and simple way to drastically increase test coverage.

src/writers/taglibwriter.cpp
22–24

Unrelated. but consider making this static ?

astippich added inline comments.Sep 24 2018, 6:10 PM
src/writers/taglibwriter.cpp
22–24

Never really though about that, but should be static, yes. None of the writers and extractors I looked at currently do this, so if I find time I will do that for all at once and separately

bruns requested changes to this revision.Sep 27 2018, 10:34 PM
bruns added inline comments.
autotests/taglibwritertest.cpp
74

Can you sort the tests alphabetically? It does not matter much, but IMHO it is nicer to have some rule for ordering, instead of arbitrary order.

src/writers/taglibwriter.cpp
25

Can you also order these alphabetically based on the main mime type (aliases immediate after)?

30

audio/wav and the next three are not backed by tests AFAICS, can you add these in a separate review, accompanied by tests files?

This revision now requires changes to proceed.Sep 27 2018, 10:34 PM
astippich updated this revision to Diff 42519.Sep 28 2018, 8:06 PM
  • remove untested mime types and sort
bruns accepted this revision.Sep 28 2018, 8:09 PM
This revision is now accepted and ready to land.Sep 28 2018, 8:09 PM
This revision was automatically updated to reflect the committed changes.