This is a snapshot of a work-in-progress documentation theme. If you feel lost, miss something, or want to see the original Doxygen docs instead, head over to the archived version of this documentation page.

Corrade::TestSuite::Compare::File class

Pseudo-type for comparing file contents.

Prints the length of both files (if they are different) and prints value and position of first different character in both files. Filenames are expected to be in UTF-8. Example usage:

CORRADE_COMPARE_AS("actual.txt", "expected.txt", TestSuite::Compare::File);

If the files have the same path prefix, you can use CORRADE_COMPARE_WITH() macro and pass the prefix to the constructor:

CORRADE_COMPARE_WITH("actual.txt", "expected.txt",
    TestSuite::Compare::File{"/common/prefix"});

See Comparing with pseudo-types and Passing parameters to comparators for more information.

Constructors, destructors, conversion operators

File(const std::string& pathPrefix = {}) explicit
Constructor.

Function documentation

Corrade::TestSuite::Compare::File::File(const std::string& pathPrefix = {}) explicit

Constructor.

Parameters
pathPrefix Path prefix common for both files

See class documentation for more information.