From: mkr Date: Mon, 17 Aug 2015 09:12:33 +0000 (+0300) Subject: Update tests to run on Windows platform. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8efe3440003141e2a0dd70d0261c19229125c370;p=modules%2Fsmesh.git Update tests to run on Windows platform. --- diff --git a/doc/salome/examples/testme.py b/doc/salome/examples/testme.py index 510a408f8..1e0dfb19b 100755 --- a/doc/salome/examples/testme.py +++ b/doc/salome/examples/testme.py @@ -24,11 +24,21 @@ import unittest, sys, os class SalomeSession(object): def __init__(self, script): import runSalome - sys.argv = ["runSalome.py"] + run_script = "runSalome.py" + if sys.platform == 'win32': + module_variable = "KERNEL_ROOT_DIR" + if os.environ.has_key(module_variable): + run_script = os.environ[module_variable] + "\\bin\\salome\\" + run_script + sys.argv = [run_script] sys.argv += ["--terminal"] sys.argv += ["--modules=GEOM,MED,SMESH"] sys.argv += ["%s" % script] + if sys.platform == 'win32': + main_module_path = sys.modules['__main__'].__file__ + sys.modules['__main__'].__file__ = '' clt, d = runSalome.main() + if sys.platform == 'win32': + sys.modules['__main__'].__file__ = main_module_path return def __del__(self): diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index a16379b00..e77aa7ee7 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -1536,7 +1536,7 @@ SMESH_MeshAlgos::FindFaceInSet(const SMDS_MeshNode* n1, int* n2ind) { - int i1, i2; + int i1 = 0, i2 = 0; const SMDS_MeshElement* face = 0; SMDS_ElemIteratorPtr invElemIt = n1->GetInverseElementIterator(SMDSAbs_Face); diff --git a/src/StdMeshers/StdMeshers_Adaptive1D.cxx b/src/StdMeshers/StdMeshers_Adaptive1D.cxx index 45e22ebb3..cff963a9d 100644 --- a/src/StdMeshers/StdMeshers_Adaptive1D.cxx +++ b/src/StdMeshers/StdMeshers_Adaptive1D.cxx @@ -1307,7 +1307,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh, // << "\t SetSize " << allowedSize << " at " // << pIt1->myP.X() <<", "<< pIt1->myP.Y()<<", "<myP.Z() << endl; pIt2 = pIt1; - if ( --pIt2 != eData.myPoints.end() && pIt2->mySegSize > allowedSize ) + if ( pIt2 != eData.myPoints.begin() && --pIt2 != eData.myPoints.end() && pIt2->mySegSize > allowedSize ) sizeTree.SetSize( eData.myC3d.Value( 0.6*pIt2->myU + 0.4*pIt1->myU ), allowedSize ); pIt2 = pIt1; if ( ++pIt2 != eData.myPoints.end() && pIt2->mySegSize > allowedSize ) @@ -1316,7 +1316,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh, pIt1->mySegSize = allowedSize; } ++pIt1; - if ( & (*pIt1) == & eData.Last() ) + if ( pIt1 != eData.myPoints.end() && ( & (*pIt1) == & eData.Last() ) ) avoidPnt = & eData.Last().myP; else avoidPnt = NULL; diff --git a/src/StdMeshers/StdMeshers_Penta_3D.cxx b/src/StdMeshers/StdMeshers_Penta_3D.cxx index 20f1ff59d..6d99a44de 100644 --- a/src/StdMeshers/StdMeshers_Penta_3D.cxx +++ b/src/StdMeshers/StdMeshers_Penta_3D.cxx @@ -657,7 +657,7 @@ void StdMeshers_Penta_3D::MakeVolumeMesh() } // // 2. Make pentahedrons - int aID0, k , aJ[3]; + int aID0, k , aJ[4]; vector aN; // SMDS_ElemIteratorPtr itf, aItNodes; diff --git a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx index aa0c542d4..5b407a049 100644 --- a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx @@ -913,10 +913,10 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, aTrsf2d.Transforms( cx, cy ); // set node on face meshDS->SetNodeOnFace( node, faceID, cx, cy ); - tmpNodes[j-1] = node; + tmpNodes.push_back(node); } // create faces - tmpNodes[Points.Length()] = CNodes[i]; + tmpNodes.push_back( CNodes[i] ); // quad for(j=0; j