Code

Filter effects dialog:
[inkscape.git] / src / attributes-test.h
index d82b14df81e88073cb4160759b7aa61abdbcffea..1030f9e46755ca94599b8ed2418ff862d54674de 100644 (file)
@@ -5,6 +5,8 @@
 #include <cxxtest/TestSuite.h>
 
 #include <vector>
+#include <glib.h>
+#include <glib/gprintf.h>
 #include "utest/utest.h"
 #include "attributes.h"
 #include "streq.h"
@@ -339,8 +341,8 @@ 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-bbox", true},
+    {"inkscape:object-points", true},*/
     {"inkscape:object-paths", true},
     {"inkscape:object-nodes", true},
     {"inkscape:pageopacity", true},
@@ -354,10 +356,10 @@ 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:grid-bbox", true},
     {"inkscape:guide-bbox", true},
     {"inkscape:grid-points", true},
-    {"inkscape:guide-points", true},
+    {"inkscape:guide-points", true},*/
     {"inkscape:current-layer", true},
     {"inkscape:connector-type", true},
     {"inkscape:connection-start", true},
@@ -485,11 +487,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 ( guint index = 1; index < n_ids; index++ ) {
+            guchar const* name = sp_attribute_name(index);
+            gint 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 );
+        }
+
     }
 };