From 2b4bc24677474e24ddf7668ec0fe39ad1c6f6622 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 20 Nov 2014 10:00:40 +0000 Subject: tests: Add a non-GLib test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As a follow up to commit 915a744037d93abfcaab8b35e98e281cf88bb132, add a non-GLib test, which checks that scanning a file which doesn’t include glib.h succeeds. --- tests/Makefile.am | 3 +++ tests/generic-non-glib.head.c | 5 +++++ tests/generic-non-glib.tail.c | 1 + tests/non-glib.c | 10 ++++++++++ 4 files changed, 19 insertions(+) create mode 100644 tests/generic-non-glib.head.c create mode 100644 tests/generic-non-glib.tail.c create mode 100644 tests/non-glib.c (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index e14fb6e..00c0b4f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,6 +15,7 @@ c_tests = \ gvariant-iter.c \ gvariant-lookup.c \ gvariant-new.c \ + non-glib.c \ nonnull.c \ gerror-api.c \ $(NULL) @@ -26,6 +27,8 @@ templates = \ assertion-return.tail.c \ generic.head.c \ generic.tail.c \ + generic-non-glib.head.c \ + generic-non-glib.tail.c \ gerror.head.c \ gerror.tail.c \ gsignal.head.c \ diff --git a/tests/generic-non-glib.head.c b/tests/generic-non-glib.head.c new file mode 100644 index 0000000..328b19b --- /dev/null +++ b/tests/generic-non-glib.head.c @@ -0,0 +1,5 @@ +#include + +int +main (void) +{ diff --git a/tests/generic-non-glib.tail.c b/tests/generic-non-glib.tail.c new file mode 100644 index 0000000..5c34318 --- /dev/null +++ b/tests/generic-non-glib.tail.c @@ -0,0 +1 @@ +} diff --git a/tests/non-glib.c b/tests/non-glib.c new file mode 100644 index 0000000..c82dbc9 --- /dev/null +++ b/tests/non-glib.c @@ -0,0 +1,10 @@ +/* Template: generic-non-glib */ + +/* + * No error + */ +{ + // This should compile OK without the checker falling over because + // glib.h has not been included. + printf ("Hello world!\n"); +} -- cgit v1.2.3