uniform_type_name_test.cc
Go to the documentation of this file.
1 #define BOOST_TEST_MODULE (uniform_type_name_test)
2 #include "boost/test/unit_test.hpp"
3 
5 
6 #include <map>
7 #include <string>
8 #include <vector>
9 
11 using std::string;
12 
13 template <unsigned int, typename>
14 struct MyUIntTemplate_t {};
15 
16 template <unsigned long, typename>
18 
19 namespace {
20  void
21  testit(std::type_info const& tid, std::string const ref)
22  {
23  BOOST_TEST(uniform_type_name(tid) == ref);
24  }
25 }
26 
27 BOOST_AUTO_TEST_SUITE(uniform_type_name_test)
28 
29 BOOST_AUTO_TEST_CASE(allocator_removal)
30 {
31  testit(typeid(std::vector<std::string>), "std::vector<std::string>");
32 }
33 
34 BOOST_AUTO_TEST_CASE(comparator_removal)
35 {
36  testit(typeid(std::map<std::string, std::string>),
37  "std::map<std::string,std::string>");
38 }
39 
40 BOOST_AUTO_TEST_CASE(int_type_names)
41 {
42  testit(typeid(unsigned long long), "ULong64_t");
43  testit(typeid(long long), "Long64_t");
44  testit(typeid(MyUIntTemplate_t<3u, std::string>),
45  "MyUIntTemplate_t<3,std::string>");
47  "MyULongTemplate_t<4,std::string>");
48 }
49 
50 BOOST_AUTO_TEST_SUITE_END()
std::string string
Definition: nybbler.cc:12
std::string uniform_type_name(std::type_info const &tid)
BOOST_AUTO_TEST_CASE(allocator_removal)