QColor randomColor()
{
- int aHue = rand()%255;
+ int r = test_rand();
+ int aHue = r%255;
QColor aColor = QColor::fromHsl( aHue, 255, 128 );
return aColor;
}
context()->EraseAll();
myKey = theKey;
- test_srand( qHash( theKey ) );
+ test_srand( 0 );
if( theShape.ShapeType()==TopAbs_COMPOUND )
{
TopoDS_Iterator anIt( theShape );
#include <random.h>
-quint32 m_w = 1;
-quint32 m_z = 1;
+quint32 next = 1;
void test_srand( quint32 theValue )
{
- m_w = theValue + 1;
- m_z = theValue / 2;
+ next = theValue + 1;
}
quint32 test_rand()
{
- m_z = 36969 * (m_z & 65535) + (m_z >> 16);
- m_w = 18000 * (m_w & 65535) + (m_w >> 16);
- return (m_z << 16) + m_w; /* 32-bit result */
+ next = next * 1103515245 + 12345;
+ return next % ( 1 << 24 );
}
CPPUNIT_ASSERT_EQUAL( true, aMap->Split( aPolyline ) );
TestViewer::show( aMap->GetShape(), AIS_Shaded, true, "LandCoverMap_Split_2" );
- TestViewer::show( aWire, 0, true, Qt::blue );
+ TestViewer::show( aWire, 0, true, Qt::green );
CPPUNIT_ASSERT_IMAGES
HYDROData_LandCoverMap::Iterator anIt( aMap );