From 5aa7182661bd38ce93783a45057660c785e056ff Mon Sep 17 00:00:00 2001 From: joncruz Date: Fri, 6 Apr 2007 21:21:42 +0000 Subject: [PATCH] Adding more robust and detailed checks and messages. --- src/attributes-test.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/attributes-test.h b/src/attributes-test.h index d82b14df8..05d0e0a51 100644 --- a/src/attributes-test.h +++ b/src/attributes-test.h @@ -5,6 +5,8 @@ #include #include +#include +#include #include "utest/utest.h" #include "attributes.h" #include "streq.h" @@ -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(name) ); + TSM_ASSERT_EQUALS( std::string("Enum round-trip through string {") + (char const*)name + "} failed.", index, postLookup ); + } + } }; -- 2.30.2