diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2008-12-09 00:06:13 +0000 |
|---|---|---|
| committer | tweenk <tweenk@users.sourceforge.net> | 2008-12-09 00:06:13 +0000 |
| commit | ed0c006e81c69fbed16181c512c55190d998892e (patch) | |
| tree | 37e6c6d558eceb3e7b4ac9f5ac3aaac41b854863 /src/libnr/nr-scale-test.cpp | |
| parent | fix for Bug #234305 (paste into transformed groups) (diff) | |
| download | inkscape-ed0c006e81c69fbed16181c512c55190d998892e.tar.gz inkscape-ed0c006e81c69fbed16181c512c55190d998892e.zip | |
Simplify "make check" makefile rules and remove most of the obsolete
utest-based tests.
(bzr r6976)
Diffstat (limited to 'src/libnr/nr-scale-test.cpp')
| -rw-r--r-- | src/libnr/nr-scale-test.cpp | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/src/libnr/nr-scale-test.cpp b/src/libnr/nr-scale-test.cpp deleted file mode 100644 index 6bc79917d..000000000 --- a/src/libnr/nr-scale-test.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include <utest/utest.h> -#include <libnr/nr-scale.h> -#include <libnr/nr-scale-ops.h> -using NR::X; -using NR::Y; - -int main(int /*argc*/, char */*argv*/[]) -{ - utest_start("NR::scale"); - - NR::scale const sa(1.5, 2.0); - UTEST_TEST("x,y constructor and operator[] const") { - UTEST_ASSERT(sa[X] == 1.5); - UTEST_ASSERT(sa[Y] == 2.0); - UTEST_ASSERT(sa[0u] == 1.5); - UTEST_ASSERT(sa[1u] == 2.0); - } - - NR::Point const b(-2.0, 3.0); - NR::scale const sb(b); - - UTEST_TEST("copy constructor, operator==, operator!=") { - NR::scale const sa_copy(sa); - UTEST_ASSERT( sa == sa_copy ); - UTEST_ASSERT(!( sa != sa_copy )); - UTEST_ASSERT( sa != sb ); - } - - UTEST_TEST("operator=") { - NR::scale sa_eq(sb); - sa_eq = sa; - UTEST_ASSERT( sa == sa_eq ); - } - - UTEST_TEST("point constructor") { - UTEST_ASSERT(sb[X] == b[X]); - UTEST_ASSERT(sb[Y] == b[Y]); - } - - UTEST_TEST("operator*(Point, scale)") { - NR::Point const ab( b * sa ); - UTEST_ASSERT( ab == NR::Point(-3.0, 6.0) ); - } - - UTEST_TEST("operator*(scale, scale)") { - NR::scale const sab( sa * sb ); - UTEST_ASSERT( sab == NR::scale(-3.0, 6.0) ); - } - - UTEST_TEST("operator/(scale, scale)") { - NR::scale const sa_b( sa / sb ); - NR::scale const exp_sa_b(-0.75, 2./3.); - UTEST_ASSERT( sa_b[0] == exp_sa_b[0] ); - UTEST_ASSERT( fabs( sa_b[1] - exp_sa_b[1] ) < 1e-10 ); - } - - return ( utest_end() - ? EXIT_SUCCESS - : EXIT_FAILURE ); -} - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : |
