Changeset 717 for trunk


Ignore:
Timestamp:
Nov 30, 2008, 8:41:53 PM (13 years ago)
Author:
Peter Johansson
Message:

refs #338 added some tests for AddStats

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/stats_test.cc

    r693 r717  
    9696    cs.parse(path());
    9797    ok &= test_base_class(cs);
     98
     99    std::vector<size_t> correct(62,0);
     100    correct[15] = 71;
     101    correct[16] = 3;
     102    correct[17] = 7;
     103    correct[28] = 35;
     104    correct[30] = 63;
     105    ok &= check(cs, correct, LineTypeParser::total, "total", "jari");
     106    correct[42] = 1;
     107    correct[43] = 1;
     108    correct[44] = 2;
     109    correct[47] = 2;
     110    ok &= check(cs, correct, LineTypeParser::total, "total", "all");
     111    std::fill(correct.begin(), correct.end(), 0);
     112    correct[42] = 1;
     113    correct[43] = 1;
     114    correct[44] = 2;
     115    correct[47] = 2;
     116    ok &= check(cs, correct, LineTypeParser::copyright, "copyright", "peter");
     117    std::fill(correct.begin(), correct.end(), 0);
     118    correct[15] = 49;
     119    correct[16] = 3;
     120    correct[17] = 7;
     121    correct[28] = 11;
     122    correct[30] = 54;
     123    ok &= check(cs, correct, LineTypeParser::code, "code", "jari");
     124    std::fill(correct.begin(), correct.end(), 0);
     125    correct[15] = 5;
     126    correct[28] = 13;
     127    correct[30] = 7;
     128    ok &= check(cs, correct, LineTypeParser::comment, "comment", "jari");
     129    std::fill(correct.begin(), correct.end(), 0);
     130    correct[15] = 17;
     131    correct[28] = 10;
     132    correct[30] = 2;
     133    ok &= check(cs, correct, LineTypeParser::other, "other", "jari");
     134
    98135    return ok;
    99136  }
     
    106143    cs.parse(path());
    107144    ok &= test_base_class(cs);
     145
    108146    return ok;
    109147  }
     
    199237      }
    200238    }
    201     return true;
     239    return ok;
    202240  }
    203241
Note: See TracChangeset for help on using the changeset viewer.