mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 05:27:38 +03:00
Moved errorCode_ from RecoverableException to Exception and added errorCode to
stackTrace. Also changed errno to errNum in stackTrace.
This commit is contained in:
parent
45fde1adaf
commit
476ba70a9f
6 changed files with 71 additions and 43 deletions
|
@ -25,15 +25,17 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ExceptionTest);
|
|||
|
||||
void ExceptionTest::testStackTrace()
|
||||
{
|
||||
DownloadFailureException c1 = DOWNLOAD_FAILURE_EXCEPTION("cause1");
|
||||
DownloadFailureException c1 = DOWNLOAD_FAILURE_EXCEPTION2
|
||||
("cause1", error_code::TIME_OUT);
|
||||
DownloadFailureException c2 = DOWNLOAD_FAILURE_EXCEPTION2("cause2", c1);
|
||||
DownloadFailureException e = DOWNLOAD_FAILURE_EXCEPTION2("exception thrown",
|
||||
c2);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL
|
||||
(std::string("Exception: [ExceptionTest.cc:31] exception thrown\n"
|
||||
" -> [ExceptionTest.cc:29] cause2\n"
|
||||
" -> [ExceptionTest.cc:28] cause1\n"),
|
||||
(std::string
|
||||
("Exception: [ExceptionTest.cc:32] errorCode=2 exception thrown\n"
|
||||
" -> [ExceptionTest.cc:30] errorCode=2 cause2\n"
|
||||
" -> [ExceptionTest.cc:29] errorCode=2 cause1\n"),
|
||||
e.stackTrace());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue