Salome HOME
projects
/
modules
/
kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Management of :
[modules/kernel.git]
/
src
/
Utils
/
Test
/
UtilsTest.cxx
diff --git
a/src/Utils/Test/UtilsTest.cxx
b/src/Utils/Test/UtilsTest.cxx
index aa6f9e302d706389c8ab3c19b4b8e28010707132..8a3d1dab2eb1ec78b1223fd1b0d6d493efa982ae 100644
(file)
--- a/
src/Utils/Test/UtilsTest.cxx
+++ b/
src/Utils/Test/UtilsTest.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
14
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-20
21
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
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-28,38
+28,46
@@
#include <cstdlib>
#include "Utils_SALOME_Exception.hxx"
#include "Basics_Utils.hxx"
#include <cstdlib>
#include "Utils_SALOME_Exception.hxx"
#include "Basics_Utils.hxx"
+#include "Basics_DirUtils.hxx"
#include "utilities.h"
#include "utilities.h"
+#include "KernelBasis.hxx"
#ifdef WIN32
#define setenv Kernel_Utils::setenv
#ifdef WIN32
#define setenv Kernel_Utils::setenv
-#endif
-
-#define TRACEFILE "/tmp/traceUnitTest.log"
+#endif
// ============================================================================
/*!
// ============================================================================
/*!
- * Set Trace mecanism
+ * Set Trace mec
h
anism
* - delete preexisting trace classes if any
* - set trace on file
*/
// ============================================================================
* - 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()
{
UtilsTest::setUp()
{
+ setSSLMode(false);
LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance();
CPPUNIT_ASSERT(bp1);
bp1->deleteInstance(bp1);
// --- trace on file
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;
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();
CPPUNIT_ASSERT(traceFile); // file created empty, then closed
traceFile.close();
@@
-73,7
+81,7
@@
UtilsTest::setUp()
*/
// ============================================================================
*/
// ============================================================================
-void
+void
UtilsTest::tearDown()
{
LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance();
UtilsTest::tearDown()
{
LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance();
@@
-84,11
+92,11
@@
UtilsTest::tearDown()
int genExcept()
{
throw SALOME_Exception("a message");
int genExcept()
{
throw SALOME_Exception("a message");
-}
;
+}
// ============================================================================
/*!
// ============================================================================
/*!
- * Check basic SALOME_exception mecanism
+ * Check basic SALOME_exception mec
h
anism
*/
// ============================================================================
*/
// ============================================================================