-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also, setting a NAN color. Finding more test suites in TestViewer.
- Loading branch information
Janik Zikovsky
committed
Nov 8, 2011
1 parent
d10b11b
commit b58c13a
Showing
6 changed files
with
100 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#ifndef MANTIDQT_API_MANTIDCOLORMAPTEST_H_ | ||
#define MANTIDQT_API_MANTIDCOLORMAPTEST_H_ | ||
|
||
#include <cxxtest/TestSuite.h> | ||
#include <iostream> | ||
#include <iomanip> | ||
#include "MantidQtAPI/MantidColorMap.h" | ||
#include <limits> | ||
#include <QRgb> | ||
|
||
class MantidColorMapTest : public CxxTest::TestSuite | ||
{ | ||
public: | ||
|
||
/// Check default color map | ||
void test_constructor() | ||
{ | ||
MantidColorMap map; | ||
QRgb col; | ||
col = map.rgb( QwtDoubleInterval( 0.0, 1.0 ), 0.0); | ||
TSM_ASSERT_EQUALS("Default min color.", col, qRgb(0, 172, 252) ); | ||
col = map.rgb( QwtDoubleInterval( 0.0, 1.0 ), 1.0); | ||
TSM_ASSERT_EQUALS("Default max color.", col, qRgb(255,255,255) ); | ||
} | ||
|
||
void test_nan_color() | ||
{ | ||
MantidColorMap map; | ||
map.setNanColor(123, 23, 34); | ||
QRgb col; | ||
double nan = std::numeric_limits<double>::quiet_NaN(); | ||
col = map.rgb( QwtDoubleInterval( 0.0, 1.0 ), nan); | ||
TSM_ASSERT_EQUALS("Passing NAN to rgb returns the set color.", col, qRgb(123, 23, 34) ); | ||
} | ||
}; | ||
|
||
|
||
#endif /* MANTIDQT_API_MANTIDCOLORMAPTEST_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters