X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fattributes-test.h;h=d6851a42b4a77147dd5a19180f15e20838b7eecf;hb=b1af89b4a7095e739b52347155ce76b26d1a2c46;hp=d1d872bf73e021a0ad1ac97789537c01ec95eb59;hpb=8ddc9183792f433ab467353b3d35da192187d9ff;p=inkscape.git diff --git a/src/attributes-test.h b/src/attributes-test.h index d1d872bf7..d6851a42b 100644 --- a/src/attributes-test.h +++ b/src/attributes-test.h @@ -5,7 +5,8 @@ #include #include -#include "utest/utest.h" +#include +#include #include "attributes.h" #include "streq.h" @@ -46,25 +47,25 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"marker", true}, {"line-height", true}, - {"accent-height", false}, + {"accent-height", true}, {"accumulate", true}, {"alignment-baseline", true}, - {"alphabetic", false}, + {"alphabetic", true}, {"amplitude", true}, {"animate", false}, - {"arabic-form", false}, - {"ascent", false}, + {"arabic-form", true}, + {"ascent", true}, {"attributeType", true}, - {"azimuth", false}, + {"azimuth", true}, {"baseFrequency", true}, {"baseline-shift", true}, {"baseProfile", false}, - {"bbox", false}, + {"bbox", true}, {"bias", true}, {"block-progression", true}, {"by", true}, {"calcMode", true}, - {"cap-height", false}, + {"cap-height", true}, {"class", false}, {"clip", true}, {"clip-path", true}, @@ -81,7 +82,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"cx", true}, {"cy", true}, {"d", true}, - {"descent", false}, + {"descent", true}, {"diffuseConstant", true}, {"direction", true}, {"display", true}, @@ -91,7 +92,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"dx", true}, {"dy", true}, {"edgeMode", true}, - {"elevation", false}, + {"elevation", true}, {"enable-background", true}, {"end", true}, {"exponent", true}, @@ -130,25 +131,25 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"from", true}, {"fx", true}, {"fy", true}, - {"g1", false}, - {"g2", false}, - {"glyph-name", false}, + {"g1", true}, + {"g2", true}, + {"glyph-name", true}, {"glyph-orientation-horizontal", true}, {"glyph-orientation-vertical", true}, {"glyphRef", false}, {"gradientTransform", true}, {"gradientUnits", true}, - {"hanging", false}, + {"hanging", true}, {"height", true}, - {"horiz-adv-x", false}, - {"horiz-origin-x", false}, - {"horiz-origin-y", false}, - {"ideographic", false}, + {"horiz-adv-x", true}, + {"horiz-origin-x", true}, + {"horiz-origin-y", true}, + {"ideographic", true}, {"image-rendering", true}, - {"in", false}, + {"in", true}, {"in2", true}, {"intercept", true}, - {"k", false}, + {"k", true}, {"k1", true}, {"k2", true}, {"k3", true}, @@ -159,11 +160,11 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"keyPoints", false}, {"keySplines", true}, {"keyTimes", true}, - {"lang", false}, + {"lang", true}, {"lengthAdjust", false}, {"letter-spacing", true}, {"lighting-color", true}, - {"limitingConeAngle", false}, + {"limitingConeAngle", true}, {"local", true}, {"marker-end", true}, {"marker-mid", true}, @@ -174,7 +175,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"mask", true}, {"maskContentUnits", true}, {"maskUnits", true}, - {"mathematical", false}, + {"mathematical", true}, {"max", true}, {"media", false}, {"method", false}, @@ -191,7 +192,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"onerror", false}, {"onfocusin", false}, {"onfocusout", false}, - {"onload", false}, + {"onload", true}, {"onmousedown", false}, {"onmousemove", false}, {"onmouseout", false}, @@ -209,9 +210,9 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"orientation", true}, {"origin", false}, {"overflow", true}, - {"overline-position", false}, - {"overline-thickness", false}, - {"panose-1", false}, + {"overline-position", true}, + {"overline-thickness", true}, + {"panose-1", true}, {"path", false}, {"pathLength", false}, {"patternContentUnits", true}, @@ -219,9 +220,9 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"patternUnits", true}, {"pointer-events", true}, {"points", true}, - {"pointsAtX", false}, - {"pointsAtY", false}, - {"pointsAtZ", false}, + {"pointsAtX", true}, + {"pointsAtY", true}, + {"pointsAtZ", true}, {"preserveAlpha", true}, {"preserveAspectRatio", true}, {"primitiveUnits", true}, @@ -235,7 +236,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"requiredFeatures", true}, {"requiredExtensions", true}, {"restart", true}, - {"result", false}, + {"result", true}, {"rotate", true}, {"rx", true}, {"ry", true}, @@ -249,13 +250,13 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"spreadMethod", true}, {"startOffset", true}, {"stdDeviation", true}, - {"stemh", false}, - {"stemv", false}, + {"stemh", true}, + {"stemv", true}, {"stitchTiles", true}, {"stop-color", true}, {"stop-opacity", true}, - {"strikethrough-position", false}, - {"strikethrough-thickness", false}, + {"strikethrough-position", true}, + {"strikethrough-thickness", true}, {"stroke", true}, {"stroke-dasharray", true}, {"stroke-dashoffset", true}, @@ -282,32 +283,32 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"to", true}, {"transform", true}, {"type", true}, - {"u1", false}, - {"u2", false}, - {"underline-position", false}, - {"underline-thickness", false}, - {"unicode", false}, + {"u1", true}, + {"u2", true}, + {"underline-position", true}, + {"underline-thickness", true}, + {"unicode", true}, {"unicode-bidi", true}, - {"unicode-range", false}, - {"units-per-em", false}, - {"v-alphabetic", false}, - {"v-hanging", false}, - {"v-ideographic", false}, - {"v-mathematical", false}, + {"unicode-range", true}, + {"units-per-em", true}, + {"v-alphabetic", true}, + {"v-hanging", true}, + {"v-ideographic", true}, + {"v-mathematical", true}, {"values", true}, {"version", true}, - {"vert-adv-y", false}, - {"vert-origin-x", false}, - {"vert-origin-y", false}, + {"vert-adv-y", true}, + {"vert-origin-x", true}, + {"vert-origin-y", true}, {"viewBox", true}, {"viewTarget", false}, {"visibility", true}, {"width", true}, - {"widths", false}, + {"widths", true}, {"word-spacing", true}, {"writing-mode", true}, {"x", true}, - {"x-height", false}, + {"x-height", true}, {"x1", true}, {"x2", true}, {"xChannelSelector", true}, @@ -326,7 +327,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"y1", true}, {"y2", true}, {"yChannelSelector", true}, - {"z", false}, + {"z", true}, {"zoomAndPan", false}, /* Extra attributes. */ @@ -339,12 +340,29 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"inkscape:groupmode", true}, {"sodipodi:version", true}, {"inkscape:version", true}, - {"inkscape:object-bbox", true}, - {"inkscape:object-points", true}, {"inkscape:object-paths", true}, {"inkscape:object-nodes", true}, + {"inkscape:bbox-paths", true}, + {"inkscape:bbox-nodes", true}, + {"inkscape:snap-page", true}, + {"inkscape:snap-global", true}, + {"inkscape:snap-bbox", true}, + {"inkscape:snap-nodes", true}, + {"inkscape:snap-from-guide", true}, + {"inkscape:snap-center", true}, + {"inkscape:snap-smooth-nodes", true}, + {"inkscape:snap-midpoints", true}, + {"inkscape:snap-object-midpoints", true}, + {"inkscape:snap-bbox-edge-midpoints", true}, + {"inkscape:snap-bbox-midpoints", true}, + //{"inkscape:snap-intersection-grid-guide", true}, + {"inkscape:snap-grids", true}, + {"inkscape:snap-to-guides", true}, + {"inkscape:snap-intersection-paths", true}, + {"inkscape:original-d", true}, {"inkscape:pageopacity", true}, {"inkscape:pageshadow", true}, + {"inkscape:path-effect", true}, {"inkscape:transform-center-x", true}, {"inkscape:transform-center-y", true}, {"inkscape:zoom", true}, @@ -354,10 +372,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"inkscape:window-height", true}, {"inkscape:window-x", true}, {"inkscape:window-y", true}, - {"inkscape:grid-bbox", true}, - {"inkscape:guide-bbox", true}, - {"inkscape:grid-points", true}, - {"inkscape:guide-points", true}, + {"inkscape:window-maximized", true}, {"inkscape:current-layer", true}, {"inkscape:connector-type", true}, {"inkscape:connection-start", true}, @@ -368,6 +383,15 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"sodipodi:cy", true}, {"sodipodi:rx", true}, {"sodipodi:ry", true}, + {"inkscape:perspectiveID", true}, + {"inkscape:corner0", true}, + {"inkscape:corner7", true}, + {"inkscape:box3dsidetype", true}, + {"inkscape:persp3d", true}, + {"inkscape:vp_x", true}, + {"inkscape:vp_y", true}, + {"inkscape:vp_z", true}, + {"inkscape:persp3d-origin", true}, {"sodipodi:start", true}, {"sodipodi:end", true}, {"sodipodi:open", true}, @@ -402,13 +426,12 @@ struct {char const *attr; bool supported;} const all_attrs[] = { /* SPNamedView */ {"viewonly", true}, {"showgrid", true}, - {"gridtype", true}, +// {"gridtype", true}, {"showguides", true}, {"gridtolerance", true}, {"guidetolerance", true}, {"objecttolerance", true}, - {"has_abs_tolerance", true}, - {"gridoriginx", true}, +/* {"gridoriginx", true}, {"gridoriginy", true}, {"gridspacingx", true}, {"gridspacingy", true}, @@ -418,7 +441,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"gridopacity", true}, {"gridempcolor", true}, {"gridempopacity", true}, - {"gridempspacing", true}, + {"gridempspacing", true}, */ {"guidecolor", true}, {"guideopacity", true}, {"guidehicolor", true}, @@ -486,11 +509,20 @@ struct {char const *attr; bool supported;} const all_attrs[] = { unsigned const n_ids = ids.size(); for (unsigned id = 1; id < n_ids; ++id) { if (!ids[id]) { - TS_WARN( std::string((const char*)sp_attribute_name(id)) ); + gchar* tmp = g_strdup_printf( "Attribute string with enum %d {%s} not handled", id, sp_attribute_name(id) ); + TS_WARN( std::string((const char*)tmp) ); + g_free( tmp ); found = true; } } TS_ASSERT(!found); + + for ( unsigned int index = 1; index < n_ids; index++ ) { + guchar const* name = sp_attribute_name(index); + unsigned int postLookup = sp_attribute_lookup( reinterpret_cast(name) ); + TSM_ASSERT_EQUALS( std::string("Enum round-trip through string {") + (char const*)name + "} failed.", index, postLookup ); + } + } };