summaryrefslogtreecommitdiff
path: root/basegfx/test
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-06-19 12:47:44 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-06-19 12:47:44 +0200
commit941020379b1ea1ec7c564c21e68ea1674cda7683 (patch)
tree40fcaf109d6d585bcdc0faf7ea6c0812b3cc9a39 /basegfx/test
parent0692507dcc62e94c7af88388961db1d7d12d6dbd (diff)
parent0d2916e03ea51529e15995830a1a8c36bd72e442 (diff)
Merge branch 'master' into feature/gnumake4
Conflicts: basebmp/prj/d.lst basebmp/test/basictest.cxx basebmp/test/makefile.mk basegfx/inc/basegfx/basegfxdllapi.h basegfx/inc/basegfx/tools/debugplotter.hxx basegfx/inc/basegfx/tuple/b2ituple.hxx basegfx/prj/d.lst basegfx/source/numeric/makefile.mk basegfx/source/polygon/makefile.mk basegfx/source/range/makefile.mk basegfx/source/raster/makefile.mk basegfx/source/tuple/makefile.mk basegfx/source/vector/makefile.mk basegfx/test/basegfx1d.cxx basegfx/test/makefile.mk basegfx/util/makefile.mk canvas/Library_canvasfactory.mk canvas/Module_canvas.mk canvas/prj/build.lst canvas/prj/d.lst canvas/source/cairo/cairo_canvashelper_texturefill.cxx canvas/source/cairo/makefile.mk canvas/source/tools/makefile.mk comphelper/qa/string/makefile.mk cppcanvas/Module_cppcanvas.mk cppcanvas/inc/cppcanvas/cppcanvasdllapi.h cppcanvas/prj/build.lst cppcanvas/prj/d.lst cppcanvas/source/mtfrenderer/makefile.mk cppcanvas/util/makefile.mk i18npool/source/search/makefile.mk regexp/Library_regexp.mk regexp/prj/d.lst sax/CppunitTest_sax.mk sax/Library_sax.mk sax/prj/d.lst sax/qa/cppunit/test_converter.cxx sax/source/expatwrap/attrlistimpl.hxx sax/util/makefile.mk svtools/Library_svt.mk tools/Executable_sspretty.mk ucbhelper/prj/d.lst ucbhelper/source/provider/configureucb.cxx ucbhelper/source/provider/provconf.cxx ucbhelper/util/makefile.mk unotools/Library_utl.mk unotools/Module_unotools.mk unotools/Package_inc.mk unotools/prj/build.lst vcl/Library_desktop_detector.mk vcl/Library_vcl.mk vcl/Library_vclplug_gtk.mk vcl/aqua/source/gdi/salprn.cxx vcl/inc/aqua/saldata.hxx vcl/unx/generic/gdi/salgdi3.cxx
Diffstat (limited to 'basegfx/test')
-rw-r--r--basegfx/test/basegfx1d.cxx5
-rw-r--r--basegfx/test/basegfx2d.cxx58
-rw-r--r--basegfx/test/basegfx3d.cxx4
-rw-r--r--basegfx/test/basegfxtools.cxx5
-rw-r--r--basegfx/test/boxclipper.cxx5
-rw-r--r--basegfx/test/clipstate.cxx5
-rw-r--r--basegfx/test/genericclipper.cxx5
-rw-r--r--basegfx/test/testtools.cxx3
-rw-r--r--basegfx/test/testtools.hxx3
9 files changed, 71 insertions, 22 deletions
diff --git a/basegfx/test/basegfx1d.cxx b/basegfx/test/basegfx1d.cxx
index 0c5cf82a7107..68a24f87d66a 100644
--- a/basegfx/test/basegfx1d.cxx
+++ b/basegfx/test/basegfx1d.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,13 +31,11 @@
#include "precompiled_basegfx.hxx"
// autogenerated file with codegen.pl
-#include "preextstl.h"
#include <sal/cppunit.h>
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
#include "cppunit/plugin/TestPlugIn.h"
-#include "postextstl.h"
namespace basegfx1d
{
@@ -74,3 +73,5 @@ CPPUNIT_TEST_SUITE_REGISTRATION(basegfx1d::b1drange);
} // namespace basegfx1d
CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basegfx/test/basegfx2d.cxx b/basegfx/test/basegfx2d.cxx
index 53501d190c03..6cccd67a9c21 100644
--- a/basegfx/test/basegfx2d.cxx
+++ b/basegfx/test/basegfx2d.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,11 +31,9 @@
#include "precompiled_basegfx.hxx"
// autogenerated file with codegen.pl
-#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
-#include "postextstl.h"
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
@@ -73,17 +72,17 @@ public:
void setUp()
{
// simple rectangle
- aPath0 = ::rtl::OUString::createFromAscii(
- "M 10 10-10 10-10-10 10-10Z" );
+ aPath0 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "M 10 10-10 10-10-10 10-10Z" ));
// simple bezier polygon
- aPath1 = ::rtl::OUString::createFromAscii(
+ aPath1 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"m11430 0c-8890 3810 5715 6985 5715 6985 "
"0 0-17145-1905-17145-1905 0 0 22860-10160 "
- "16510 6350-6350 16510-3810-11430-3810-11430z" );
+ "16510 6350-6350 16510-3810-11430-3810-11430z" ));
// '@' as a bezier polygon
- aPath2 = ::rtl::OUString::createFromAscii(
+ aPath2 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"m1917 1114c-89-189-233-284-430-284-167 "
"0-306 91-419 273-113 182-170 370-170 564 "
"0 145 33 259 98 342 65 84 150 126 257 126 "
@@ -106,10 +105,10 @@ public:
"-215-201-487-301-816-301-395 0-715 124-960 "
"373-245 249-368 569-368 958 0 385 119 685 "
"357 900 237 216 557 324 958 325 189-1 389-27 "
- "600-77 211-52 378-110 503-174 27 70 54 140 81 210z" );
+ "600-77 211-52 378-110 503-174 27 70 54 140 81 210z" ));
// first part of 'Hello World' as a line polygon
- aPath3 = ::rtl::OUString::createFromAscii(
+ aPath3 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"m1598 125h306v2334h-306v-1105h-1293v1105h-305v"
"-2334h305v973h1293zm2159 1015 78-44 85 235-91 "
"47-91 40-90 34-90 29-89 21-88 16-88 10-88 3-102"
@@ -141,7 +140,7 @@ public:
"-26-29-28-28-30-26-32-25-32-23-35-21-35-38-74-30-80"
"-24-85-17-89-11-95-3-100 3-101 11-95 17-90 24-85 30"
"-79 38-75 21-35 23-35 25-32 26-32 28-30 29-28 30-26 "
- "31-24 33-22 34-20 35-18 36-16 37-15 39-12 40-11z" );
+ "31-24 33-22 34-20 35-18 36-16 37-15 39-12 40-11z" ));
}
void tearDown()
@@ -710,6 +709,43 @@ public:
CPPUNIT_ASSERT_MESSAGE("scale", maScale == mat);
}
+ void rotate()
+ {
+ B2DHomMatrix mat;
+ mat.rotate(90*F_PI180);
+ CPPUNIT_ASSERT_MESSAGE("rotate pi/2 yields exact matrix",
+ mat.get(0,0) == 0.0 &&
+ mat.get(0,1) == -1.0 &&
+ mat.get(0,2) == 0.0 &&
+ mat.get(1,0) == 1.0 &&
+ mat.get(1,1) == 0.0 &&
+ mat.get(1,2) == 0.0);
+ mat.rotate(90*F_PI180);
+ CPPUNIT_ASSERT_MESSAGE("rotate pi yields exact matrix",
+ mat.get(0,0) == -1.0 &&
+ mat.get(0,1) == 0.0 &&
+ mat.get(0,2) == 0.0 &&
+ mat.get(1,0) == 0.0 &&
+ mat.get(1,1) == -1.0 &&
+ mat.get(1,2) == 0.0);
+ mat.rotate(90*F_PI180);
+ CPPUNIT_ASSERT_MESSAGE("rotate 3/2 pi yields exact matrix",
+ mat.get(0,0) == 0.0 &&
+ mat.get(0,1) == 1.0 &&
+ mat.get(0,2) == 0.0 &&
+ mat.get(1,0) == -1.0 &&
+ mat.get(1,1) == 0.0 &&
+ mat.get(1,2) == 0.0);
+ mat.rotate(90*F_PI180);
+ CPPUNIT_ASSERT_MESSAGE("rotate 2 pi yields exact matrix",
+ mat.get(0,0) == 1.0 &&
+ mat.get(0,1) == 0.0 &&
+ mat.get(0,2) == 0.0 &&
+ mat.get(1,0) == 0.0 &&
+ mat.get(1,1) == 1.0 &&
+ mat.get(1,2) == 0.0);
+ }
+
void translate()
{
B2DHomMatrix mat;
@@ -896,6 +932,7 @@ public:
CPPUNIT_TEST(identity);
CPPUNIT_TEST(scale);
CPPUNIT_TEST(translate);
+ CPPUNIT_TEST(rotate);
CPPUNIT_TEST(shear);
CPPUNIT_TEST(multiply);
CPPUNIT_TEST(decompose);
@@ -1461,3 +1498,4 @@ CPPUNIT_TEST_SUITE_REGISTRATION(basegfx2d::bcolor);
// to let the user the possibility to also register some functions by hand.
// NOADDITIONAL;
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basegfx/test/basegfx3d.cxx b/basegfx/test/basegfx3d.cxx
index 4871dcbd16c4..5ac16fafc6a4 100644
--- a/basegfx/test/basegfx3d.cxx
+++ b/basegfx/test/basegfx3d.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,11 +31,9 @@
#include "precompiled_basegfx.hxx"
// autogenerated file with codegen.pl
-#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
-#include "postextstl.h"
namespace basegfx3d
{
@@ -222,3 +221,4 @@ CPPUNIT_TEST_SUITE_REGISTRATION(basegfx3d::b3dvector);
// to let the user the possibility to also register some functions by hand.
// NOADDITIONAL;
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basegfx/test/basegfxtools.cxx b/basegfx/test/basegfxtools.cxx
index 7e385f1eb78c..4380aafedad8 100644
--- a/basegfx/test/basegfxtools.cxx
+++ b/basegfx/test/basegfxtools.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,11 +31,9 @@
#include "precompiled_basegfx.hxx"
// autogenerated file with codegen.pl
-#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
-#include "postextstl.h"
#include <basegfx/tools/keystoplerp.hxx>
#include <basegfx/numeric/ftools.hxx>
@@ -110,3 +109,5 @@ public:
// -----------------------------------------------------------------------------
CPPUNIT_TEST_SUITE_REGISTRATION(basegfxtools::KeyStopLerpTest);
} // namespace basegfxtools
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basegfx/test/boxclipper.cxx b/basegfx/test/boxclipper.cxx
index b1e08087136f..4d809bb47404 100644
--- a/basegfx/test/boxclipper.cxx
+++ b/basegfx/test/boxclipper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,11 +31,9 @@
#include "precompiled_basegfx.hxx"
// autogenerated file with codegen.pl
-#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
-#include "postextstl.h"
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/curve/b2dcubicbezier.hxx>
@@ -419,3 +418,5 @@ public:
// -----------------------------------------------------------------------------
CPPUNIT_TEST_SUITE_REGISTRATION(basegfx2d::boxclipper);
} // namespace basegfx2d
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basegfx/test/clipstate.cxx b/basegfx/test/clipstate.cxx
index 48c1e5967260..d8c1066c85f1 100644
--- a/basegfx/test/clipstate.cxx
+++ b/basegfx/test/clipstate.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,11 +31,9 @@
#include "precompiled_basegfx.hxx"
// autogenerated file with codegen.pl
-#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
-#include "postextstl.h"
#include <basegfx/tools/b2dclipstate.hxx>
#include <basegfx/range/b2dpolyrange.hxx>
@@ -178,3 +177,5 @@ public:
// -----------------------------------------------------------------------------
CPPUNIT_TEST_SUITE_REGISTRATION(basegfx2d::clipstate);
} // namespace basegfx2d
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basegfx/test/genericclipper.cxx b/basegfx/test/genericclipper.cxx
index d6c97c0567dc..81d8acdf30ad 100644
--- a/basegfx/test/genericclipper.cxx
+++ b/basegfx/test/genericclipper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,11 +31,9 @@
#include "precompiled_basegfx.hxx"
// autogenerated file with codegen.pl
-#include "preextstl.h"
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
-#include "postextstl.h"
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/curve/b2dcubicbezier.hxx>
@@ -159,3 +158,5 @@ public:
// -----------------------------------------------------------------------------
CPPUNIT_TEST_SUITE_REGISTRATION(basegfx2d::genericclipper);
} // namespace basegfx2d
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basegfx/test/testtools.cxx b/basegfx/test/testtools.cxx
index e96eb4d8edce..3b2ec3051324 100644
--- a/basegfx/test/testtools.cxx
+++ b/basegfx/test/testtools.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -233,3 +234,5 @@ namespace basegfx
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basegfx/test/testtools.hxx b/basegfx/test/testtools.hxx
index 1837f9f31a89..c355df27376a 100644
--- a/basegfx/test/testtools.hxx
+++ b/basegfx/test/testtools.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,3 +97,5 @@ namespace basegfx
}
#endif /* _BASEGFX_TESTTOOLS_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */