[wadalabfont-kit] / jis2prim / PatMatchTest.h  

Diff of /jis2prim/PatMatchTest.h

Parent Directory | Revision Log

version 1.1, Thu Feb 21 11:57:39 2002 UTC version 1.3, Tue Aug 6 06:30:44 2002 UTC
Line 6 
Line 6 
 #include <cppunit/TestResult.h>  #include <cppunit/TestResult.h>
 #include <cppunit/TextTestRunner.h>  #include <cppunit/TextTestRunner.h>
 #include "PatMatch.h"  #include "PatMatch.h"
   #include <vector>
   #include <iostream>
   
 using namespace CppUnit;  using namespace CppUnit;
   
Line 56 
Line 58 
     delete a; delete pat1; delete pat2;      delete a; delete pat1; delete pat2;
   }    }
   void testShow(){    void testShow(){
       std::cout << *pat1 << '\n';
       std::vector<pixel> ps=pat1->getPixels(10,10);
       std::vector<pixel>::iterator it;
       for(it=ps.begin();it!=ps.end();it++){
         std::cout << '(' << it->first << ',' << it->second << ')';
       }
       std::cout << '\n';
   }    }
   void testMatch(){    void testMatch(){
     CPPUNIT_ASSERT( pat1->isMatch(*a,-1,0) == true );      CPPUNIT_ASSERT( pat1->matchPenalty(*a,-1,0) >=0);
     CPPUNIT_ASSERT( pat1->isMatch(*a,0,0) == false );      CPPUNIT_ASSERT( pat1->matchPenalty(*a,0,0) <0);
     CPPUNIT_ASSERT( pat2->isMatch(*a,7,0) == true );      CPPUNIT_ASSERT( pat2->matchPenalty(*a,7,0) >=0);
     CPPUNIT_ASSERT( pat2->isMatch(*a,7,6) == false );      CPPUNIT_ASSERT( pat2->matchPenalty(*a,7,6) <0);
   
   }    }
   static Test *suite(){    static Test *suite(){


Generate output suitable for use with a patch program
Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

ktanaka

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help