Changeset 1207 for trunk/test/Suite.cc
- Timestamp:
- Oct 7, 2010, 5:25:31 AM (12 years ago)
- File:
-
- 1 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 }
Note: See TracChangeset
for help on using the changeset viewer.