]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Update tests to run on Windows platform. mkr/tests_update
authormkr <mkr@opencascade.com>
Mon, 17 Aug 2015 09:12:33 +0000 (12:12 +0300)
committermkr <mkr@opencascade.com>
Mon, 17 Aug 2015 09:12:33 +0000 (12:12 +0300)
doc/salome/examples/testme.py
src/SMESHUtils/SMESH_MeshAlgos.cxx
src/StdMeshers/StdMeshers_Adaptive1D.cxx
src/StdMeshers/StdMeshers_Penta_3D.cxx
src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx

index 510a408f8d5022a28898ee218f664512fbd90834..1e0dfb19b113b59a0ffe4e060506fd48a128ff80 100755 (executable)
@@ -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):
index a16379b000d4dac73f404e50aba575a4c54340a6..e77aa7ee7b5127c63da02804ae53a891b02a3eac 100644 (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);
index 45e22ebb3fc23e654e35e05b63b96608f974025a..cff963a9d438c8be34cc19929affc9ff8daf1078 100644 (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;
index 20f1ff59d51a6c77758e4bbb66e03a30fc098a0c..6d99a44de3a3ef1a2e3f19bf12a2f1d08d480af7 100644 (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;
index aa0c542d45db9d79b6e1479a1a4c60373f125d35..5b407a04989a2cdb7d4ae70f3a7a7d6c46989bbe 100644 (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;