Changeset 145 for trunk/test


Ignore:
Timestamp:
Aug 9, 2006, 11:36:31 PM (15 years ago)
Author:
Jari Häkkinen
Message:

Removed test/parser.cc and test/stats.cc. These tests are an essential
part in the test/directory.cc and test/file.cc, and thus redundant.
Fixed the other tests to actually report success or failure.

Location:
trunk/test
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/Makefile.am

    r144 r145  
    2222# 02111-1307, USA.
    2323
    24 TESTS = directory file gnuplot_pipe stats parser
     24TESTS = directory file gnuplot_pipe
    2525
    2626check_PROGRAMS = $(TESTS)
     
    3535file_SOURCES = file.cc
    3636gnuplot_pipe_SOURCES = gnuplot_pipe.cc
    37 parser_SOURCES = parser.cc
    38 stats_SOURCES = stats.cc
    3937
    4038clean-local:
  • trunk/test/directory.cc

    r144 r145  
    2424#include "Directory.h"
    2525
    26 #include <string>
     26#include <iostream>
    2727
    2828int main(const int argc,const char* argv[])
    2929{
    30   using namespace theplu::svnstat;
    31   std::string path("..");
    32   Directory directory(0,path);
     30  try {
     31    // create a file structure of a subversion WC
     32    theplu::svnstat::Directory directory(0,"..");
     33    directory.parse();
     34  }
     35  catch (const std::runtime_error& x) {
     36    std::cerr << "Test directory: " << x.what() << std::endl;
     37    return -1;
     38  }
    3339  return 0;
    3440}
  • trunk/test/file.cc

    r144 r145  
    2323
    2424#include "File.h"
    25 #include "Directory.h"
    2625
    27 #include <string>
     26#include <iostream>
    2827
    2928int main(const int argc,const char* argv[])
    3029{
    31   using namespace theplu::svnstat;
    32   std::string path("file.cc");
    33   File file(0,path);
    34   file.parse();
     30  try {
     31    theplu::svnstat::File file(0,"file.cc");
     32    file.parse();
     33  }
     34  catch (const std::runtime_error& x) {
     35    std::cerr << "Test file: " << x.what() << std::endl;
     36    return -1;
     37  }
    3538  return 0;
    3639}
  • trunk/test/gnuplot_pipe.cc

    r119 r145  
    3030  using namespace theplu;
    3131
    32   bool ok = true;
     32  bool ok = false; // false indicates success, i.e., no errors detected.
    3333
    3434  std::vector<double> x,y;
     
    3939
    4040  svnstat::Gnuplot gnuplot1;
    41   gnuplot1.command("set output 'test1.png'; set term png ; set title 'sine'");
    42   gnuplot1.command("plot sin(x) title 'sine of x' with lines");
     41  ok|=gnuplot1.command("set output 'test1.png'; set term png ; set title 'sine'");
     42  ok|=gnuplot1.command("plot sin(x) title 'sine of x' with lines");
    4343
    4444  svnstat::Gnuplot gnuplot2;
    45   gnuplot2.command("set output 'test2.png'; set term png");
    46   gnuplot2.plot(x);
     45  ok|=gnuplot2.command("set output 'test2.png'; set term png");
     46  ok|=gnuplot2.plot(x);
    4747
    4848  svnstat::Gnuplot gnuplot3;
    49   gnuplot3.command("set output 'test3.png'; set term png");
     49  ok|=gnuplot3.command("set output 'test3.png'; set term png");
    5050  gnuplot3.linetitle("parabola");
    51   gnuplot3.plot(x,y);
    52   gnuplot3.command("set output 'test4.png'");
    53   gnuplot3.command("set title 'ddddd'");
     51  ok|=gnuplot3.plot(x,y);
     52  ok|=gnuplot3.command("set output 'test4.png'");
     53  ok|=gnuplot3.command("set title 'ddddd'");
    5454  //gnuplot3.linestyle("linespoints");
    5555  gnuplot3.linetitle("bajs");
    56   gnuplot3.plot(x);
     56  ok|=gnuplot3.plot(x);
    5757
    5858  /*
     
    6767  */
    6868
    69   return (ok ? 0 : -1);
     69  return ok;
    7070}
Note: See TracChangeset for help on using the changeset viewer.