Changeset 1207
- Timestamp:
- Oct 7, 2010, 5:25:31 AM (13 years ago)
- Location:
- trunk/test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/Suite.cc
r1182 r1207 193 193 suite.add(check_total(stats, suite)); 194 194 suite.add(check_comment_or_copy(stats, suite)); 195 return true; 196 } 197 198 199 bool diff(const std::string& a, const std::string& b) 200 { 201 if (a==b) 202 return false; 203 204 std::istringstream ssa(a); 205 std::istringstream ssb(b); 206 207 std::string linea; 208 std::string lineb; 209 while (ssa || ssb) { 210 if (!ssa) { 211 getline(ssb, lineb); 212 std::cout << "+ " << lineb << "\n"; 213 } 214 else if (!ssb) { 215 getline(ssa, linea); 216 std::cout << "- " << lineb << "\n"; 217 } 218 else { 219 getline(ssa, linea); 220 getline(ssb, lineb); 221 if (linea==lineb) 222 std::cout << " " << linea << "\n"; 223 else { 224 std::cout << "- " << linea << "\n"; 225 std::cout << "+ " << lineb << "\n"; 226 } 227 } 228 } 195 229 return true; 196 230 } -
trunk/test/Suite.h
r1182 r1207 82 82 bool consistent(const Stats&, test::Suite&); 83 83 84 // return true if a and b are different 85 // sends differences to cout 86 bool diff(const std::string& a, const std::string& b); 87 84 88 bool equal(const StatsCollection& a, const StatsCollection& b, 85 89 test::Suite& suite);
Note: See TracChangeset
for help on using the changeset viewer.