Commit 4e25f9f4 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot
Browse files

Merge topic 'rib-test-fixes'

383c5159 RenderingCore: don't write to /tmp
6ee01afb

 vtkRIBExporter: use snprintf
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Utkarsh Ayachit's avatarUtkarsh Ayachit <utkarsh.ayachit@kitware.com>
Reviewed-by: Bill Lorensen's avatarBill Lorensen <bill.lorensen@gmail.com>
Merge-request: !764
parents c98eb45f 383c5159
......@@ -42,6 +42,10 @@
#include <sstream>
#if _MSC_VER && !defined(snprintf)
#define snprintf _snprintf
#endif
vtkStandardNewMacro(vtkRIBExporter);
typedef double RtColor[3];
......@@ -1368,13 +1372,13 @@ static char textureName[4096];
char *vtkRIBExporter::GetTIFFName (vtkTexture *aTexture)
{
sprintf (tiffName, "%s_%p_%d.tif", this->TexturePrefix, (void *) aTexture, (int) aTexture->GetMTime ());
snprintf (tiffName, 4096, "%s_%p_%d.tif", this->TexturePrefix, (void *) aTexture, (int) aTexture->GetMTime ());
return tiffName;
}
char *vtkRIBExporter::GetTextureName (vtkTexture *aTexture)
{
sprintf (textureName, "%s_%p_%d.txt", this->TexturePrefix, (void *) aTexture, (int) aTexture->GetMTime ());
snprintf (textureName, 4096, "%s_%p_%d.txt", this->TexturePrefix, (void *) aTexture, (int) aTexture->GetMTime ());
return textureName;
}
......
......@@ -22,8 +22,9 @@ import tempfile
import os
import vtk
import vtk.test.Testing
from vtk.util.misc import vtkGetDataRoot
from vtk.util.misc import vtkGetDataRoot, vtkGetTempDir
VTK_DATA_ROOT = vtkGetDataRoot()
VTK_TEMP_DIR = vtkGetTempDir()
class cells(vtk.test.Testing.vtkTest):
......@@ -668,8 +669,7 @@ class cells(vtk.test.Testing.vtkTest):
ren.GetActiveCamera().Dolly(2.8)
ren.ResetCameraClippingRange()
# write to the temp directory if possible, otherwise use .
dir = tempfile.gettempdir()
dir = VTK_TEMP_DIR
atext = vtk.vtkTexture()
pnmReader = vtk.vtkBMPReader()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment