diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2008-12-29 22:47:57 +0000 |
|---|---|---|
| committer | tweenk <tweenk@users.sourceforge.net> | 2008-12-29 22:47:57 +0000 |
| commit | 0afd9182f7a018baa5bfeb46a33dfcf6c6680fbd (patch) | |
| tree | 7a57215d94a3ff5de09f50aec4db551a42f59dbc /src/helper/units-test.h | |
| parent | Fix bug #311736 (uninitialized variables resulted in weird snapping behaviour... (diff) | |
| download | inkscape-0afd9182f7a018baa5bfeb46a33dfcf6c6680fbd.tar.gz inkscape-0afd9182f7a018baa5bfeb46a33dfcf6c6680fbd.zip | |
Build a single test executable on Linux to match Windows build system.
(bzr r7040)
Diffstat (limited to 'src/helper/units-test.h')
| -rw-r--r-- | src/helper/units-test.h | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/src/helper/units-test.h b/src/helper/units-test.h index 15eab65d2..e54c9d2f9 100644 --- a/src/helper/units-test.h +++ b/src/helper/units-test.h @@ -4,30 +4,6 @@ #include <glibmm/i18n.h> #include <math.h> - -/* N.B. Wrongly returns false if both near 0. (Not a problem for current users.) */ -static bool -approx_equal(double const x, double const y) -{ - return fabs(x / y - 1) < 1e-15; -} - -static double -sp_units_get_points(double const x, SPUnit const &unit) -{ - SPUnit const &pt_unit = sp_unit_get_by_id(SP_UNIT_PT); - double const px = sp_units_get_pixels(x, unit); - return sp_pixels_get_units(px, pt_unit); -} - -static double -sp_points_get_units(double const pts, SPUnit const &unit) -{ - SPUnit const &pt_unit = sp_unit_get_by_id(SP_UNIT_PT); - double const px = sp_units_get_pixels(pts, pt_unit); - return sp_pixels_get_units(px, unit); -} - class UnitsTest : public CxxTest::TestSuite { public: @@ -79,6 +55,27 @@ public: { TS_ASSERT(sp_units_table_sane()); } + +private: + /* N.B. Wrongly returns false if both near 0. (Not a problem for current users.) */ + bool approx_equal(double const x, double const y) + { + return fabs(x / y - 1) < 1e-15; + } + + double sp_units_get_points(double const x, SPUnit const &unit) + { + SPUnit const &pt_unit = sp_unit_get_by_id(SP_UNIT_PT); + double const px = sp_units_get_pixels(x, unit); + return sp_pixels_get_units(px, pt_unit); + } + + double sp_points_get_units(double const pts, SPUnit const &unit) + { + SPUnit const &pt_unit = sp_unit_get_by_id(SP_UNIT_PT); + double const px = sp_units_get_pixels(pts, pt_unit); + return sp_pixels_get_units(px, unit); + } }; /* |
