From d0bf2fb390bd900040189efe1b9419567867c163 Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 10 Aug 2018 16:36:55 +0200 Subject: [PATCH] Add more debug output to TestApplication::workingCopyPathMode --- tests/testutils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/testutils.cpp b/tests/testutils.cpp index 7a60298..def049f 100644 --- a/tests/testutils.cpp +++ b/tests/testutils.cpp @@ -258,18 +258,20 @@ string TestApplication::workingCopyPathMode(const string &name, WorkingCopyMode if (origFile.fail()) { cerr << Phrases::Error << "Unable to create working copy for \"" << name << "\": an IO error occurred when opening original file \"" << origFilePath << "\"." << Phrases::EndFlush; + cerr << "error: " << strerror(errno) << endl; return string(); } workingCopy.open(workingCopyPath, ios_base::out | ios_base::binary | ios_base::trunc); while (workingCopy.fail() && !stat(workingCopyPath.c_str(), ¤tStat)) { // adjust the working copy path if the target file already exists and can not be truncated - workingCopyPath = argsToString(m_workingDir, "/tmp-", ++workingCopyPathAttempt, '-', name); + workingCopyPath = argsToString(m_workingDir, name, '.', ++workingCopyPathAttempt); workingCopy.clear(); workingCopy.open(workingCopyPath, ios_base::out | ios_base::binary | ios_base::trunc); } if (workingCopy.fail()) { cerr << Phrases::Error << "Unable to create working copy for \"" << name << "\": an IO error occurred when opening target file \"" << workingCopyPath << "\"." << Phrases::EndFlush; + cerr << "error: " << strerror(errno) << endl; return string(); } workingCopy << origFile.rdbuf(); @@ -288,6 +290,7 @@ string TestApplication::workingCopyPathMode(const string &name, WorkingCopyMode } cerr << " an IO error occurred when writing to target file \"" << workingCopyPath << "\"."; } + cerr << "error: " << strerror(errno) << endl; return string(); }