Addressed Tavis's comments in http://codereview.chromium.org/3023041/. 

- Modified 4-bytes 16.16 Fixed-point number decoder in ReadNextNumberFromType2CharString(). 
- Fixed off-by-one error in ExecuteType2CharStringOperator(). 
- Fixed checks of 'div' and 'endchar' operators. They were not strict enough. 

- Wrote ~1600 lines of test to verify if the modification above is valid. 
- Moved Type2CharStringOperator enum definition from cff_type2_charstriung.cc tocff_type2_charstriung.h to write the unit tests. 

Review: http://codereview.chromium.org/3027049

BUG=51070
TEST=http://code.google.com/p/ots/wiki/HowToTestOts (Verified that the modified OTS rejects all malformed fonts, and does not reject all non-malformed fonts. I tested ~3400 TrueType and ~450 OpenType fonts.) 
TEST=ran cff_type2_charstring_test. 



git-svn-id: http://ots.googlecode.com/svn/trunk@35 a4e77c2c-9104-11de-800e-5b313e0d2bf3
diff --git a/test/SConstruct b/test/SConstruct
index eea29a1..c45f43f 100644
--- a/test/SConstruct
+++ b/test/SConstruct
@@ -8,7 +8,7 @@
 
 # Since the validator-checker tool might handle malicious font files, all hardening options for recent g++/ld are enabled just in case.
 # See http://wiki.debian.org/Hardening for details.
-env = Environment(CCFLAGS = ['-O2', '-I../include', '-I/usr/include/freetype2', '-ggdb', '-Wall', '-W', '-Wno-unused-parameter', '-fno-strict-aliasing', '-fPIE', '-fstack-protector', '-D_FORTIFY_SOURCE=2', '-DOTS_DEBUG'], LINKFLAGS = ['-ggdb', '-Wl,-z,relro', '-Wl,-z,now', '-pie', '-lz'])
+env = Environment(CCFLAGS = ['-O2', '-I../include', '-I../src', '-I/usr/include/freetype2', '-ggdb', '-Wall', '-W', '-Wno-unused-parameter', '-fno-strict-aliasing', '-fPIE', '-fstack-protector', '-D_FORTIFY_SOURCE=2', '-DOTS_DEBUG'], LINKFLAGS = ['-ggdb', '-Wl,-z,relro', '-Wl,-z,now', '-pie', '-lz'])
 # TODO(yusukes): better to use pkg-config freetype2 --cflags
  
 env.Library('../src/libots.a',
@@ -35,7 +35,8 @@
 	    '../src/vdmx.cc',
 	    '../src/vorg.cc'
             ])
- 
+
+env.Program('../test/cff_type2_charstring_test.cc', LIBS = ['ots', 'gtest_main'], LIBPATH = '../src')
 env.Program('../test/ot-sanitise.cc', LIBS = ['ots'], LIBPATH='../src')
 env.Program('../test/idempotent.cc', LIBS = ['ots', 'freetype', 'z', 'm'], LIBPATH='../src')
 env.Program('../test/perf.cc', LIBS = ['ots'], LIBPATH='../src')