Code

now that selection description includes style (filtered, clipped), we need to update...
[inkscape.git] / src / attributes-test.h
index 8bf6c70cb13cc382b775940ec52327714b7cf494..7b021a5433bc4a776e59cd9c0ea715ece4e0336a 100644 (file)
@@ -5,7 +5,8 @@
 #include <cxxtest/TestSuite.h>
 
 #include <vector>
-#include "utest/utest.h"
+#include <glib.h>
+#include <glib/gprintf.h>
 #include "attributes.h"
 #include "streq.h"
 
@@ -50,17 +51,17 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"accumulate", true},
     {"alignment-baseline", true},
     {"alphabetic", false},
-    {"amplitude", false},
+    {"amplitude", true},
     {"animate", false},
     {"arabic-form", false},
     {"ascent", false},
     {"attributeType", true},
-    {"azimuth", false},
-    {"baseFrequency", false},
+    {"azimuth", true},
+    {"baseFrequency", true},
     {"baseline-shift", true},
     {"baseProfile", false},
     {"bbox", false},
-    {"bias", false},
+    {"bias", true},
     {"block-progression", true},
     {"by", true},
     {"calcMode", true},
@@ -82,31 +83,41 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"cy", true},
     {"d", true},
     {"descent", false},
-    {"diffuseConstant", false},
+    {"diffuseConstant", true},
     {"direction", true},
     {"display", true},
-    {"divisor", false},
+    {"divisor", true},
     {"dominant-baseline", true},
     {"dur", true},
     {"dx", true},
     {"dy", true},
-    {"edgeMode", false},
-    {"elevation", false},
+    {"edgeMode", true},
+    {"elevation", true},
     {"enable-background", true},
     {"end", true},
-    {"exponent", false},
+    {"exponent", true},
     {"externalResourcesRequired", false},
+    {"feBlend", false},
     {"feColorMatrix", false},
+    {"feComponentTransfer", false},
     {"feComposite", false},
+    {"feConvolveMatrix", false},
+    {"feDiffuseLighting", false},
+    {"feDisplacementMap", false},
+    {"feFlood", false},
     {"feGaussianBlur", false},
+    {"feImage", false},
+    {"feMerge", false},
     {"feMorphology", false},
+    {"feOffset", false},
+    {"feSpecularLighting", false},
     {"feTile", false},
     {"fill", true},
     {"fill-opacity", true},
     {"fill-rule", true},
     {"filter", true},
-    {"filterRes", false},
-    {"filterUnits", false},
+    {"filterRes", true},
+    {"filterUnits", true},
     {"flood-color", true},
     {"flood-opacity", true},
     {"font-family", true},
@@ -135,16 +146,16 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"horiz-origin-y", false},
     {"ideographic", false},
     {"image-rendering", true},
-    {"in", false},
-    {"in2", false},
-    {"intercept", false},
+    {"in", true},
+    {"in2", true},
+    {"intercept", true},
     {"k", false},
-    {"k1", false},
-    {"k2", false},
-    {"k3", false},
-    {"k4", false},
-    {"kernelMatrix", false},
-    {"kernelUnitLength", false},
+    {"k1", true},
+    {"k2", true},
+    {"k3", true},
+    {"k4", true},
+    {"kernelMatrix", true},
+    {"kernelUnitLength", true},
     {"kerning", true},
     {"keyPoints", false},
     {"keySplines", true},
@@ -153,7 +164,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"lengthAdjust", false},
     {"letter-spacing", true},
     {"lighting-color", true},
-    {"limitingConeAngle", false},
+    {"limitingConeAngle", true},
     {"local", true},
     {"marker-end", true},
     {"marker-mid", true},
@@ -169,9 +180,9 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"media", false},
     {"method", false},
     {"min", true},
-    {"mode", false},
+    {"mode", true},
     {"name", true},
-    {"numOctaves", false},
+    {"numOctaves", true},
     {"offset", true},
     {"onabort", false},
     {"onactivate", false},
@@ -193,8 +204,8 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"onunload", false},
     {"onzoom", false},
     {"opacity", true},
-    {"operator", false},
-    {"order", false},
+    {"operator", true},
+    {"order", true},
     {"orient", true},
     {"orientation", true},
     {"origin", false},
@@ -209,14 +220,14 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"patternUnits", true},
     {"pointer-events", true},
     {"points", true},
-    {"pointsAtX", false},
-    {"pointsAtY", false},
-    {"pointsAtZ", false},
-    {"preserveAlpha", false},
+    {"pointsAtX", true},
+    {"pointsAtY", true},
+    {"pointsAtZ", true},
+    {"preserveAlpha", true},
     {"preserveAspectRatio", true},
-    {"primitiveUnits", false},
+    {"primitiveUnits", true},
     {"r", true},
-    {"radius", false},
+    {"radius", true},
     {"refX", true},
     {"refY", true},
     {"rendering-intent", true},
@@ -225,23 +236,23 @@ 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},
-    {"scale", false},
-    {"seed", false},
+    {"scale", true},
+    {"seed", true},
     {"shape-rendering", true},
-    {"slope", false},
+    {"slope", true},
     {"spacing", false},
-    {"specularConstant", false},
-    {"specularExponent", false},
+    {"specularConstant", true},
+    {"specularExponent", true},
     {"spreadMethod", true},
     {"startOffset", true},
-    {"stdDeviation", false},
+    {"stdDeviation", true},
     {"stemh", false},
     {"stemv", false},
-    {"stitchTiles", false},
+    {"stitchTiles", true},
     {"stop-color", true},
     {"stop-opacity", true},
     {"strikethrough-position", false},
@@ -255,12 +266,12 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"stroke-opacity", true},
     {"stroke-width", true},
     {"style", true},
-    {"surfaceScale", false},
+    {"surfaceScale", true},
     {"systemLanguage", true},
-    {"tableValues", false},
+    {"tableValues", true},
     {"target", true},
-    {"targetX", false},
-    {"targetY", false},
+    {"targetX", true},
+    {"targetY", true},
     {"text-align", true},
     {"text-anchor", true},
     {"text-decoration", true},
@@ -300,7 +311,7 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"x-height", false},
     {"x1", true},
     {"x2", true},
-    {"xChannelSelector", false},
+    {"xChannelSelector", true},
     {"xlink:actuate", true},
     {"xlink:arcrole", true},
     {"xlink:href", true},
@@ -315,8 +326,8 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     {"y", true},
     {"y1", true},
     {"y2", true},
-    {"yChannelSelector", false},
-    {"z", false},
+    {"yChannelSelector", true},
+    {"z", true},
     {"zoomAndPan", false},
 
     /* Extra attributes. */
@@ -329,10 +340,25 @@ 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:pageopacity", true},
     {"inkscape:pageshadow", true},
     {"inkscape:transform-center-x", true},
@@ -344,10 +370,6 @@ 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:current-layer", true},
     {"inkscape:connector-type", true},
     {"inkscape:connection-start", true},
@@ -358,6 +380,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},
@@ -392,20 +423,22 @@ struct {char const *attr; bool supported;} const all_attrs[] = {
     /* SPNamedView */
     {"viewonly", true},
     {"showgrid", 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},
+    {"gridanglex", true},
+    {"gridanglez", true},
     {"gridcolor", true},
     {"gridopacity", true},
     {"gridempcolor", true},
     {"gridempopacity", true},
-    {"gridempspacing", true},
+    {"gridempspacing", true}, */
     {"guidecolor", true},
     {"guideopacity", true},
     {"guidehicolor", true},
@@ -473,11 +506,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<gchar const*>(name) );
+            TSM_ASSERT_EQUALS( std::string("Enum round-trip through string {") + (char const*)name + "} failed.", index, postLookup );
+        }
+
     }
 };