00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KIS_COLOR_CONVERSIONS_TESTER_H
00020 #define KIS_COLOR_CONVERSIONS_TESTER_H
00021
00022 #include <kunittest/tester.h>
00023
00024 #define CHECK_TOLERANCE( x, y, tolerance ) \
00025 if ((x) <= (y) + (tolerance) && (x) >= (y) - (tolerance)) \
00026 { \
00027 success(QString(__FILE__) + "[" + QString::number(__LINE__) + "]: passed " + #x); \
00028 } \
00029 else \
00030 { \
00031 failure(QString(__FILE__) + "[" + QString::number(__LINE__) + QString("]: failed ") + #x + "\n Expected " + #y + ", Actual result " + QString::number(x)); \
00032 } \
00033
00034
00035 class KoColorConversionsTester : public KUnitTest::Tester
00036 {
00037 public:
00038 void allTests();
00039 void testRGBHSV();
00040 void testRGBHSL();
00041 };
00042
00043 #endif
00044