comparison Test.cpp @ 8:3019cb6b538d

* Add nondeterministic and verbose options to control output * Dump returned features in a few more situations, if verbose is set * Dump features to stdout rather than stderr
author cannam
date Wed, 18 Mar 2009 10:51:30 +0000
parents 0f65bb22172b
children 5af5eb2627ad
comparison
equal deleted inserted replaced
7:43eb3a4b95c8 8:3019cb6b538d
167 Test::dump(const Plugin::FeatureSet &fs) 167 Test::dump(const Plugin::FeatureSet &fs)
168 { 168 {
169 for (Plugin::FeatureSet::const_iterator fsi = fs.begin(); 169 for (Plugin::FeatureSet::const_iterator fsi = fs.begin();
170 fsi != fs.end(); ++fsi) { 170 fsi != fs.end(); ++fsi) {
171 int output = fsi->first; 171 int output = fsi->first;
172 std::cerr << "Output " << output << ":" << std::endl; 172 std::cout << "Output " << output << ":" << std::endl;
173 const Plugin::FeatureList &fl = fsi->second; 173 const Plugin::FeatureList &fl = fsi->second;
174 for (int i = 0; i < (int)fl.size(); ++i) { 174 for (int i = 0; i < (int)fl.size(); ++i) {
175 std::cerr << " Feature " << i << ":" << std::endl; 175 std::cout << " Feature " << i << ":" << std::endl;
176 const Plugin::Feature &f = fl[i]; 176 const Plugin::Feature &f = fl[i];
177 std::cerr << " Timestamp: " << (f.hasTimestamp ? "(none)" : f.timestamp.toText()) << std::endl; 177 std::cout << " Timestamp: " << (f.hasTimestamp ? "(none)" : f.timestamp.toText()) << std::endl;
178 std::cerr << " Duration: " << (f.hasDuration ? "(none)" : f.duration.toText()) << std::endl; 178 std::cout << " Duration: " << (f.hasDuration ? "(none)" : f.duration.toText()) << std::endl;
179 std::cerr << " Label: " << (f.label == "" ? "(none)" : f.label) << std::endl; 179 std::cout << " Label: " << (f.label == "" ? "(none)" : f.label) << std::endl;
180 std::cerr << " Value: " << (f.values.empty() ? "(none)" : ""); 180 std::cout << " Value: " << (f.values.empty() ? "(none)" : "");
181 for (int j = 0; j < (int)f.values.size(); ++j) { 181 for (int j = 0; j < (int)f.values.size(); ++j) {
182 std::cerr << f.values[j] << " "; 182 std::cout << f.values[j] << " ";
183 } 183 }
184 std::cerr << std::endl; 184 std::cout << std::endl;
185 } 185 }
186 } 186 }
187 } 187 }
188 188
189 void 189 void
190 Test::dump(const Result &r, 190 Test::dump(const Result &r,
191 const Plugin::FeatureSet &a, 191 const Plugin::FeatureSet &a,
192 const Plugin::FeatureSet &b) 192 const Plugin::FeatureSet &b)
193 { 193 {
194 std::cerr << r.message() << std::endl; 194 std::cout << r.message() << std::endl;
195 std::cerr << "\nFirst result set:" << std::endl; 195 std::cout << "\nFirst result set:" << std::endl;
196 dump(a); 196 dump(a);
197 std::cerr << "\nSecond result set:" << std::endl; 197 std::cout << "\nSecond result set:" << std::endl;
198 dump(b); 198 dump(b);
199 std::cerr << std::endl; 199 std::cout << std::endl;
200 } 200 }
201 201
202 bool 202 bool
203 operator==(const Plugin::FeatureSet &a, const Plugin::FeatureSet &b) 203 operator==(const Plugin::FeatureSet &a, const Plugin::FeatureSet &b)
204 { 204 {