Changeset 1167


Ignore:
Timestamp:
Aug 14, 2010, 3:01:50 AM (13 years ago)
Author:
Peter Johansson
Message:

closes #470

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.8-stable/test/graph_test.cc

    r1166 r1167  
    2525
    2626#include <cstdlib>
     27#include <ostream>
    2728
    2829using namespace theplu::svndigest;
     30
     31void test_graph(const std::string format, test::Suite& suite);
     32void test_graph__(const std::string format, test::Suite& suite);
    2933
    3034int main(int argc, char* argv[])
     
    3741#endif
    3842
     43  test_graph("png", suite);
     44  test_graph("svg", suite);
     45  test_graph("pdf", suite);
     46
    3947  // FIXME: in 0.9pre replace with
    4048  // return suite.exit_statu();
     
    4351  return EXIT_FAILURE;
    4452}
     53
     54
     55void test_graph(const std::string format, test::Suite& suite)
     56{
     57  suite.out() << "testing " << format << std::endl;
     58  for (size_t i=0; i<20; ++i)
     59    test_graph__(format, suite);
     60}
     61
     62
     63void test_graph__(const std::string format, test::Suite& suite)
     64{
     65  std::string filename("plot.");
     66  filename+=format;
     67  Graph graph(filename, format);
     68  graph.ymax(10);
     69  graph.current_color(255, 0, 0);
     70  std::vector<unsigned int> data(100,1);
     71  graph.plot(data, "label", 1);
     72}
Note: See TracChangeset for help on using the changeset viewer.