The Battle for Wesnoth  1.19.6+dev
Namespaces | Macros | Typedefs | Functions
test_lexical_cast.cpp File Reference
#include "lexical_cast.hpp"
#include "log.hpp"
#include <boost/test/unit_test.hpp>
#include <tuple>
Include dependency graph for test_lexical_cast.cpp:

Go to the source code of this file.

Namespaces

 test_throw
 

Macros

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

Typedefs

using test_throw::test_bool_types = std::tuple< bool >
 
using test_throw::test_integral_types = std::tuple< char, signed char, unsigned char, short, int, long, long long, unsigned short, unsigned int, unsigned long, unsigned long long >
 
using test_throw::test_floating_point_types = std::tuple< float, double, long double >
 
using test_throw::test_match_types = decltype(std::tuple_cat(test_bool_types{}, test_integral_types{}))
 
using test_throw::test_nomatch_types = decltype(std::tuple_cat(test_floating_point_types{}))
 
using test_throw::test_types = decltype(std::tuple_cat(test_nomatch_types{}, test_match_types{}))
 
using test_throw::test_arethmetic_types = decltype(std::tuple_cat(test_integral_types{}, test_floating_point_types{}))
 

Functions

 test_throw::BOOST_AUTO_TEST_CASE_TEMPLATE (test_lexical_cast_throw, T, test_types)
 
 test_throw::BOOST_AUTO_TEST_CASE_TEMPLATE (test_lexical_arethmetic_signed, T, test_arethmetic_types)
 
 test_throw::BOOST_AUTO_TEST_CASE (test_lexical_cast_bool)
 
 BOOST_AUTO_TEST_CASE (test_lexical_cast_result)
 

Macro Definition Documentation

◆ GETTEXT_DOMAIN

#define GETTEXT_DOMAIN   "wesnoth-test"

Definition at line 16 of file test_lexical_cast.cpp.

◆ LEXICAL_CAST_DEBUG

#define LEXICAL_CAST_DEBUG

Definition at line 32 of file test_lexical_cast.cpp.

◆ TEST_CASE

#define TEST_CASE (   type_send)
Value:
{ \
type_send val = value; \
\
BOOST_CHECK_EXCEPTION( \
lexical_cast<std::string>(val), const char*, validate); \
}
static void validate(boost::any &v, const std::vector< std::string > &values, two_strings *, int)

Definition at line 87 of file test_lexical_cast.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( test_lexical_cast_result  )

Definition at line 145 of file test_lexical_cast.cpp.

References b.