From 0afd9182f7a018baa5bfeb46a33dfcf6c6680fbd Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Mon, 29 Dec 2008 22:47:57 +0000 Subject: Build a single test executable on Linux to match Windows build system. (bzr r7040) --- src/svg/Makefile_insert | 17 +---------------- src/svg/svg-affine-test.h | 33 ++++++++++++++++----------------- 2 files changed, 17 insertions(+), 33 deletions(-) (limited to 'src/svg') diff --git a/src/svg/Makefile_insert b/src/svg/Makefile_insert index eae713d23..b4558ce96 100644 --- a/src/svg/Makefile_insert +++ b/src/svg/Makefile_insert @@ -36,25 +36,10 @@ svg_libspsvg_a_SOURCES = \ # ###################### # ### CxxTest stuff #### # ###################### -svg_testsuites = \ +CXXTEST_TESTSUITES += \ $(srcdir)/svg/css-ostringstream-test.h \ $(srcdir)/svg/stringstream-test.h \ $(srcdir)/svg/svg-affine-test.h \ $(srcdir)/svg/svg-color-test.h \ $(srcdir)/svg/svg-length-test.h \ $(srcdir)/svg/svg-path-geom-test.h - -svg_test_svg_SOURCES = \ - svg/test-svg.cpp \ - $(svg_testsuites) - -svg_test_svg_LDADD = \ - svg/libspsvg.a \ - svg/libtest-svg.a \ - test-stubs.o \ - 2geom/lib2geom.a \ - libnr/libnr.a \ - $(INKSCAPE_LIBS) - -svg/test-svg.cpp: $(svg_testsuites) svg/Makefile_insert $(CXXTEST_TEMPLATE) - $(CXXTESTGEN) -o svg/test-svg.cpp $(svg_testsuites) diff --git a/src/svg/svg-affine-test.h b/src/svg/svg-affine-test.h index 9cc1cc2fb..5e9fc61fc 100644 --- a/src/svg/svg-affine-test.h +++ b/src/svg/svg-affine-test.h @@ -9,17 +9,6 @@ #include #include -struct approx_equal { - bool operator()(Geom::Matrix const &ref, Geom::Matrix const &cm) const - { - double maxabsdiff = 0; - for(size_t i=0; i<6; i++) { - maxabsdiff = std::max(std::abs(ref[i]-cm[i]), maxabsdiff); - } - return maxabsdiff < 1e-14; - } -}; - class SvgAffineTest : public CxxTest::TestSuite { private: @@ -27,6 +16,16 @@ private: char const * str; Geom::Matrix matrix; }; + struct approx_equal_pred { + bool operator()(Geom::Matrix const &ref, Geom::Matrix const &cm) const + { + double maxabsdiff = 0; + for(size_t i=0; i<6; i++) { + maxabsdiff = std::max(std::abs(ref[i]-cm[i]), maxabsdiff); + } + return maxabsdiff < 1e-14; + } + }; static test_t const read_matrix_tests[3]; static test_t const read_translate_tests[3]; static test_t const read_scale_tests[3]; @@ -76,7 +75,7 @@ public: for(size_t i=0; i