-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include <cstdlib>
#include "Utils_SALOME_Exception.hxx"
#include "Basics_Utils.hxx"
+#include "Basics_DirUtils.hxx"
#include "utilities.h"
+#include "KernelBasis.hxx"
#ifdef WIN32
#define setenv Kernel_Utils::setenv
-#endif
-
-#define TRACEFILE "/tmp/traceUnitTest.log"
+#endif
// ============================================================================
/*!
- * Set Trace mecanism
+ * Set Trace mechanism
* - delete preexisting trace classes if any
* - set trace on file
*/
// ============================================================================
-void
+std::string
+UtilsTest::_getTraceFileName()
+{
+ std::string dir = Kernel_Utils::GetTmpDir();
+ return dir + "traceUnitTest-UtilsTest.log";
+}
+
+void
UtilsTest::setUp()
{
+ setSSLMode(false);
LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance();
CPPUNIT_ASSERT(bp1);
bp1->deleteInstance(bp1);
// --- trace on file
- const char *theFileName = TRACEFILE;
+ std::string theFileName = _getTraceFileName();
std::string s = "file:";
s += theFileName;
CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite
std::ofstream traceFile;
- traceFile.open(theFileName, std::ios::out | std::ios::app);
+ traceFile.open(theFileName.c_str(), std::ios::out | std::ios::app);
CPPUNIT_ASSERT(traceFile); // file created empty, then closed
traceFile.close();
*/
// ============================================================================
-void
+void
UtilsTest::tearDown()
{
LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance();
int genExcept()
{
throw SALOME_Exception("a message");
-};
+}
// ============================================================================
/*!
- * Check basic SALOME_exception mecanism
+ * Check basic SALOME_exception mechanism
*/
// ============================================================================