diff options
| author | Jasper van de Gronde <jasper.vandegronde@gmail.com> | 2008-07-19 11:25:01 +0000 |
|---|---|---|
| committer | jaspervdg <jaspervdg@users.sourceforge.net> | 2008-07-19 11:25:01 +0000 |
| commit | 99809be7014844debfe1f11b4987716dea39f919 (patch) | |
| tree | f848f554c1e5e49bc715bd565415f342ee961b5a /src | |
| parent | Exclude the right(!) files when building the library (forgot to remove the ob... (diff) | |
| download | inkscape-99809be7014844debfe1f11b4987716dea39f919.tar.gz inkscape-99809be7014844debfe1f11b4987716dea39f919.zip | |
Consistently use (create/destroy)Suite in unit tests.
(bzr r6362)
Diffstat (limited to 'src')
| -rw-r--r-- | src/display/bezier-utils-test.h | 5 | ||||
| -rw-r--r-- | src/helper/units-test.h | 5 | ||||
| -rw-r--r-- | src/libnr/nr-compose-test.h | 5 | ||||
| -rw-r--r-- | src/svg/css-ostringstream-test.h | 6 | ||||
| -rw-r--r-- | src/svg/stringstream-test.h | 6 | ||||
| -rw-r--r-- | src/svg/svg-affine-test.h | 9 | ||||
| -rw-r--r-- | src/svg/svg-color-test.h | 5 | ||||
| -rw-r--r-- | src/svg/svg-length-test.h | 5 | ||||
| -rw-r--r-- | src/svg/svg-path-test.h | 5 | ||||
| -rw-r--r-- | src/util/list-container-test.h | 5 | ||||
| -rw-r--r-- | src/xml/repr-action-test.cpp | 3 |
11 files changed, 57 insertions, 2 deletions
diff --git a/src/display/bezier-utils-test.h b/src/display/bezier-utils-test.h index ec980810b..4e5788983 100644 --- a/src/display/bezier-utils-test.h +++ b/src/display/bezier-utils-test.h @@ -104,6 +104,11 @@ public: } virtual ~BezierUtilsTest() {} +// createSuite and destroySuite get us per-suite setup and teardown +// without us having to worry about static initialization order, etc. + static BezierUtilsTest *createSuite() { return new BezierUtilsTest(); } + static void destroySuite( BezierUtilsTest *suite ) { delete suite; } + void testCopyWithoutNansOrAdjacentDuplicates() { NR::Point const src[] = { diff --git a/src/helper/units-test.h b/src/helper/units-test.h index ff218ca94..15eab65d2 100644 --- a/src/helper/units-test.h +++ b/src/helper/units-test.h @@ -36,6 +36,11 @@ public: } virtual ~UnitsTest() {} +// createSuite and destroySuite get us per-suite setup and teardown +// without us having to worry about static initialization order, etc. + static UnitsTest *createSuite() { return new UnitsTest(); } + static void destroySuite( UnitsTest *suite ) { delete suite; } + void testConversions() { struct Case { double x; char const *abbr; double pts; } const tests[] = { diff --git a/src/libnr/nr-compose-test.h b/src/libnr/nr-compose-test.h index fbac745ef..c40975920 100644 --- a/src/libnr/nr-compose-test.h +++ b/src/libnr/nr-compose-test.h @@ -105,6 +105,11 @@ public: delete[] mask; } +// createSuite and destroySuite get us per-suite setup and teardown +// without us having to worry about static initialization order, etc. + static NrComposeTest *createSuite() { return new NrComposeTest(); } + static void destroySuite( NrComposeTest *suite ) { delete suite; } + // FINAL DST SRC void testnr_R8G8B8A8_N_EMPTY_R8G8B8A8_N() diff --git a/src/svg/css-ostringstream-test.h b/src/svg/css-ostringstream-test.h index 1d407b0e2..295bf4bf3 100644 --- a/src/svg/css-ostringstream-test.h +++ b/src/svg/css-ostringstream-test.h @@ -20,6 +20,12 @@ css_test_float(float const x, std::string const &exp_str) class CSSOStringStreamTest : public CxxTest::TestSuite { public: + +// createSuite and destroySuite get us per-suite setup and teardown +// without us having to worry about static initialization order, etc. + static CSSOStringStreamTest *createSuite() { return new CSSOStringStreamTest(); } + static void destroySuite( CSSOStringStreamTest *suite ) { delete suite; } + void testFloats() { css_test_float(4.5, "4.5"); diff --git a/src/svg/stringstream-test.h b/src/svg/stringstream-test.h index a8da13150..d1a041721 100644 --- a/src/svg/stringstream-test.h +++ b/src/svg/stringstream-test.h @@ -21,6 +21,12 @@ svg_test_float(float const x, std::string const &exp_str) class StringStreamTest : public CxxTest::TestSuite { public: + +// createSuite and destroySuite get us per-suite setup and teardown +// without us having to worry about static initialization order, etc. + static StringStreamTest *createSuite() { return new StringStreamTest(); } + static void destroySuite( StringStreamTest *suite ) { delete suite; } + void testFloats() { svg_test_float(4.5, "4.5"); diff --git a/src/svg/svg-affine-test.h b/src/svg/svg-affine-test.h index 7a4c27fb3..9cc1cc2fb 100644 --- a/src/svg/svg-affine-test.h +++ b/src/svg/svg-affine-test.h @@ -32,7 +32,7 @@ private: static test_t const read_scale_tests[3]; static test_t const read_rotate_tests[4]; static test_t const read_skew_tests[3]; - static char const * read_fail_tests[25]; + static char const * const read_fail_tests[25]; static test_t const write_matrix_tests[2]; static test_t const write_translate_tests[3]; static test_t const write_scale_tests[2]; @@ -42,6 +42,11 @@ public: SvgAffineTest() { } +// createSuite and destroySuite get us per-suite setup and teardown +// without us having to worry about static initialization order, etc. + static SvgAffineTest *createSuite() { return new SvgAffineTest(); } + static void destroySuite( SvgAffineTest *suite ) { delete suite; } + void testReadIdentity() { char const* strs[] = { @@ -200,7 +205,7 @@ SvgAffineTest::test_t const SvgAffineTest::read_skew_tests[3] = { {"skewX( 30)",Geom::Matrix(1,0,tan(30.*DEGREE),1,0,0)}, {"skewX(-30)",Geom::Matrix(1,0,tan(-30.*DEGREE),1,0,0)}, {"skewY(390)",Geom::Matrix(1,tan(30.*DEGREE),0,1,0,0)}}; -char const * SvgAffineTest::read_fail_tests[25] = { +char const * const SvgAffineTest::read_fail_tests[25] = { "matrix((1,2,3,4,5,6)", "matrix((1,2,3,4,5,6))", "matrix(1,2,3,4,5,6))", diff --git a/src/svg/svg-color-test.h b/src/svg/svg-color-test.h index b149b7a44..0636fa32f 100644 --- a/src/svg/svg-color-test.h +++ b/src/svg/svg-color-test.h @@ -23,6 +23,11 @@ public: rgb24 << 8); } +// createSuite and destroySuite get us per-suite setup and teardown +// without us having to worry about static initialization order, etc. + static SVGColorTest *createSuite() { return new SVGColorTest(); } + static void destroySuite( SVGColorTest *suite ) { delete suite; } + void testWrite() { unsigned const components[] = {0, 0x80, 0xff, 0xc0, 0x77}; diff --git a/src/svg/svg-length-test.h b/src/svg/svg-length-test.h index 2345803d8..829612b26 100644 --- a/src/svg/svg-length-test.h +++ b/src/svg/svg-length-test.h @@ -17,6 +17,11 @@ public: SvgLengthTest() { } +// createSuite and destroySuite get us per-suite setup and teardown +// without us having to worry about static initialization order, etc. + static SvgLengthTest *createSuite() { return new SvgLengthTest(); } + static void destroySuite( SvgLengthTest *suite ) { delete suite; } + void testRead() { for(size_t i=0; i<G_N_ELEMENTS(absolute_tests); i++) { diff --git a/src/svg/svg-path-test.h b/src/svg/svg-path-test.h index 0f58d6627..28173cbd1 100644 --- a/src/svg/svg-path-test.h +++ b/src/svg/svg-path-test.h @@ -51,6 +51,11 @@ public: // TODO: Also test some (smooth) cubic/quadratic beziers and elliptical arcs } +// createSuite and destroySuite get us per-suite setup and teardown +// without us having to worry about static initialization order, etc. + static SvgPathTest *createSuite() { return new SvgPathTest(); } + static void destroySuite( SvgPathTest *suite ) { delete suite; } + void testReadRectanglesAbsoluteClosed() { rectangleBpath[0].code = NR_MOVETO; diff --git a/src/util/list-container-test.h b/src/util/list-container-test.h index 1c4fe511b..08e7cfa41 100644 --- a/src/util/list-container-test.h +++ b/src/util/list-container-test.h @@ -35,6 +35,11 @@ public: } virtual ~ListContainerTest() {} +// createSuite and destroySuite get us per-suite setup and teardown +// without us having to worry about static initialization order, etc. + static ListContainerTest *createSuite() { return new ListContainerTest(); } + static void destroySuite( ListContainerTest *suite ) { delete suite; } + void testRangeConstructor() { int const values[]={1,2,3,4}; diff --git a/src/xml/repr-action-test.cpp b/src/xml/repr-action-test.cpp index 7e022eb18..9b0ccf5da 100644 --- a/src/xml/repr-action-test.cpp +++ b/src/xml/repr-action-test.cpp @@ -5,6 +5,9 @@ #include "repr.h" #include "event-fns.h" +int sp_main_gui (int, char const**) { return 0; } +int sp_main_console (int, char const**) { return 0; } + int main(int argc, char *argv[]) { Inkscape::XML::Document *document; Inkscape::XML::Node *a, *b, *c, *root; |
