55{
58
59 double precision;
61
62 try {
63
64 JParser<> zap(
"Example program to test hash collection.");
65
68
70 }
71 catch(const exception &error) {
73 }
74
75
77
79
80
81 set<double> input = { 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0 };
83
86 buffer.insert(*x);
87 }
88
89 for (hash_collection::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
91 }
92
93 ASSERT(buffer.size() == input.size(),
"Test of buffer size with multiple inserts of same element.");
94
95
97
99
100 ASSERT(buffer.has(*x),
"Test of buffer content.");
101 }
102
103 {
105
106 out = buffer;
107
109
111
112 ASSERT(out.has(*x),
"Test of buffer content after assignment.");
113 }
114 }
115
117
118 hash_collection::iterator p = buffer.find(*x);
119
120 DEBUG(
"find " <<
FIXED(5,2) << *x <<
" at position " <<
distance(buffer.begin(),p) <<
' ' << buffer.getIndex(*x) <<
endl);
121
122 buffer.erase(p);
123 }
124
126
127 ASSERT(buffer.has(*x) == (
rm.count(*x) == 0),
"Test of buffer content after erase.");
128 }
129
130 return 0;
131}
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.