summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2018-02-11 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2018-02-13 14:11:27 +0100
commite8e567546282d714729df55d10ca26ec35c71416 (patch)
treea59f33e6f9f10b3f5faedd59b735420c19abdc0d /tests
parent6f677e77413b628756a9dbb8082f783757b099f3 (diff)
downloadgobject-introspection-e8e567546282d714729df55d10ca26ec35c71416.tar.gz
Reuse const_table between calls to SourceScanner parse_files and parse_macros.
Macro constants may now refer to constants defined in source files. Test case provided by Philip Chimento. Fixes issues #173 and #75.
Diffstat (limited to 'tests')
-rw-r--r--tests/scanner/Regress-1.0-C-expected/Regress.FOO_FLAGS_SECOND_AND_THIRD.page14
-rw-r--r--tests/scanner/Regress-1.0-Gjs-expected/Regress.FOO_FLAGS_SECOND_AND_THIRD.page14
-rw-r--r--tests/scanner/Regress-1.0-Python-expected/Regress.FOO_FLAGS_SECOND_AND_THIRD.page14
-rw-r--r--tests/scanner/Regress-1.0-expected.gir5
-rw-r--r--tests/scanner/foo.h1
5 files changed, 48 insertions, 0 deletions
diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.FOO_FLAGS_SECOND_AND_THIRD.page b/tests/scanner/Regress-1.0-C-expected/Regress.FOO_FLAGS_SECOND_AND_THIRD.page
new file mode 100644
index 00000000..50df7545
--- /dev/null
+++ b/tests/scanner/Regress-1.0-C-expected/Regress.FOO_FLAGS_SECOND_AND_THIRD.page
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<page id="Regress.FOO_FLAGS_SECOND_AND_THIRD"
+ type="topic"
+ style="default"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
+ <info>
+ <link xref="index" group="default" type="guide"/>
+ </info>
+ <title>Regress.FOO_FLAGS_SECOND_AND_THIRD</title>
+
+
+</page>
diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.FOO_FLAGS_SECOND_AND_THIRD.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FOO_FLAGS_SECOND_AND_THIRD.page
new file mode 100644
index 00000000..50df7545
--- /dev/null
+++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.FOO_FLAGS_SECOND_AND_THIRD.page
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<page id="Regress.FOO_FLAGS_SECOND_AND_THIRD"
+ type="topic"
+ style="default"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
+ <info>
+ <link xref="index" group="default" type="guide"/>
+ </info>
+ <title>Regress.FOO_FLAGS_SECOND_AND_THIRD</title>
+
+
+</page>
diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.FOO_FLAGS_SECOND_AND_THIRD.page b/tests/scanner/Regress-1.0-Python-expected/Regress.FOO_FLAGS_SECOND_AND_THIRD.page
new file mode 100644
index 00000000..50df7545
--- /dev/null
+++ b/tests/scanner/Regress-1.0-Python-expected/Regress.FOO_FLAGS_SECOND_AND_THIRD.page
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<page id="Regress.FOO_FLAGS_SECOND_AND_THIRD"
+ type="topic"
+ style="default"
+ xmlns="http://projectmallard.org/1.0/"
+ xmlns:api="http://projectmallard.org/experimental/api/"
+ xmlns:ui="http://projectmallard.org/1.0/ui/">
+ <info>
+ <link xref="index" group="default" type="guide"/>
+ </info>
+ <title>Regress.FOO_FLAGS_SECOND_AND_THIRD</title>
+
+
+</page>
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 980ad650..cd47fcb5 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -945,6 +945,11 @@ it says it's pointer but it's actually a string.</doc>
c:type="REGRESS_FOO_DEFINE_SHOULD_BE_EXPOSED">
<type name="utf8" c:type="gchar*"/>
</constant>
+ <constant name="FOO_FLAGS_SECOND_AND_THIRD"
+ value="6"
+ c:type="REGRESS_FOO_FLAGS_SECOND_AND_THIRD">
+ <type name="gint" c:type="gint"/>
+ </constant>
<constant name="FOO_PIE_IS_TASTY"
value="3.141590"
c:type="REGRESS_FOO_PIE_IS_TASTY">
diff --git a/tests/scanner/foo.h b/tests/scanner/foo.h
index 02d9b7c8..bf9d2c37 100644
--- a/tests/scanner/foo.h
+++ b/tests/scanner/foo.h
@@ -246,6 +246,7 @@ typedef enum
REGRESS_FOO_FLAGS_THIRD = 1 << 2
} RegressFooFlagsType;
+#define REGRESS_FOO_FLAGS_SECOND_AND_THIRD (REGRESS_FOO_FLAGS_SECOND | REGRESS_FOO_FLAGS_THIRD)
_GI_TEST_EXTERN
GType regress_foo_flags_type_get_type (void);