Skip to content
Snippets Groups Projects
Commit 80f820fc authored by Brad King's avatar Brad King
Browse files

ConsoleBuf: Avoid use of __FUNCTION__ in tests

This compiler extension is not universally supported.  Spell out the
function name explicitly, and use __LINE__ to get more-specific
information.

Change-Id: I670d94a85f1ff8112655af62fb710460b3e76f19
parent 4e6c9410
No related branches found
No related tags found
No related merge requests found
...@@ -338,14 +338,16 @@ static int testPipe() ...@@ -338,14 +338,16 @@ static int testPipe()
} }
} catch (const std::runtime_error &ex) { } catch (const std::runtime_error &ex) {
DWORD lastError = GetLastError(); DWORD lastError = GetLastError();
std::cerr << "In function " << __FUNCTION__ << ":" << ex.what() << std::endl; std::cerr << "In function testPipe, line " << __LINE__ << ": "
<< ex.what() << std::endl;
displayError(lastError); displayError(lastError);
} }
finishProcess(didFail == 0); finishProcess(didFail == 0);
} }
} catch (const std::runtime_error &ex) { } catch (const std::runtime_error &ex) {
DWORD lastError = GetLastError(); DWORD lastError = GetLastError();
std::cerr << "In function " << __FUNCTION__ << ":" << ex.what() << std::endl; std::cerr << "In function testPipe, line " << __LINE__ << ": "
<< ex.what() << std::endl;
displayError(lastError); displayError(lastError);
} }
finishPipe(inPipeRead, inPipeWrite); finishPipe(inPipeRead, inPipeWrite);
...@@ -431,14 +433,16 @@ static int testFile() ...@@ -431,14 +433,16 @@ static int testFile()
} }
} catch (const std::runtime_error &ex) { } catch (const std::runtime_error &ex) {
DWORD lastError = GetLastError(); DWORD lastError = GetLastError();
std::cerr << "In function " << __FUNCTION__ << ":" << ex.what() << std::endl; std::cerr << "In function testFile, line " << __LINE__ << ": "
<< ex.what() << std::endl;
displayError(lastError); displayError(lastError);
} }
finishProcess(didFail == 0); finishProcess(didFail == 0);
} }
} catch (const std::runtime_error &ex) { } catch (const std::runtime_error &ex) {
DWORD lastError = GetLastError(); DWORD lastError = GetLastError();
std::cerr << "In function " << __FUNCTION__ << ":" << ex.what() << std::endl; std::cerr << "In function testFile, line " << __LINE__ << ": "
<< ex.what() << std::endl;
displayError(lastError); displayError(lastError);
} }
finishFile(inFile); finishFile(inFile);
...@@ -659,7 +663,8 @@ static int testConsole() ...@@ -659,7 +663,8 @@ static int testConsole()
delete[] outputBuffer; delete[] outputBuffer;
} catch (const std::runtime_error &ex) { } catch (const std::runtime_error &ex) {
DWORD lastError = GetLastError(); DWORD lastError = GetLastError();
std::cerr << "In function " << __FUNCTION__ << ":" << ex.what() << std::endl; std::cerr << "In function testConsole, line " << __LINE__ << ": "
<< ex.what() << std::endl;
displayError(lastError); displayError(lastError);
} }
finishProcess(didFail == 0); finishProcess(didFail == 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment