OCCViewer_ViewFrame* TestViewer::myViewWindow = 0;
QString TestViewer::myKey = "";
+extern QString REF_DATA_PATH;
+
OCCViewer_ViewManager* TestViewer::viewManager()
{
if( myViewManager )
if( theCase )
myKey = theCase;
- QString anExpectedRefFilePath = qgetenv( "HYDRO_ROOT_DIR" ) + "/bin/salome/test/HYDRO";
+ QString anExpectedRefFilePath = REF_DATA_PATH;
anExpectedRefFilePath += "/" + myKey + ".png";
QImage anExpectedRefImage;
anExpectedRefImage.load( anExpectedRefFilePath );
+ std::cout << "Expected image loading: " << anExpectedRefFilePath.toStdString() << std::endl;
if( AreImagesEqual( anActualImage, anExpectedRefImage, 0.001 ) )
{
QString aPath = QDir::tempPath() + "/" + myKey + ".png";
anActualImage.save( aPath );
+ std::cout << "Actual image: " << aPath.toStdString() << std::endl;
+
//std::cout << anActualImage.width() << "x" << anActualImage.height() << std::endl;
theMessage = "The viewer contents does not correspond to the reference image: " + myKey;
QString aDiffFilePath = QDir::tempPath() + "/" + myKey + "_diff.png";
aDiff.save( aDiffFilePath );
+ std::cout << "Diff image: " << aDiffFilePath.toStdString() << std::endl;
- anExpectedRefImage.save( QDir::tempPath() + "/" + myKey + "_1.png");
+ QString anExpected = QDir::tempPath() + "/" + myKey + "_1.png";
+ std::cout << "Expected image: " << anExpected.toStdString() << std::endl;
+ anExpectedRefImage.save( anExpected );
return false;
}
int theLinesToOmit,
QString& theMsg )
{
- QString anExpectedRefFilePath = qgetenv( "HYDRO_ROOT_DIR" ) + "/bin/salome/test/HYDRO";
+ QString anExpectedRefFilePath = REF_DATA_PATH;
anExpectedRefFilePath += "/" + theBaseName;
QString anActualFilePath = QDir::tempPath() + "/" + theBaseName;
#include <QStringList>
#include <vector>
-const QString REF_PATH = qgetenv( "HYDRO_ROOT_DIR" ) + "/bin/salome/test/HYDRO";
+extern QString REF_DATA_PATH;
bool test_HYDROData_ShapeFile::compare_two_files(const QString& File1, const QString& File2)
{
void test_HYDROData_ShapeFile::test_openDbf()
{
- QString aDBFPath = REF_PATH + "/cyprus_natural.dbf";
+ QString aDBFPath = REF_DATA_PATH + "/cyprus_natural.dbf";
HYDROData_ShapeFile aSHPFile;
bool Stat = aSHPFile.DBF_OpenDBF(aDBFPath);
CPPUNIT_ASSERT_EQUAL( true, Stat );
void test_HYDROData_ShapeFile::test_NbFieldsDbf()
{
- QString aDBFPath = REF_PATH + "/cyprus_natural.dbf";
+ QString aDBFPath = REF_DATA_PATH + "/cyprus_natural.dbf";
HYDROData_ShapeFile aSHPFile;
CPPUNIT_ASSERT_EQUAL(true, aSHPFile.DBF_OpenDBF(aDBFPath));
int NbF = aSHPFile.DBF_GetNbFields();
void test_HYDROData_ShapeFile::test_FieldListDbf()
{
- QString aDBFPath = REF_PATH + "/cyprus_natural.dbf";
+ QString aDBFPath = REF_DATA_PATH + "/cyprus_natural.dbf";
HYDROData_ShapeFile aSHPFile;
CPPUNIT_ASSERT_EQUAL(true, aSHPFile.DBF_OpenDBF(aDBFPath));
void test_HYDROData_ShapeFile::test_FieldTypeListDbf()
{
- QString aDBFPath = REF_PATH + "/cyprus_natural.dbf";
+ QString aDBFPath = REF_DATA_PATH + "/cyprus_natural.dbf";
HYDROData_ShapeFile aSHPFile;
CPPUNIT_ASSERT_EQUAL(true, aSHPFile.DBF_OpenDBF(aDBFPath));
void test_HYDROData_ShapeFile::test_NbRecordsDbf()
{
- QString aDBFPath = REF_PATH + "/cyprus_natural.dbf";
+ QString aDBFPath = REF_DATA_PATH + "/cyprus_natural.dbf";
HYDROData_ShapeFile aSHPFile;
CPPUNIT_ASSERT_EQUAL(true, aSHPFile.DBF_OpenDBF(aDBFPath));
int NbR = aSHPFile.DBF_GetNbRecords();
void test_HYDROData_ShapeFile::test_GetAttrListIndex()
{
{ //cyprus_natural
- QString aDBFPath = REF_PATH + "/cyprus_natural.dbf";
+ QString aDBFPath = REF_DATA_PATH + "/cyprus_natural.dbf";
HYDROData_ShapeFile aSHPFile;
CPPUNIT_ASSERT_EQUAL(true, aSHPFile.DBF_OpenDBF(aDBFPath));
std::vector<HYDROData_ShapeFile::DBF_AttrValue> theAttrV;
aSHPFile.DBF_CloseDBF();
}
{ //CLC06
- QString aDBFPath = REF_PATH + "/CLC06.dbf";
+ QString aDBFPath = REF_DATA_PATH + "/CLC06.dbf";
HYDROData_ShapeFile aSHPFile;
CPPUNIT_ASSERT_EQUAL (true, aSHPFile.DBF_OpenDBF(aDBFPath));
std::vector<HYDROData_ShapeFile::DBF_AttrValue> theAttrV;
{
{
HYDROData_ShapeFile aSHPFile;
- QString tempFN = REF_PATH + "/temp_dbf1.dbf";
- QString refFN = REF_PATH + "/ref_dbf1.dbf";
+ QString tempFN = REF_DATA_PATH + "/temp_dbf1.dbf";
+ QString refFN = REF_DATA_PATH + "/ref_dbf1.dbf";
std::vector<HYDROData_ShapeFile::DBF_AttrValue> theAttrV;
HYDROData_ShapeFile::DBF_AttrValue theAttr1;
theAttr1.myFieldType = HYDROData_ShapeFile::DBF_FieldType_String;
{
HYDROData_ShapeFile aSHPFile;
- QString tempFN = REF_PATH + "/temp_dbf2.dbf";
- QString refFN = REF_PATH + "/ref_dbf2.dbf";
+ QString tempFN = REF_DATA_PATH + "/temp_dbf2.dbf";
+ QString refFN = REF_DATA_PATH + "/ref_dbf2.dbf";
std::vector<HYDROData_ShapeFile::DBF_AttrValue> theAttrV;
HYDROData_ShapeFile::DBF_AttrValue theAttr1;
theAttr1.myFieldType = HYDROData_ShapeFile::DBF_FieldType_String;
{
HYDROData_ShapeFile aSHPFile;
- QString tempFN = REF_PATH + "/temp_dbf3.dbf";
- QString refFN = REF_PATH + "/ref_dbf3.dbf";
+ QString tempFN = REF_DATA_PATH + "/temp_dbf3.dbf";
+ QString refFN = REF_DATA_PATH + "/ref_dbf3.dbf";
std::vector<HYDROData_ShapeFile::DBF_AttrValue> theAttrV;
HYDROData_ShapeFile::DBF_AttrValue theAttr1;
theAttr1.myFieldType = HYDROData_ShapeFile::DBF_FieldType_Integer;