Changeset 718
- Timestamp:
- Nov 30, 2008, 10:03:11 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/stats_test.cc
r717 r718 42 42 namespace svndigest{ 43 43 44 bool check(const Stats& stats, const std::vector< size_t>& correct,44 bool check(const Stats& stats, const std::vector<int>& correct, 45 45 int linetype, const std::string& descr, const std::string& author); 46 46 std::string path(void); … … 97 97 ok &= test_base_class(cs); 98 98 99 std::vector< size_t> correct(62,0);99 std::vector<int> correct(62,0); 100 100 correct[15] = 71; 101 101 correct[16] = 3; … … 144 144 ok &= test_base_class(cs); 145 145 146 std::vector<int> correct(62,0); 147 correct[15] = 71; 148 correct[16] = -1; 149 correct[17] = 2; 150 correct[28] = 31; 151 correct[30] = 25; 152 correct[42] = -1; 153 ok &= check(cs, correct, LineTypeParser::total, "total", "jari"); 154 correct[42] = 0; 155 correct[43] = 1; 156 ok &= check(cs, correct, LineTypeParser::total, "total", "all"); 157 std::fill(correct.begin(), correct.end(), 0); 158 correct[42] = 1; 159 correct[43] = 1; 160 ok &= check(cs, correct, LineTypeParser::copyright, "copyright", "peter"); 161 std::fill(correct.begin(), correct.end(), 0); 162 correct[15] = 49; 163 correct[17] = 2; 164 correct[28] = 8; 165 correct[30] = 54-29; 166 ok &= check(cs, correct, LineTypeParser::code, "code", "jari"); 167 std::fill(correct.begin(), correct.end(), 0); 168 correct[15] = 5; 169 correct[16] = -1; 170 correct[28] = 13; 171 correct[30] = 7-3; 172 ok &= check(cs, correct, LineTypeParser::comment, "comment", "jari"); 173 std::fill(correct.begin(), correct.end(), 0); 174 correct[15] = 17; 175 correct[28] = 10-1; 176 correct[30] = 2-6; 177 ok &= check(cs, correct, LineTypeParser::other, "other", "jari"); 178 146 179 return ok; 147 180 } … … 179 212 180 213 // testing copyright lines for peter 181 std::vector< size_t> correct(48,0);214 std::vector<int> correct(48,0); 182 215 correct[47]=2; 183 216 ok &= check(cs, correct, LineTypeParser::copyright, "copyright", "peter"); … … 223 256 } 224 257 225 bool check(const Stats& stats, const std::vector< size_t>& correct,258 bool check(const Stats& stats, const std::vector<int>& correct, 226 259 int linetype, const std::string& descr, const std::string& author) 227 260 { … … 232 265 size_t n = stats(linetype, author, rev); 233 266 if (n != sum[rev]){ 234 std::c err<< "error: " << descr << " " << author << " rev:" << rev267 std::cout << "error: " << descr << " " << author << " rev:" << rev 235 268 << ": found " << n << " expected " << sum[rev] << "\n"; 236 269 ok = false;
Note: See TracChangeset
for help on using the changeset viewer.