summaryrefslogtreecommitdiff
path: root/tests/offsets
diff options
context:
space:
mode:
Diffstat (limited to 'tests/offsets')
-rwxr-xr-xtests/offsets/gen-gitestoffsets2
-rw-r--r--tests/offsets/offsets.h14
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/offsets/gen-gitestoffsets b/tests/offsets/gen-gitestoffsets
index ce4a977c..58139fc2 100755
--- a/tests/offsets/gen-gitestoffsets
+++ b/tests/offsets/gen-gitestoffsets
@@ -61,7 +61,7 @@ STRUCT_DEF_RE = compile_re("struct\s+_(TOKEN)\s*{([^}]*)}")
# This certainly can't handle all type declarations, but it only
# needs to handle the ones we use in the test cases
-FIELD_RE = compile_re("^(?:const\s+)?TOKEN(?:[\s*]+)(TOKEN)\s*;$");
+FIELD_RE = compile_re(r"^(?:const\s+)?TOKEN(?:[\s*]+)(TOKEN)\s*(?:\[([0-9]*)\])?\s*;$")
input_f = open(sys.argv[1])
diff --git a/tests/offsets/offsets.h b/tests/offsets/offsets.h
index c0edfe01..9c29a989 100644
--- a/tests/offsets/offsets.h
+++ b/tests/offsets/offsets.h
@@ -104,4 +104,18 @@ struct _OffsetsNested {
char dummy3;
};
+/* Test array offsets
+ */
+
+typedef struct _OffsetsArray OffsetsArray;
+
+struct _OffsetsArray
+{
+ gint some_ints[2];
+ gint8 some_int8s[3];
+ gdouble some_doubles[4];
+ Enum1 some_enum[2];
+ gpointer some_ptrs[5];
+};
+
#endif /* __OFFSETS_H__ */