Classes | Namespaces | Defines | Typedefs | Functions

tests/test_lexical_cast.cpp File Reference

#include "lexical_cast.hpp"
#include <boost/test/unit_test.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/copy.hpp>
#include <boost/mpl/back_inserter.hpp>
#include <boost/mpl/contains.hpp>
#include <boost/test/test_case_template.hpp>
#include <iostream>
Include dependency graph for test_lexical_cast.cpp:

Go to the source code of this file.

Classes

struct  test_throw::bad_lexical_cast
 Thrown when a lexical_cast fails. More...
struct  test_throw::implementation::tlexical_cast< To, From, ToEnable, FromEnable >
 Base class for the conversion. More...
struct  test_throw::implementation::tlexical_cast< std::string, From, void, typename boost::enable_if< boost::is_integral< typename boost::remove_pointer< From >::type > >::type >
 Specialized conversion class. More...
struct  test_throw::implementation::tlexical_cast< long long, From, void, typename boost::enable_if< boost::mpl::has_key< boost::mpl::set< char *, const char * >, From > >::type >
 Specialized conversion class. More...
struct  test_throw::implementation::tlexical_cast< long long, std::string >
 Specialized conversion class. More...
struct  test_throw::implementation::tlexical_cast< To, From, typename boost::enable_if< boost::is_signed< To > >::type, typename boost::enable_if< boost::mpl::has_key< boost::mpl::set< char *, const char * >, From > >::type >
 Specialized conversion class. More...
struct  test_throw::implementation::tlexical_cast< To, std::string, typename boost::enable_if< boost::is_signed< To > >::type >
 Specialized conversion class. More...
struct  test_throw::implementation::tlexical_cast< unsigned long long, From, void, typename boost::enable_if< boost::mpl::has_key< boost::mpl::set< char *, const char * >, From > >::type >
 Specialized conversion class. More...
struct  test_throw::implementation::tlexical_cast< unsigned long long, std::string >
 Specialized conversion class. More...
struct  test_throw::implementation::tlexical_cast< To, From, typename boost::enable_if< boost::is_unsigned< To > >::type, typename boost::enable_if< boost::mpl::has_key< boost::mpl::set< char *, const char * >, From > >::type >
 Specialized conversion class. More...
struct  test_throw::implementation::tlexical_cast< To, std::string, typename boost::enable_if< boost::is_unsigned< To > >::type >
 Specialized conversion class. More...

Namespaces

namespace  test_throw
namespace  implementation
 

Contains the implementation details for lexical_cast and shouldn't be used directly.


namespace  test_throw::implementation

Defines

#define GETTEXT_DOMAIN   "wesnoth-test"
#define LEXICAL_CAST_DEBUG
#define TEST_CASE(type_send, initializer)

Typedefs

typedef boost::mpl::vector
< bool, char, signed char,
unsigned char, short, int,
long, long long, unsigned
short, unsigned int, unsigned
long, unsigned long long > 
test_throw::test_match_types
typedef boost::mpl::vector
< float, double, long double > 
test_throw::test_nomatch_types
typedef boost::mpl::copy
< test_nomatch_types,
boost::mpl::back_inserter
< test_match_types > >::type 
test_throw::test_types
typedef boost::mpl::vector
< signed char, short, int,
long > 
test_throw::test_lexical_cast_signed_types
typedef boost::mpl::vector
< bool, unsigned char,
unsigned short, unsigned int,
unsigned long > 
test_throw::test_lexical_cast_unsigned_types

Functions

template<typename To , typename From >
To test_throw::lexical_cast (From value)
 Lexical cast converts one type to another.
 test_throw::BOOST_AUTO_TEST_CASE_TEMPLATE (test_lexical_cast_throw, T, test_types)
 test_throw::BOOST_AUTO_TEST_CASE_TEMPLATE (test_lexical_cast_signed, T, test_lexical_cast_signed_types)
 test_throw::BOOST_AUTO_TEST_CASE (test_lexical_cast_long_long)
 test_throw::BOOST_AUTO_TEST_CASE_TEMPLATE (test_lexical_cast_unsigned, T, test_lexical_cast_unsigned_types)
 test_throw::BOOST_AUTO_TEST_CASE (test_lexical_cast_unsigned_long_long)
 BOOST_AUTO_TEST_CASE (test_lexical_cast_result)

Define Documentation

#define GETTEXT_DOMAIN   "wesnoth-test"

Definition at line 16 of file test_lexical_cast.cpp.

#define LEXICAL_CAST_DEBUG

Definition at line 26 of file test_lexical_cast.cpp.

#define TEST_CASE (   type_send,
  initializer 
)
Value:
{                                                               \
    type_send val = initializer value;                              \
                                                                    \
    BOOST_CHECK_EXCEPTION(                                          \
            lexical_cast<std::string>(val), const char*, validate); \
    }

Definition at line 86 of file test_lexical_cast.cpp.


Function Documentation

BOOST_AUTO_TEST_CASE ( test_lexical_cast_result   ) 

Definition at line 202 of file test_lexical_cast.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:10:42 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs