From 1ef99931e131343f069a4b74edfc06196d72d85b Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 27 Apr 2008 02:22:14 +0000 Subject: 2008-04-27 Tatsuhiro Tsujikawa Rewritten Exception class. Throw exception object, not its pointer and catch by reference, so that remove problematic delete operator for catched exception. * src/Exception.cc * src/Exception.h * test/ExceptionTest.cc * src/*: All files throwing/catching exception. * test/*: All files throwing/catching exception. --- test/HttpHeaderProcessorTest.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'test/HttpHeaderProcessorTest.cc') diff --git a/test/HttpHeaderProcessorTest.cc b/test/HttpHeaderProcessorTest.cc index 38e9f0fc..09e5e33b 100644 --- a/test/HttpHeaderProcessorTest.cc +++ b/test/HttpHeaderProcessorTest.cc @@ -124,9 +124,8 @@ void HttpHeaderProcessorTest::testGetHttpResponseHeader_empty() try { proc.getHttpResponseHeader(); CPPUNIT_FAIL("Exception must be thrown."); - } catch(DlRetryEx* ex) { - std::cout << ex->getMsg() << std::endl; - delete ex; + } catch(DlRetryEx& ex) { + std::cout << ex.stackTrace() << std::endl; } } @@ -150,9 +149,8 @@ void HttpHeaderProcessorTest::testGetHttpResponseHeader_insufficientStatusLength try { proc.getHttpResponseHeader(); CPPUNIT_FAIL("Exception must be thrown."); - } catch(DlRetryEx* ex) { - std::cout << ex->getMsg() << std::endl; - delete ex; + } catch(DlRetryEx& ex) { + std::cout << ex.stackTrace() << std::endl; } } @@ -170,9 +168,8 @@ void HttpHeaderProcessorTest::testBeyondLimit() try { proc.update(hd2); CPPUNIT_FAIL("Exception must be thrown."); - } catch(DlAbortEx* ex) { - std::cout << ex->getMsg() << std::endl; - delete ex; + } catch(DlAbortEx& ex) { + std::cout << ex.stackTrace() << std::endl; } } -- cgit