- bugfix and additional code (for now) to track duplicates and problems in color picking. We now use will's implementation as it supports 64K colors.

This commit is contained in:
SoftCoder
2013-11-30 17:20:30 -08:00
parent b36244fcbd
commit f7bc5e8f92
3 changed files with 46 additions and 33 deletions

View File

@@ -80,7 +80,7 @@ public:
TestBaseColorPickEntity colorPicker;
// This is the max color count this algorithm supports
const int MAX_SUPPORTED_COLORS_USING_THIS_METHOD = 472;
const int MAX_SUPPORTED_COLORS_USING_THIS_METHOD = 64005;
for(unsigned int i = 0; i < MAX_SUPPORTED_COLORS_USING_THIS_METHOD; ++i) {
bool duplicate = colorPicker.get_next_assign_color(colorPicker.getUniqueColorID());
CPPUNIT_ASSERT_EQUAL( false,duplicate );
@@ -90,7 +90,7 @@ public:
TestBaseColorPickEntity colorPicker2;
// This is a test to prove when the algorithm fails
const int MAX_SUPPORTED_COLORS_USING_THIS_METHOD_FAIL = 473;
const int MAX_SUPPORTED_COLORS_USING_THIS_METHOD_FAIL = 64006;
for(unsigned int i = 0; i < MAX_SUPPORTED_COLORS_USING_THIS_METHOD_FAIL; ++i) {
bool duplicate = colorPicker2.get_next_assign_color(colorPicker2.getUniqueColorID());
CPPUNIT_ASSERT_EQUAL( (i+1 >= MAX_SUPPORTED_COLORS_USING_THIS_METHOD_FAIL),duplicate );