Exemplo n.º 1
0
void compare_classif(Iterator1 begin1, Iterator1 end1,const AS1& as1,Iterator2 it2, const AS2& as2,std::string sname,bool debug){
  unsigned nb=0;
  for (Iterator1 it1=begin1;it1!=end1;++it1){
    ++nb;
    if ( static_cast<int>(as1.classify(it1)) != static_cast<int>(as2.classify(it2))){
      std::cerr << nb << " Pb in " << sname << "\n";
      print_comparison(as1,as2);
      exit(EXIT_FAILURE);
    }
    ++it2;
  }
  if (debug)
    std::cout << sname << ": " << nb << " identical\n";
}
Exemplo n.º 2
0
int main(void)
{
  char *a = "abc", *b = "ABC", *c = "0123", *d = "abcd";

  print_comparison(a, b);
  print_comparison(a, "abc");
  print_comparison(b, a);
  print_comparison(a, c);
  print_comparison(a, d);
  print_comparison(d, c);
  print_comparison(c, d);
  return 0;
}
Exemplo n.º 3
0
void compare_facets_classif(Iterator1 begin1, Iterator1 end1,const AS1& as1,Iterator2 it2, const AS2& as2,std::string sname,bool debug){
  unsigned nb=0;
  for (Iterator1 it1=begin1;it1!=end1;++it1){
    for (int i=0; i<4;++i){
      typename AS1::Facet f1(it1,i);
      typename AS2::Facet f2(it2,i);
      if ( static_cast<int>(as1.classify(f1)) != static_cast<int>(as2.classify(f2))){
        std::cerr << " Pb in " << sname << "\n";
        print_comparison(as1,as2);
        exit(EXIT_FAILURE);
      }
    }
    ++it2;
  }
  if (debug)
    std::cout << sname << ": " << nb << " identical\n";
}