Ignore:
Timestamp:
Jun 13, 2010, 7:28:19 PM (11 years ago)
Author:
Peter Johansson
Message:

merge trunk to src-highlight

Location:
branches/src-highlight
Files:
3 deleted
16 edited
20 copied

Legend:

Unmodified
Added
Removed
  • branches/src-highlight

  • branches/src-highlight/test/Makefile.am

    r801 r1100  
    33## $Id$
    44
    5 # Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
    6 # Copyright (C) 2008, 2009 Peter Johansson
     5# Copyright (C) 2005, 2006, 2007, 2008, 2009 Jari Häkkinen, Peter Johansson
     6# Copyright (C) 2010 Peter Johansson
    77#
    88# This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    2121# along with svndigest. If not, see <http://www.gnu.org/licenses/>.
    2222
    23 check_SCRIPTS = svn_update.sh
     23check_SCRIPTS = svn_update.sh init.sh
    2424
    25 check_PROGRAMS = cache_partial_test \
    26   config_test copyright_test date_test gnuplot_pipe_test \
     25## we use suffix .cc for all source
     26AM_DEFAULT_SOURCE_EXT = .cc
     27
     28EXTRA_PROGRAMS = cache_partial_test color_test \
     29  config_test copyright_test date_test \
     30  htmlstream_test \
    2731  parser_test stats_test trac_test utility_test
    2832
    29 TESTS = $(check_PROGRAMS) test_repo.sh check_repo_status.sh
     33CLEANFILES = $(EXTRA_PROGRAMS)
     34
     35distributed_TESTS =
     36distributed_TESTS += cmd_format_test.sh
     37distributed_TESTS += config2_test.sh
     38distributed_TESTS += config3_test.sh
     39distributed_TESTS += copyright2_test.sh
     40distributed_TESTS += repo_status_test.sh
     41distributed_TESTS += repo_test.sh
     42distributed_TESTS += svncopyright_test.sh
     43distributed_TESTS += svndigest_copy_cache_test.sh
     44
     45TESTS = $(EXTRA_PROGRAMS) $(distributed_TESTS)
     46
     47TEST_EXTENSIONS = .sh
     48
     49EXTRA_DIST = $(distributed_TESTS)
    3050
    3151# tests not yet passing are listed here
     
    4060  $(top_builddir)/lib/libsvndigest.a \
    4161  $(top_builddir)/lib/yat/libyat.a \
    42   $(SVNDIGEST_LIBS)
    43 AM_LDFLAGS = $(SVNDIGEST_LDFLAGS)
     62  $(SVN_LIBS) $(APR_LIBS) $(PLPLOT_LIBS)
     63AM_LDFLAGS = $(APR_LDFLAGS) $(SVN_LDFLAGS) $(PLPLOT_LDFLAGS)
    4464
    45 AM_CPPFLAGS = -I$(top_srcdir)/lib $(SVNDIGEST_CPPFLAGS)
    46 AM_CXXFLAGS = $(SVNDIGEST_CXXFLAGS)
     65AM_CPPFLAGS = -I$(top_srcdir)/lib $(APR_CPPFLAGS) $(SVN_CPPFLAGS) \
     66  $(DEFAULT_CPPFLAGS) $(PLPLOT_CPPFLAGS)
     67AM_CXXFLAGS = $(DEFAULT_CXXFLAGS)
    4768
    4869libsvndigesttest_a_SOURCES = Suite.cc
    4970
    50 cache_partial_test_SOURCES = cache_partial_test.cc
    51 config_test_SOURCES = config_test.cc
    52 copyright_test_SOURCES = copyright_test.cc
    53 date_test_SOURCES = date_test.cc
    54 gnuplot_pipe_test_SOURCES = gnuplot_pipe_test.cc
    55 parser_test_SOURCES = parser_test.cc
    56 stats_test_SOURCES = stats_test.cc
    57 trac_test_SOURCES = trac_test.cc
    58 utility_test_SOURCES = utility_test.cc
    59 
    6071clean-local:
    61   rm -rf generated_output toy_project
     72  rm -rf generated_output toy_project testSubDir
    6273
    6374mostlyclean-local:
    64   rm -f *.png *.tmp *~
     75  rm -f *.png *.tmp *~ .toy_project2
     76
     77.PHONY: lazycheck
     78
     79lazycheck:; $(MAKE) $(AM_MAKEFLAGS) check RECHECK_LOGS=
     80
     81# dependencies for lazycheck
     82cmd_format_test.log:init.sh $(top_builddir)/bin/svndigest$(EXEEXT)
     83config2_test.log:init.sh $(top_builddir)/bin/svndigest$(EXEEXT)
     84config3_test.log:init.sh $(top_builddir)/bin/svndigest$(EXEEXT)
     85copyright2_test.log:init.sh $(top_builddir)/bin/svndigest$(EXEEXT)
     86repo_status_test.log:init.sh
     87repo_test.log:init.sh $(top_builddir)/bin/svndigest$(EXEEXT)
     88svncopyright_test.log:init.sh $(top_builddir)/bin/svncopyright$(EXEEXT)
     89svndigest_copy_cache_test.log:init.sh $(top_builddir)/bin/svndigest-copy-cache
     90
     91
  • branches/src-highlight/test/Suite.cc

    r803 r1100  
    22
    33/*
    4   Copyright (C) 2008, 2009 Peter Johansson
     4  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
     5  Copyright (C) 2009, 2010 Peter Johansson
    56
    67  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    4142
    4243  Suite::Suite(int argc, char* argv[], bool need_test_repo)
    43     : dev_null_(NULL), ok_(true), verbose_(false)
    44   {
    45     char* buffer=std::getenv("VERBOSE");
    46     if ( (argc>1 && (argv[1]==std::string("-v")
    47                      || argv[1]==std::string("--verbose"))
    48           || (buffer && buffer == std::string("1"))) ) {
    49       verbose_=true;
    50     }
    51     else
    52       dev_null_ = new std::ofstream("/dev/null");
    53 
     44    : ok_(true)
     45  {
     46    chdir(abs_builddir());
     47    std::string test_dir = concatenate_path("testSubDir", file_name(argv[0]));
     48    mkdir_p(test_dir);
     49    chdir(test_dir);
    5450    if (need_test_repo) {
    5551      bool have_test_repo=false;
     
    6965  Suite::~Suite(void)
    7066  {
    71     delete dev_null_;
    7267  }
    7368
     
    8883  std::ostream& Suite::out(void) const
    8984  {
    90     if (verbose())
    91       return std::cout;
    92     return *dev_null_;
     85    return std::cout;
    9386  }
    9487
     
    274267  bool Suite::verbose(void) const
    275268  {
    276     return verbose_;
     269    // we are always verbose nowadays
     270    return true;
    277271  }
    278272
  • branches/src-highlight/test/Suite.h

    r803 r1100  
    55
    66/*
    7   Copyright (C) 2008, 2009 Peter Johansson
     7  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
     8  Copyright (C) 2009 Peter Johansson
    89
    910  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    6061
    6162  private:
    62     std::ofstream* dev_null_;
    6363    bool ok_;
    64     bool verbose_;
    6564
    6665    void checkout_test_wc(void) const;
  • branches/src-highlight/test/cache_partial_test.cc

    r803 r1100  
    22
    33/*
    4   Copyright (C) 2009 Peter Johansson
     4  Copyright (C) 2009, 2010 Peter Johansson
    55
    66  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    3838  test::Suite suite(argc, argv, true);
    3939
    40   mkdir_p(test::filename("toy_project/.svndigest"));
    41   std::string root=test::filename("toy_project");
     40  mkdir_p("toy_project/.svndigest");
     41  std::string root="toy_project";
    4242  std::string filename = root + "/AUTHORS";
    4343  suite.out() << "Create SVN instance" << std::endl;
  • branches/src-highlight/test/config_test.cc

    r817 r1100  
    22
    33/*
    4   Copyright (C) 2008, 2009 Peter Johansson
     4  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
     5  Copyright (C) 2009, 2010 Peter Johansson
    56
    67  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    2021*/
    2122
     23#include "Suite.h"
     24
    2225#include "Configuration.h"
    2326
    2427namespace theplu{
    2528namespace svndigest{
    26   bool test_codon(void);
     29  void test_codon(test::Suite&);
     30  void test_read_write(test::Suite&);
    2731}} // end of namespace svndigest and theplu
    2832
     
    3135{
    3236  using namespace theplu::svndigest;
    33   bool ok=true;
     37  test::Suite suite(argc, argv, false);
    3438
    35   ok &= test_codon();
     39  test_codon(suite);
     40  test_read_write(suite);
    3641                                                                               
    37   if (ok)
     42  if (suite.ok()) {
     43    suite.out() << "Test is Ok!" << std::endl;
    3844    return 0;
    39   return 1;
     45  }
     46  suite.out() << "Test failed." << std::endl;
     47  return 1;
    4048}
    4149
     
    4452namespace svndigest{
    4553
    46   bool test_codon(void)
     54  void test_codon(test::Suite& suite)
    4755  {
    4856    const Configuration& c(Configuration::instance());
    49     bool ok =true;
    5057    if (!c.codon("foo.h")){
    51       std::cerr << "No codon for foo.h\n";
    52       ok = false;
     58      suite.out() << "No codon for foo.h\n";
     59      suite.add(false);
    5360    }
    54     if (!c.codon("../dir/test.cc")){
    55       std::cerr << "No codon for test.cc\n";
    56       ok = false;
     61    if (!c.codon("/dir/test.cc")){
     62      suite.out() << "No codon for test.cc\n";
     63      suite.add(false);
    5764    }
    58 
    59     return ok;
     65    if (!c.codon("bootstrap")){
     66      suite.out() << "No codon for bootstrap\n";
     67      suite.add(false);
     68    }
    6069  }
    6170 
     71  void test_read_write(test::Suite& suite)
     72  {
     73    Configuration& config = Configuration::instance();
     74    std::stringstream ss;
     75    ss << config;
     76    config.load(ss);
     77    std::stringstream ss2;
     78    ss2 << config;
     79    if (ss2.str() != ss.str()) {
     80      suite.out() << "error: configuration output not equal\n";
     81      suite.out() << "defalt output:\n" << ss.str() << "\n";
     82      suite.out() << "second output:\n" << ss2.str() << "\n";
     83      suite.add(false);
     84    }
     85  }
     86
    6287}} // end of namespace svndigest and theplu
  • branches/src-highlight/test/copyright_test.cc

    r744 r1100  
    22
    33/*
    4   Copyright (C) 2008, 2009 Peter Johansson
     4  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
     5  Copyright (C) 2009, 2010 Peter Johansson
    56
    67  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    4142  test::Suite suite(argc, argv, true);
    4243
    43   std::string root=test::filename("toy_project");
     44  std::string root="toy_project";
    4445  std::string filename = root + "/README";
    4546
  • branches/src-highlight/test/data/AUTHORS.svndigest-cache-r61

    r792 r1100  
    1 CACHE FILE VERSION 6
     1CACHE FILE VERSION 7
    2248 1
    33jari
    4 CACHE FILE VERSION 6
     4CACHE FILE VERSION 7
    55all
    66
    77jari
    88
    9 CACHE FILE VERSION 6
     9CACHE FILE VERSION 7
    1010all
    11112 6
    1212jari
    13132 6
    14 CACHE FILE VERSION 6
     14CACHE FILE VERSION 7
    1515all
    16162 8
    1717jari
    18182 8
    19 CACHE FILE VERSION 6
     19CACHE FILE VERSION 7
    2020all
    2121
    2222jari
    2323
    24 CACHE FILE VERSION 6
     24CACHE FILE VERSION 7
    2525all
    26262 8
    2727jari
    28282 8
    29 CACHE FILE VERSION 6
     29CACHE FILE VERSION 7
    3030all
    31312 14
    3232jari
    33332 14
    34 CACHE FILE VERSION 6
    35 CACHE FILE VERSION 6
     34CACHE FILE VERSION 7
     35CACHE FILE VERSION 7
    363648 1
    3737jari
    38 CACHE FILE VERSION 6
     38CACHE FILE VERSION 7
    3939all
    4040
    4141jari
    4242
    43 CACHE FILE VERSION 6
     43CACHE FILE VERSION 7
    4444all
    45452 6 48 4294967292
    4646jari
    47472 6 48 4294967292
    48 CACHE FILE VERSION 6
     48CACHE FILE VERSION 7
    4949all
    50502 8 48 4294967293
    5151jari
    52522 8 48 4294967293
    53 CACHE FILE VERSION 6
     53CACHE FILE VERSION 7
    5454all
    5555
    5656jari
    5757
    58 CACHE FILE VERSION 6
     58CACHE FILE VERSION 7
    5959all
    60602 8 48 4294967293
    6161jari
    62622 8 48 4294967293
    63 CACHE FILE VERSION 6
     63CACHE FILE VERSION 7
    6464all
    65652 14 48 4294967289
    6666jari
    67672 14 48 4294967289
    68 CACHE FILE VERSION 6
    69 CACHE FILE VERSION 6
     68CACHE FILE VERSION 7
     69CACHE FILE VERSION 7
    707048 1
    7171jari
    72 CACHE FILE VERSION 6
     72CACHE FILE VERSION 7
    7373all
    7474
    7575jari
    7676
    77 CACHE FILE VERSION 6
     77CACHE FILE VERSION 7
    7878all
    79792 2
    8080jari
    81812 2
    82 CACHE FILE VERSION 6
     82CACHE FILE VERSION 7
    8383all
    84842 5
    8585jari
    86862 5
    87 CACHE FILE VERSION 6
     87CACHE FILE VERSION 7
    8888all
    8989
    9090jari
    9191
    92 CACHE FILE VERSION 6
     92CACHE FILE VERSION 7
    9393all
    94942 5
    9595jari
    96962 5
    97 CACHE FILE VERSION 6
     97CACHE FILE VERSION 7
    9898all
    99992 7
    100100jari
    1011012 7
    102 CACHE FILE VERSION 6
     102CACHE FILE VERSION 7
  • branches/src-highlight/test/date_test.cc

    r693 r1100  
    22
    33/*
    4   Copyright (C) 2007 Peter Johansson
     4  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
    55
    66  This file is part of svndigest, http://dev.thep.lu.se/svndigest
  • branches/src-highlight/test/environment.h.in

    r737 r1100  
    66
    77/*
    8   Copyright (C) 2008 Peter Johansson
     8  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
    99
    1010  This file is part of svndigest, http://dev.thep.lu.se/svndigest
  • branches/src-highlight/test/parser_test.cc

    r693 r1100  
    33/*
    44  Copyright (C) 2006 Peter Johansson
    5   Copyright (C) 2007 Peter Johansson
     5  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
    66
    77  This file is part of svndigest, http://dev.thep.lu.se/svndigest
  • branches/src-highlight/test/repo/db/current

    r818 r1100  
    1 64 1y 4
     168 2s 4
  • branches/src-highlight/test/stats_test.cc

    r744 r1100  
    33/*
    44  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
    5   Copyright (C) 2009 Peter Johansson
     5  Copyright (C) 2009, 2010 Peter Johansson
    66
    77  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    4040#include <vector>
    4141
     42using namespace theplu::svndigest;
     43
    4244namespace theplu{
    4345namespace svndigest{
     
    4648             int linetype, const std::string& descr, const std::string& author);
    4749  std::string path(void);
    48   bool test_add(void);
    49   bool test_blame(void);
    50   bool test_classic(void);
     50  bool test_add(test::Suite&);
     51  bool test_blame(test::Suite&);
     52  bool test_classic(test::Suite&);
    5153  bool test_base_class(const Stats&);
    5254  bool test_cache(const Stats&);
     
    5759int main( int argc, char* argv[])
    5860{
    59   using namespace theplu::svndigest;
    6061  test::Suite suite(argc, argv, true);
    6162
     
    6364  bool ok=true;
    6465
    65   SVN* svn=SVN::instance(test::filename("toy_project"));
     66  SVN* svn=SVN::instance("toy_project");
    6667  if (!svn){
    6768    std::cerr << "error: cannot create SVN instance\n";
     
    6970  }
    7071
    71   ok &= test_add();
    72   ok &= test_blame();
    73   ok &= test_classic();
     72  ok &= test_add(suite);
     73  ok &= test_blame(suite);
     74  ok &= test_classic(suite);
    7475                                                                               
    7576  if (verbose) {
     
    9091  std::string path(void)
    9192  {
    92     return test::filename("toy_project/bin/svnstat.cc");
    93   }
    94 
    95   bool test_add(void)
    96   {
     93    return "toy_project/bin/svnstat.cc";
     94  }
     95
     96  bool test_add(test::Suite& suite)
     97  {
     98    suite.out() << "testing add\n";
    9799    bool ok =true;
    98100    AddStats cs(path());
     
    140142 
    141143 
    142   bool test_blame(void)
    143   {
     144  bool test_blame(test::Suite& suite)
     145  {
     146    suite.out() << "testing blame\n";
    144147    bool ok =true;
    145148    BlameStats cs(path());
     
    207210
    208211
    209   bool test_classic(void)
    210   {
     212  bool test_classic(test::Suite& suite)
     213  {
     214    suite.out() << "testing classic\n";
    211215    bool ok =true;
    212216    ClassicStats cs(path());
     
    216220    // testing copyright lines for peter
    217221    std::vector<int> correct(48,0);
    218     correct[47]=2;
     222    correct[47]=1;
    219223    ok &= check(cs, correct, LineTypeParser::copyright, "copyright", "peter");
    220224
     
    253257    correct[28]=31;
    254258    correct[30]=63;
    255     correct[47]=2;
     259    correct[47]=1;
    256260    ok &= check(cs, correct, LineTypeParser::total, "total", "all");
    257261
  • branches/src-highlight/test/svn_update.sh.in

    r772 r1100  
    44# $Id$
    55
    6 # Copyright (C) 2009 Peter Johansson
     6# Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
     7# Copyright (C) 2009, 2010 Peter Johansson
    78#
    89# This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    2122# along with svndigest. If not, see <http://www.gnu.org/licenses/>.
    2223
    23 rootdir=@abs_builddir@/toy_project
     24test -z "$SVN" && SVN=svn
     25rootdir=toy_project
    2426
    2527if test ! -e $rootdir; then
    2628    repo="@abs_test_repo@";
    27     svn co file://$repo/trunk $rootdir > /dev/null;
     29    $SVN checkout file://$repo/trunk $rootdir;
    2830fi
    2931
    30 svn update $rootdir > /dev/null;
     32$SVN update $rootdir
  • branches/src-highlight/test/trac_test.cc

    r768 r1100  
    22
    33/*
    4   Copyright (C) 2007, 2008, 2009 Peter Johansson
     4  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
     5  Copyright (C) 2009 Peter Johansson
    56
    67  This file is part of svndigest, http://dev.thep.lu.se/svndigest
  • branches/src-highlight/test/utility_test.cc

    r795 r1100  
    22
    33/*
    4   Copyright (C) 2007 Peter Johansson
    5   Copyright (C) 2008 Jari Häkkinen, Peter Johansson
     4  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
     5  Copyright (C) 2009, 2010 Peter Johansson
    66
    77  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    2929
    3030bool test_hex(int, unsigned int, std::string);
    31 bool test_equal(bool, std::string, std::string);
     31bool test_fnmatch(bool, std::string, std::string);
    3232bool test_regexp(bool, std::string, std::string,
    3333                 const std::vector<std::string>&);
     
    4141  ok &= test_hex(16,2, "10");
    4242
    43   ok &= test_equal(true,"peter", "peter");
    44   ok &= test_equal(false,"peter", "peterj");
    45   ok &= test_equal(true,"p*", "peterj");
    46   ok &= test_equal(true,"peter", "p*");
    47   ok &= test_equal(false,"peter", "p*j");
    48   ok &= test_equal(true,"peter", "*peter");
     43  ok &= test_fnmatch(true,"peter", "peter");
     44  ok &= test_fnmatch(false,"peter", "peterj");
     45
     46  ok &= test_fnmatch(true,"*", "peterj");
     47  ok &= test_fnmatch(true,"p*", "peterj");
     48  ok &= test_fnmatch(true, "p*", "peter");
     49  ok &= test_fnmatch(false, "p*j", "peter");
     50  ok &= test_fnmatch(true, "p*j", "peterj");
     51  ok &= test_fnmatch(true, "*peter", "peter");
     52
     53  ok &= test_fnmatch(true, "p?ter", "peter");
     54  ok &= test_fnmatch(false, "p?er", "peter");
     55  ok &= test_fnmatch(false, "p?eter", "peter");
     56
     57  ok &= test_fnmatch(true, "filename", "filename");
     58  ok &= test_fnmatch(true, "*name", "filename");
     59  ok &= test_fnmatch(true, "[fa]il?name", "filename");
     60  ok &= test_fnmatch(true, "[fa]*il?name", "ffilename");
     61
     62  ok &= test_fnmatch(true, "[fa]*il?name", "fafafailename");
     63  ok &= test_fnmatch(false, "[fa]?il?name", "ilename");
     64  ok &= test_fnmatch(false, "?[fa]il?name", "ilename");
     65  ok &= test_fnmatch(true, "[fa]il?name", "filename");
     66  ok &= test_fnmatch(false, "[fa]?il?name", "fafafailename");
     67
     68  ok &= test_fnmatch(true, "*name", "/path/to/filename");
     69  ok &= test_fnmatch(true, "*name", "file.name");
     70  // posix dictates that leading period can not be matched by
     71  // wildcard, but here we allow match
     72  ok &= test_fnmatch(true, "*.txt", ".file.txt");
     73
    4974
    5075  std::vector<std::string> vec;
    5176  ok &= test_regexp(true,"abcde", "abcde", vec);
     77  vec.push_back("c");
     78  ok &= test_regexp(true,"ab?de", "abcde", vec);
     79  vec[0] = "bcd";
     80  ok &= test_regexp(true,"a*e", "abcde", vec);
    5281  vec.push_back("");
    53   ok &= test_regexp(true,"abcde", "abcd?e", vec);
    54   vec[0]="c";
    55   ok &= test_regexp(true,"abcde", "ab?de", vec);
    56   vec[0] = "bcd";
    57   ok &= test_regexp(true,"abcde", "a*e", vec);
    58   vec.push_back("");
    59   ok &= test_regexp(true,"abcddf", "a*d*f", vec);
     82  ok &= test_regexp(true,"a*d*f", "abcddf", vec);
    6083  vec[0] = "bc";
    6184  vec[1] = "ef";
    62   ok &= test_regexp(true,"abcdefg", "a*d*g", vec);
     85  ok &= test_regexp(true,"a*d*g", "abcdefg", vec);
    6386  vec.push_back("");
    64   ok &= test_regexp(true,"abcdefg", "a*d*?g", vec);
     87  vec[1]="e";
     88  vec[2]="f";
     89  ok &= test_regexp(true,"a*d*?g", "abcdefg", vec);
     90  ok &= test_regexp(true,"a*d??g", "abcdefg", vec);
     91  vec.resize(2);
     92  vec[0]="f";
     93  vec[1]="e";
     94  ok &= test_regexp(true, "[fa]il?name", "filename", vec);
    6595
    6696  if (ok)
     
    6999}
    70100
    71 bool test_equal(bool answ, std::string a, std::string b)
     101bool test_fnmatch(bool answ, std::string a, std::string b)
    72102{
    73   if (theplu::svndigest::equal(a.begin(), a.end(), b.begin(), b.end())==answ)
     103  using namespace theplu::svndigest;
     104  bool res = fnmatch(a.c_str(), b.c_str());
     105  // check that fnmatch and regexp agree
     106  std::vector<std::string> v;
     107  bool res2 = regexp(a, b, v);
     108  if (res == answ && res2==answ)
    74109    return true;
    75   std::cerr << "equal(" << a << ", " << b << ") results "
    76             << theplu::svndigest::equal(a.begin(), a.end(),b.begin(), b.end())
    77             << ". Expects " << answ << std::endl;
     110  if (res!=answ)
     111    std::cerr << "fnmatch(" << a << ", " << b << ") results "
     112              << res
     113              << ". Expects " << answ << std::endl;
     114  if (res2!=answ)
     115    std::cerr << "regexp(" << b << ", " << a << ") results "
     116              << res2
     117              << ". Expects " << answ << std::endl;
    78118  return false;
    79119}
     
    94134  using namespace theplu::svndigest;
    95135  std::vector<std::string> v;
    96   bool res = regexp(a.begin(), a.end(), b.begin(), b.end(), v);
     136  bool res = regexp(a, b, v);
    97137  if (res!=ans || v!=vec) {
    98138    std::cerr << "regexp(" << a << ", " << b << ") results "
     
    107147  }
    108148  return true;
    109 
    110149}
Note: See TracChangeset for help on using the changeset viewer.