D12028: taglibextractortest: Add test for files with empty metadata

Stefan BrĂ¼ns noreply at phabricator.kde.org
Thu Apr 12 19:39:12 UTC 2018


bruns added inline comments.

INLINE COMMENTS

> taglibextractortest.cpp:300
> +    }
> +    QCOMPARE(resultKeys, expectedKeys);
> +}

Unfortunately QCOMPARE does not do a deep compare if sizes mismatch.

To get a better output in case the test fails, you can do something like:

  auto excessKeys() = ...
  auto missingKeys() = ...
  
  if (excessKeys().size()) {
      QWARN("Excess properties: " + excessKeys.join(", "));
      if (!failMessage.isEmpty())
          QEXPECT_FAIL(...)
      QCOMPARE(excessKeys.size(), 0);
  }
  
  if (missingKeys().size()) {
      ...
  }

REPOSITORY
  R286 KFileMetaData

REVISION DETAIL
  https://phabricator.kde.org/D12028

To: michaelh, mgallien, #baloo, #frameworks
Cc: bruns, astippich, ashaposhnikov, michaelh, spoorun, ngraham, alexeymin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180412/80b176da/attachment.html>


More information about the Kde-frameworks-devel mailing list