summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e647cfe)
raw | patch | inline | side by side (parent: e647cfe)
author | joncruz <joncruz@users.sourceforge.net> | |
Fri, 6 Apr 2007 21:21:42 +0000 (21:21 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Fri, 6 Apr 2007 21:21:42 +0000 (21:21 +0000) |
src/attributes-test.h | patch | blob | history |
diff --git a/src/attributes-test.h b/src/attributes-test.h
index d82b14df81e88073cb4160759b7aa61abdbcffea..05d0e0a51ac6507df4d8275c0c21575dfdc0bd4d 100644 (file)
--- a/src/attributes-test.h
+++ b/src/attributes-test.h
#include <cxxtest/TestSuite.h>
#include <vector>
+#include <glib.h>
+#include <glib/gprintf.h>
#include "utest/utest.h"
#include "attributes.h"
#include "streq.h"
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 );
+ }
+
}
};