[wadalabfont-kit] / jis2prim / MatchersTest.h  

View of /jis2prim/MatchersTest.h

Parent Directory | Revision Log
Revision: 1.1 - (download) (as text) (annotate)
Fri Feb 22 12:03:48 2002 UTC (22 years, 9 months ago) by ktanaka
Branch: MAIN
*** empty log message ***
#ifndef _MATCHERS_TEST_TEST_H
#define _MATCHERS_TEST_TEST_H
#include <cppunit/TestCase.h>
#include <cppunit/TestCaller.h>
#include <cppunit/TestSuite.h>
#include <cppunit/TestResult.h>
#include <cppunit/TextTestRunner.h>
#include "Matchers.h"

using namespace CppUnit;

class MatchersTest : public TestCase {
 private:
  BitmapFont *a;
  Matchers *mat;
 public:
  void setUp(){
    /*
.....................@@.
@@@@@@@@@@@@@@@@@@@@@@@@
........@@....@@........
........@@....@@........
........@@....@@........
........@@....@@........
..@.....@@....@@....@@..
..@@@@@@@@@@@@@@@@@@@@@.
..@@....@@....@@....@@..
..@@....@@....@@....@@..
..@@....@@....@@....@@..
..@@....@@....@@....@@..
..@@....@@....@@....@@..
..@@....@@....@@....@@..
..@@@@@@@@@@@@@@@@@@@@..
..@@....@@....@@....@@..
........@@....@@........
........@@....@@........
........@@....@@........
........@@....@@........
........@@....@@........
........@@....@@.....@@.
@@@@@@@@@@@@@@@@@@@@@@@@
........................
    */

    a=new BitmapFont(24,24,"000006FFFFFF00C30000C30000C30000C30020C30C3FFFFE30C30C30C30C30C30C30C30C30C30C30C30C3FFFFC30C30C00C30000C30000C30000C30000C30000C306FFFFFF000000");
    mat=new Matchers();
  }
  void tearDown(){
    delete a; delete mat;
  }
  void testShow(){
    cout << *mat << '\n';
  }
  void testMatch(){
    vector<MatchResult> mr=mat->findMatch(*a);
    vector<MatchResult>::iterator it;
    for(it=mr.begin();it!=mr.end();it++)
      cout << *it << '\n';
  }
  static Test *suite(){
    TestSuite *suiteOfTests = new TestSuite;
    suiteOfTests->addTest (new TestCaller<MatchersTest>("testShow", &MatchersTest::testShow));
    suiteOfTests->addTest (new TestCaller<MatchersTest>("testMatch", &MatchersTest::testMatch));
    return suiteOfTests;
  }
};

#endif /*  _MATCHERS_TEST_TEST_H */

ktanaka

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help