diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-03-30 20:20:23 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-03-30 20:20:39 -0500 |
commit | c176cb8907530a795cb0e38de8193df931f891fb (patch) | |
tree | a9741bb08b78ca6ce15056aaa6d1e616b37537f6 /unotools | |
parent | sw: '+' will be evaluated first [-Werror,-Wparentheses] (diff) | |
download | core-c176cb8907530a795cb0e38de8193df931f891fb.tar.gz core-c176cb8907530a795cb0e38de8193df931f891fb.zip |
decorate tempfile name's to help identify leaks' author
unottols TempFile class check in debug bod for
and env variable LO_TESTNAME.. if present it use that as the root
for the tempfile filename.
cppunitteset framework is augmented so that it export such
LO_TESNAME using the cppunit testName(), after replacement of
non-alphnum characters by _
Change-Id: Iebb9545d3bd789083afbeaf4c64eab086b56049a
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/ucbhelper/tempfile.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index 17dafaa2f114..9585639c67e0 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -184,8 +184,18 @@ void CreateTempName_Impl( OUString& rName, bool bKeep, bool bDir = true ) // 36 ** 6 == 2176782336 unsigned const nRadix = 36; unsigned long const nMax = (nRadix*nRadix*nRadix*nRadix*nRadix*nRadix); - OUString aName = rName + "lu"; - + OUString aName; + OUString aEyeCatcher = "lu"; +#ifdef DBG_UTIL +#ifdef UNX + const char* eye = getenv("LO_TESTNAME"); + if(eye) + { + aEyeCatcher = OUString(eye, strlen(eye), RTL_TEXTENCODING_ASCII_US); + } +#endif +#endif + aName = rName + aEyeCatcher; rName = ""; static unsigned long u = Time::GetSystemTicks() % nMax; for ( unsigned long nSeed = u; ++u != nSeed; ) |