diff --git a/src/attributes-test.h b/src/attributes-test.h
index d1d872bf73e021a0ad1ac97789537c01ec95eb59..6677294f232b3f88bb81aa4592e303c2f0d30b8c 100644 (file)
--- a/src/attributes-test.h
+++ b/src/attributes-test.h
#include <cxxtest/TestSuite.h>
#include <vector>
-#include "utest/utest.h"
+#include <glib.h>
+#include <glib/gprintf.h>
#include "attributes.h"
#include "streq.h"
{"begin", true},
{"additive", true},
{"font", true},
+ {"-inkscape-font-specification", true}, // TODO look into this attribute's name
{"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},
{"cx", true},
{"cy", true},
{"d", true},
- {"descent", false},
+ {"descent", true},
{"diffuseConstant", true},
{"direction", true},
{"display", true},
{"dx", true},
{"dy", true},
{"edgeMode", true},
- {"elevation", false},
+ {"elevation", true},
{"enable-background", true},
{"end", true},
{"exponent", true},
{"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},
{"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},
{"mask", true},
{"maskContentUnits", true},
{"maskUnits", true},
- {"mathematical", false},
+ {"mathematical", true},
{"max", true},
{"media", false},
{"method", false},
{"onerror", false},
{"onfocusin", false},
{"onfocusout", false},
- {"onload", false},
+ {"onload", true},
{"onmousedown", false},
{"onmousemove", false},
{"onmouseout", false},
{"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},
{"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},
{"requiredFeatures", true},
{"requiredExtensions", true},
{"restart", true},
- {"result", false},
+ {"result", true},
{"rotate", true},
{"rx", true},
{"ry", true},
{"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},
{"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},
{"y1", true},
{"y2", true},
{"yChannelSelector", true},
- {"z", false},
+ {"z", true},
{"zoomAndPan", false},
/* Extra attributes. */
{"sodipodi:insensitive", true},
{"sodipodi:nonprintable", true},
{"inkscape:groupmode", true},
- {"sodipodi:version", true},
+ {"sodipodi:version", false},
{"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},
{"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},
{"inkscape:connection-end", true},
+ {"inkscape:connection-points", true},
+ {"inkscape:connector-curvature", true},
{"inkscape:connector-avoid", true},
{"inkscape:connector-spacing", true},
{"sodipodi:cx", true},
{"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},
/* 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},
{"gridopacity", true},
{"gridempcolor", true},
{"gridempopacity", true},
- {"gridempspacing", true},
+ {"gridempspacing", true}, */
{"guidecolor", true},
{"guideopacity", true},
{"guidehicolor", true},
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<gchar const*>(name) );
+ TSM_ASSERT_EQUALS( std::string("Enum round-trip through string {") + (char const*)name + "} failed.", index, postLookup );
+ }
+
}
};