2008-05-16 23:55:00 +02:00
|
|
|
// -*- C++ -*-
|
2016-04-29 18:11:43 +02:00
|
|
|
// Error handling utils for the C++ library testsuite.
|
2008-05-16 23:55:00 +02:00
|
|
|
//
|
2019-01-01 13:31:55 +01:00
|
|
|
// Copyright (C) 2007-2019 Free Software Foundation, Inc.
|
2008-05-16 23:55:00 +02:00
|
|
|
//
|
|
|
|
// This file is part of the GNU ISO C++ Library. This library is free
|
|
|
|
// software; you can redistribute it and/or modify it under the
|
|
|
|
// terms of the GNU General Public License as published by the
|
2009-04-09 17:00:19 +02:00
|
|
|
// Free Software Foundation; either version 3, or (at your option)
|
2008-05-16 23:55:00 +02:00
|
|
|
// any later version.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License along
|
2009-04-09 17:00:19 +02:00
|
|
|
// with this library; see the file COPYING3. If not see
|
|
|
|
// <http://www.gnu.org/licenses/>.
|
2008-05-16 23:55:00 +02:00
|
|
|
//
|
|
|
|
|
2008-10-10 14:39:01 +02:00
|
|
|
#include <string>
|
2008-05-16 23:55:00 +02:00
|
|
|
#include <testsuite_hooks.h>
|
|
|
|
|
|
|
|
#ifndef _TESTSUITE_ERROR_H
|
|
|
|
#define _TESTSUITE_ERROR_H 1
|
|
|
|
|
|
|
|
namespace __gnu_test
|
|
|
|
{
|
|
|
|
struct test_category : public std::error_category
|
2016-04-29 18:11:43 +02:00
|
|
|
{
|
2008-05-16 23:55:00 +02:00
|
|
|
virtual const char*
|
2011-07-20 20:17:30 +02:00
|
|
|
name() const noexcept
|
|
|
|
{
|
2008-05-16 23:55:00 +02:00
|
|
|
const char* s = "__gnu_test::test_category";
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
2016-04-29 18:11:43 +02:00
|
|
|
virtual std::string
|
2008-05-16 23:55:00 +02:00
|
|
|
message(int) const
|
2008-10-10 14:39:01 +02:00
|
|
|
{ return std::string("message to be determined"); }
|
2008-05-16 23:55:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct test_derived_category : public test_category
|
2016-04-29 18:11:43 +02:00
|
|
|
{
|
2008-05-16 23:55:00 +02:00
|
|
|
virtual const char*
|
2011-07-20 20:17:30 +02:00
|
|
|
name() const noexcept
|
|
|
|
{
|
2008-05-16 23:55:00 +02:00
|
|
|
const char* s = "__gnu_test::test_derived_category";
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|