Update tests to run on Windows platform.

This commit is contained in:
mkr 2015-08-17 12:12:33 +03:00
parent 741a54331a
commit 8efe344000
5 changed files with 17 additions and 7 deletions

View File

@ -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):

View File

@ -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);

View File

@ -1307,7 +1307,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh & theMesh,
// << "\t SetSize " << allowedSize << " at "
// << pIt1->myP.X() <<", "<< pIt1->myP.Y()<<", "<<pIt1->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;

View File

@ -657,7 +657,7 @@ void StdMeshers_Penta_3D::MakeVolumeMesh()
}
//
// 2. Make pentahedrons
int aID0, k , aJ[3];
int aID0, k , aJ[4];
vector<const SMDS_MeshNode*> aN;
//
SMDS_ElemIteratorPtr itf, aItNodes;

View File

@ -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<Nodes1.size()-1; j++) {
SMDS_MeshFace* MF;