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
......@@ -338,14 +338,16 @@ static int testPipe()
}
} catch (const std::runtime_error &ex) {
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);
}
finishProcess(didFail == 0);
}
} catch (const std::runtime_error &ex) {
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);
}
finishPipe(inPipeRead, inPipeWrite);
......@@ -431,14 +433,16 @@ static int testFile()
}
} catch (const std::runtime_error &ex) {
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);
}
finishProcess(didFail == 0);
}
} catch (const std::runtime_error &ex) {
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);
}
finishFile(inFile);
......@@ -659,7 +663,8 @@ static int testConsole()
delete[] outputBuffer;
} catch (const std::runtime_error &ex) {
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);
}
finishProcess(didFail == 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment