diff options
Diffstat (limited to 'src/lib/exceptions/tests/exceptions_unittest.cc')
-rw-r--r-- | src/lib/exceptions/tests/exceptions_unittest.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/exceptions/tests/exceptions_unittest.cc b/src/lib/exceptions/tests/exceptions_unittest.cc index a2ee416572..baa6e9346a 100644 --- a/src/lib/exceptions/tests/exceptions_unittest.cc +++ b/src/lib/exceptions/tests/exceptions_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2009-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2009-2015,2017 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -38,6 +38,17 @@ TEST_F(ExceptionTest, basicMethods) { } } +// Same than basicMethods but using a string (vs char *) +TEST_F(ExceptionTest, string) { + try { + isc_throw(Exception, std::string(teststring)); + } catch (Exception& ex) { + EXPECT_EQ(ex.getMessage(), std::string(teststring)); + EXPECT_EQ(ex.getFile(), std::string(__FILE__)); + EXPECT_EQ(ex.getLine(), __LINE__ - 4); + } +} + // Test to see if it works as a proper derived class of std::exception. TEST_F(ExceptionTest, stdInheritance) { try { |