diplib/testing.h file

Functions to help test and debug your code. See Testing and debugging.


namespace dip::testing
Tools for testing and debugging.


class dip::testing::Timer
A timer object to help time algorithm execution.


enum class dip::Option::CompareImagesMode: uint8{ EXACT, APPROX, APPROX_REL, FULL }
How to compare images in dip::testing::CompareImages.


template<typename TPI, int DIGITS = 4>
void dip::testing::PrintPixelValues(dip::Image const& img)
Outputs pixel values of a small image to stdout.
auto dip::testing::CompareImages(dip::Image const& img1, dip::Image const& img2, dip::Option::CompareImagesMode mode = Option::CompareImagesMode::EXACT, dip::dfloat epsilon = 1e-6) -> bool
Compares two images. Returns test result and prints to stdout the reason of failure if the test fails.


auto dip::testing::operator<<(std::ostream& os, dip::testing::Timer const& timer) -> std::ostream&
Reports elapsed time to a stream.