The Battle for Wesnoth  1.19.5+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, initializer)
 

Typedefs

using test_throw::test_match_types = std::tuple< bool, char, signed char, unsigned char, short, int, long, long long, unsigned short, unsigned int, unsigned long, unsigned long long >
 
using test_throw::test_nomatch_types = std::tuple< float, double, long double >
 
using test_throw::test_types = decltype(std::tuple_cat(test_nomatch_types{}, test_match_types{}))
 
using test_throw::test_lexical_cast_signed_types = std::tuple< signed char, short, int, long >
 
using test_throw::test_lexical_cast_unsigned_types = std::tuple< unsigned char, unsigned short, unsigned int, unsigned long >
 
using test_throw::test_lexical_cast_floating_point_types = std::tuple< float, double, long double >
 

Functions

 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)
 
 test_throw::BOOST_AUTO_TEST_CASE (test_lexical_cast_bool)
 
 test_throw::BOOST_AUTO_TEST_CASE_TEMPLATE (test_lexical_cast_floating_point, T, test_lexical_cast_floating_point_types)
 
 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,
  initializer 
)
Value:
{ \
type_send val = initializer 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 81 of file test_lexical_cast.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( test_lexical_cast_result  )

Definition at line 233 of file test_lexical_cast.cpp.

References b.