diff options
-rw-r--r-- | giscanner/transformer.py | 6 | ||||
-rw-r--r-- | tests/warn/unresolved-type.h | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/giscanner/transformer.py b/giscanner/transformer.py index 120218f..a1f6193 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -279,7 +279,7 @@ raise ValueError.""" try: (ns, name) = self.split_csymbol(ident) except ValueError, e: - raise TransformerException("Unknown namespace") + raise TransformerException(str(e)) if ns != self._namespace: raise TransformerException( "Skipping foreign symbol from namespace %s" % (ns.name, )) @@ -353,7 +353,7 @@ raise ValueError.""" try: name = self._strip_symbol(child, is_constant=True) except TransformerException, e: - message.warn_symbol(child, e) + message.warn_symbol(symbol, e) return None members.append(ast.Member(name.lower(), child.const_int, @@ -362,7 +362,7 @@ raise ValueError.""" try: enum_name = self.strip_identifier(symbol.ident) except TransformerException, e: - message.warn(e) + message.warn_symbol(symbol, e) return None if symbol.base_type.is_bitfield: klass = ast.Bitfield diff --git a/tests/warn/unresolved-type.h b/tests/warn/unresolved-type.h index 3ee92b7..9f1a05c 100644 --- a/tests/warn/unresolved-type.h +++ b/tests/warn/unresolved-type.h @@ -5,3 +5,15 @@ typedef struct { } MyStruct; // EXPECT:5: Warning: Test: symbol='MyStruct': Unknown namespace for identifier 'MyStruct' + +typedef enum { + TEST_MY_ENUM_A = 0 +} MyEnum; + +// EXPECT:11: Warning: Test: symbol='MyEnum': Unknown namespace for identifier 'MyEnum' + +typedef enum { + MY_ENUM_A = 0 +} TestMyEnum2; + +// EXPECT:17: Warning: Test: symbol='TestMyEnum2': Unknown namespace for symbol 'my_enum_a' |