cxxtest: svg-affine-test.h fails

Bug #1207502 reported by Alex Valavanis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Triaged
Medium
Unassigned

Bug Description

The svg-affine-test.h unit test fails with lp:inkscape r12442. This may be related to recent changes in 2geom in r10025, although I haven't checked this.

A couple of notes:

* svg-affine.cpp now seems to return long forms of transform and scale attributes e.g., "transform(1,0) instead of transform(1)".

* Some affine transforms are now represented as general matrix transforms rather than simple forms e.g., matrix(...) rather than skewY(390)

Please could someone familiar with 2geom take a look?

In SvgAffineTest::testWriteTranslate:
../../src/svg/svg-affine-test.h:131: Error: Expected streq_rel( str, write_translate_tests[i].str ), found !streq_rel( translate(1,0), translate(1) )
In SvgAffineTest::testWriteScale:
../../src/svg/svg-affine-test.h:140: Error: Expected streq_rel( str, write_scale_tests[i].str ), found !streq_rel( scale(0,0), scale(0) )
In SvgAffineTest::testWriteRotate:
../../src/svg/svg-affine-test.h:149: Error: Expected streq_rel( str, write_rotate_tests[i].str ), found !streq_rel( matrix(0.97437006,0.22495105,-0.22495105,0.97437006,0,0), rotate(13) )
../../src/svg/svg-affine-test.h:149: Error: Expected streq_rel( str, write_rotate_tests[i].str ), found !streq_rel( matrix(0.97437006,-0.22495105,0.22495105,0.97437006,-2.2950521,1.8565867), rotate(-13,7,11) )
In SvgAffineTest::testWriteSkew:
../../src/svg/svg-affine-test.h:158: Error: Expected streq_rel( str, write_skew_tests[i].str ), found !streq_rel( matrix(1,0,0.57735027,1,0,0), skewX(30) )
../../src/svg/svg-affine-test.h:158: Error: Expected streq_rel( str, write_skew_tests[i].str ), found !streq_rel( matrix(1,0,-0.57735027,1,0,0), skewX(-30) )
../../src/svg/svg-affine-test.h:158: Error: Expected streq_rel( str, write_skew_tests[i].str ), found !streq_rel( matrix(1,0.57735027,0,1,0,0), skewY(390) )
.
In SvgAffineTest::testReadFailures:
../../src/svg/svg-affine-test.h:179: Error: Test failed: matrix(1,2,3,4,5,6,)
../../src/svg/svg-affine-test.h:179: Error: Assertion failed: !sp_svg_transform_read(read_fail_tests[i], &cm)
../../src/svg/svg-affine-test.h:179: Error: Test failed: matrix(1,2,3,4,5e6-3)
../../src/svg/svg-affine-test.h:179: Error: Assertion failed: !sp_svg_transform_read(read_fail_tests[i], &cm)
../../src/svg/svg-affine-test.h:179: Error: Test failed: matrix(1,2,3,4,5e6.3)
../../src/svg/svg-affine-test.h:179: Error: Assertion failed: !sp_svg_transform_read(read_fail_tests[i], &cm)
../../src/svg/svg-affine-test.h:179: Error: Test failed: translate(1,)
../../src/svg/svg-affine-test.h:179: Error: Assertion failed: !sp_svg_transform_read(read_fail_tests[i], &cm)
../../src/svg/svg-affine-test.h:179: Error: Test failed: translate(1,6,)
../../src/svg/svg-affine-test.h:179: Error: Assertion failed: !sp_svg_transform_read(read_fail_tests[i], &cm)

Changed in inkscape:
status: New → Triaged
importance: Undecided → Medium
Changed in inkscape:
milestone: none → 1.0
Revision history for this message
Johan Engelen (johanengelen) wrote :

It is impossible that these tests ever passed. There is no code in our cvs history that can output "translate" with only a single number, or "skew.." etc.

Revision history for this message
Liam P. White (liampwhite) wrote :

(Almost complete) fix committed in r13688
<https://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/13688>

@johan, can you determine whether it is possible to finish this? Jasper seems to have hinted that it was possible…

    /* } else if (transform.withoutTranslation().isRotation()) {
        // FIXME someone please figure out if this can actually be done
        // The rotation angle is correct, the points are not
        // Refer to the matrix in svg-affine-test.h

        // We are a rotation about a special axis
        strcpy(c + p, "rotate(");
        p += 7;

        Geom::Affine const sans_translate = transform.withoutTranslation();
        double angle = std::atan2(sans_translate[1], sans_translate[0]) * (180 / M_PI);
        p += sp_svg_number_write_de(c + p, sizeof(c) - p, angle, prec, min_exp);
        c[p++] = ',';

        Geom::Point pt = transform.translation();
        p += sp_svg_number_write_de(c + p, sizeof(c) - p, pt[Geom::X], prec, min_exp);

        c[p++] = ',';

        p += sp_svg_number_write_de(c + p, sizeof(c) - p, pt[Geom::Y], prec, min_exp);

        c[p++] = ')';
        c[p] = '\000';*/

Patrick Storz (ede123)
Changed in inkscape:
milestone: 1.0-old → 1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.