Back to index

salome-med  6.5.0
Functions
MEDMEMTest_VtkMeshDriver_fault.cxx File Reference
#include "MEDMEMTest.hxx"
#include <MEDMEM_VtkMeshDriver.hxx>
#include <MEDMEM_Mesh.hxx>

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 28 of file MEDMEMTest_VtkMeshDriver_fault.cxx.

{
  string meshname = "MyMesh";
  string filename = makeTmpFile( "my_pointe.vtk" );

  MEDMEMTest_TmpFilesRemover aRemover;
  aRemover.Register(filename);

  //Create an empty Mesh
  MESH * aMesh = new MESH();

  //Creation corect driver
  VTK_MESH_DRIVER *aVtkDriver = new VTK_MESH_DRIVER(filename, aMesh);
  aVtkDriver->setMeshName(meshname);
  aVtkDriver->open();

  // ? (BUG) ? In VTK_MESH_DRIVER::write() => Segmentation fault on attempt to write an empty mesh
  try
  {
    //Trying write an empty mesh
    aVtkDriver->write();
  }
  catch (MEDEXCEPTION & ex)
  {
    // good behaviour
  }
  catch (...)
  {
  }

  aVtkDriver->close();

  // (BUG) In copy constructor of VTK_MESH_DRIVER: Segmentation fault or Infinite loop
  VTK_MESH_DRIVER aVtkDriverCpy_2 (*aVtkDriver);

  delete aVtkDriver;
  delete aMesh;
}

Here is the call graph for this function: