Skip to content

Fix check for "No such file or directory: " error

In Nixpkgs, we get some test failures due to the No such file or directory message being formatted slightly differently than expected:

thumbnailer-service: [12:23:51.553] Warning: "DBusInterface::GetThumbnail(): /build/source/tests/media/no-such-file.jpg: lomiri::ResourceException: Thumbnailer::get_thumbnail():\n    boost::>
/build/source/tests/dbus/dbus_test.cpp:179: Failure
Value of: boost::contains(message, " No such file or directory: ")
  Actual: false
Expected: true
DBusInterface::GetThumbnail(): /build/source/tests/media/no-such-file.jpg: lomiri::ResourceException: Thumbnailer::get_thumbnail():
    boost::filesystem::canonical: No such file or directory [generic:2]: "/build/source/tests/media/no-such-file.jpg"

Fix those tests for us by making the check less strict about what follows that message.

There are 2 more tests for No such file or directory: that we don't need to be make less strict, so I opted for not changing their strings there. Haven't looked into why they're fine as-is, but I can adjust them for consistency's sake if you want.

Merge request reports