summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2010-09-07 19:36:58 -0400
committerOwen W. Taylor <otaylor@fishsoup.net>2010-09-07 20:03:59 -0400
commitda89c092c5bac56524bd2b60c0f261b9fa3b91be (patch)
tree323ea9fd72a99b8ec13b514658f3d8987252097f /tests
parentcd0de25d5971a34f49830668337af96b15fed4b4 (diff)
downloadgobject-introspection-da89c092c5bac56524bd2b60c0f261b9fa3b91be.tar.gz
Handle casing better for constants
Instead of handling constants by lower-casing them, stripping the lower-case prefix and upper-casing them again, leave them in the original case and check against upper-cased versions of namespace.symbol_prefixes. Wwe detect what version to test against by looking at the first character of the identifier, so we assume that --symbol-prefix options are always in lowercase. If that needs to be relaxed, then we'll have to check all symbols against both sets of prefixes. Add tests for constants to Regress.h and fix tests/warn/unresolved-type.h for a warning message that improved with this change. https://bugzilla.gnome.org/show_bug.cgi?id=629007
Diffstat (limited to 'tests')
-rw-r--r--tests/scanner/Regress-1.0-expected.gir12
-rw-r--r--tests/scanner/regress.h7
-rw-r--r--tests/warn/unresolved-type.h2
3 files changed, 20 insertions, 1 deletions
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 3fce12b5..6ae7172b 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -15,6 +15,18 @@ and/or use gtk-doc annotations. -->
shared-library="libregress.so"
c:identifier-prefixes="Regress"
c:symbol-prefixes="regress">
+ <constant name="DOUBLE_CONSTANT" value="44.220000">
+ <type name="gdouble" c:type="gdouble"/>
+ </constant>
+ <constant name="INT_CONSTANT" value="4422">
+ <type name="gint" c:type="gint"/>
+ </constant>
+ <constant name="Mixed_Case_Constant" value="4423">
+ <type name="gint" c:type="gint"/>
+ </constant>
+ <constant name="STRING_CONSTANT" value="Some String">
+ <type name="utf8" c:type="gchar*"/>
+ </constant>
<record name="SkippedStructure"
c:type="RegressSkippedStructure"
introspectable="0">
diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h
index 6fed4ca7..c0591f84 100644
--- a/tests/scanner/regress.h
+++ b/tests/scanner/regress.h
@@ -166,6 +166,13 @@ GType regress_test_flags_get_type (void) G_GNUC_CONST;
const gchar * regress_test_enum_param(RegressTestEnum e);
+/* constants */
+
+#define REGRESS_INT_CONSTANT 4422
+#define REGRESS_DOUBLE_CONSTANT 44.22
+#define REGRESS_STRING_CONSTANT "Some String"
+#define REGRESS_Mixed_Case_Constant 4423
+
/* structures */
typedef struct _RegressTestStructA RegressTestStructA;
typedef struct _RegressTestStructB RegressTestStructB;
diff --git a/tests/warn/unresolved-type.h b/tests/warn/unresolved-type.h
index 9f1a05cb..a31db5ea 100644
--- a/tests/warn/unresolved-type.h
+++ b/tests/warn/unresolved-type.h
@@ -16,4 +16,4 @@ typedef enum {
MY_ENUM_A = 0
} TestMyEnum2;
-// EXPECT:17: Warning: Test: symbol='TestMyEnum2': Unknown namespace for symbol 'my_enum_a'
+// EXPECT:17: Warning: Test: symbol='TestMyEnum2': Unknown namespace for symbol 'MY_ENUM_A'