Code

Added set_int_pref stub to svg/test-stubs.cpp, unit tests build again on
authorjaspervdg <jaspervdg@users.sourceforge.net>
Sat, 19 Jul 2008 16:15:51 +0000 (16:15 +0000)
committerjaspervdg <jaspervdg@users.sourceforge.net>
Sat, 19 Jul 2008 16:15:51 +0000 (16:15 +0000)
Linux.

src/svg/test-stubs.cpp

index e09e03186c7a41b0e4372ae3120440a0fa722e79..945488300a3e2e5047e757823b5cf9953cc81ccb 100644 (file)
 #endif
 
 #include "svg/test-stubs.h"
+#include <map>
+#include <string>
+
+std::map<std::string,long long int> int_prefs;
+
+void
+prefs_set_int_attribute(gchar const *path, gchar const *attr, long long int val)
+{
+    int_prefs[std::string(path) + '/' + std::string(attr)] = val;
+}
 
 long long int
 prefs_get_int_attribute(gchar const *path, gchar const *attr, long long int def)
 {
-    return def;
+    std::map<std::string,long long int>::const_iterator it=int_prefs.find(std::string(path) + '/' + std::string(attr));
+    long long int ret = it==int_prefs.end() ? def : it->second;
+    return ret;
 }
 
 /*