Classes | Namespaces | Macros | Functions
TypeID_t.cc File Reference
#include "boost/test/tools/output_test_stream.hpp"
#include "boost/test/unit_test.hpp"
#include "canvas/Utilities/TypeID.h"
#include <iostream>
#include <string>

Go to the source code of this file.

Classes

struct  arttest::empty
 
struct  arttest::also_empty
 

Namespaces

 arttest
 

Macros

#define BOOST_TEST_MODULE   (TypeID_t)
 

Functions

 BOOST_AUTO_TEST_CASE (TypeID_equality_val)
 
 BOOST_AUTO_TEST_CASE (TypeID_copy_val)
 
 BOOST_AUTO_TEST_CASE (TypeID_type)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (TypeID_t)

Definition at line 1 of file TypeID_t.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( TypeID_equality_val  )

Definition at line 17 of file TypeID_t.cc.

18 {
20  art::TypeID id1(typeid(e));
21  art::TypeID id2(typeid(e));
22 
23  BOOST_TEST(!(id1 < id2));
24  BOOST_TEST(!(id2 < id1));
25 
26  BOOST_TEST(id1 == id2);
27 
28  std::string n1(id1.name());
29  std::string n2(id2.name());
30 
31  BOOST_TEST(n1 == n2);
32 }
std::string string
Definition: nybbler.cc:12
const double e
BOOST_AUTO_TEST_CASE ( TypeID_copy_val  )

Definition at line 34 of file TypeID_t.cc.

35 {
37  art::TypeID id1(typeid(e));
38 
39  art::TypeID id3 = id1;
40  BOOST_TEST(!(id1 < id3));
41  BOOST_TEST(!(id3 < id1));
42 
43  BOOST_TEST(id1 == id3);
44 
45  std::string n1(id1.name());
46  std::string n3(id3.name());
47  BOOST_TEST(n1 == n3);
48 }
std::string string
Definition: nybbler.cc:12
const double e
char const * name() const
Definition: TypeID.cc:42
BOOST_AUTO_TEST_CASE ( TypeID_type  )

Definition at line 50 of file TypeID_t.cc.

51 {
52  art::TypeID id1(typeid(arttest::empty));
53  art::TypeID id2(typeid(arttest::also_empty));
54 
55  boost::test_tools::output_test_stream os;
56 
57  BOOST_TEST(id1 != id2);
58 
59  os << id1;
60  BOOST_TEST(os.is_equal("arttest::empty"));
61 
62  os.clear();
63  os << id2;
64  BOOST_TEST(os.is_equal("arttest::also_empty"));
65 }