Added test for broken contour tags
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/test/FTContour-Test.cpp b/test/FTContour-Test.cpp
index e268fe8..55cda22 100755
--- a/test/FTContour-Test.cpp
+++ b/test/FTContour-Test.cpp
@@ -22,13 +22,20 @@ static FT_Vector straightLinePoints[3] =
{ 9, -2}
};
-static char straightLineTags[3] =
+static char straightLineTags[3] =
{
FT_Curve_Tag_On,
FT_Curve_Tag_On,
FT_Curve_Tag_On
};
+static char brokenTags[3] =
+{
+ FT_Curve_Tag_Conic,
+ 69,
+ FT_Curve_Tag_On
+};
+
static FT_Vector simpleConicPoints[3] =
{
{ 0, 0},
@@ -160,10 +167,13 @@ class FTContourTest : public CppUnit::TestCase
CPPUNIT_ASSERT( contour.PointCount() == 1);
FTContour shortContour( shortLine, simpleConicTags, 2);
- CPPUNIT_ASSERT_DOUBLES_EQUAL( 6, shortContour.PointCount(), 0.0);
+ CPPUNIT_ASSERT( shortContour.PointCount() == 6);
FTContour reallyShortContour( shortLine, simpleConicTags, 1);
- CPPUNIT_ASSERT_DOUBLES_EQUAL( 1, reallyShortContour.PointCount(), 0.0);
+ CPPUNIT_ASSERT( reallyShortContour.PointCount() == 1);
+
+ FTContour brokenTagtContour( shortLine, brokenTags, 3);
+ CPPUNIT_ASSERT( brokenTagtContour.PointCount() == 7);
}