[vala/0.36] tests: Add default defines test for VALA_0_XX and GLIB_2_XX
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.36] tests: Add default defines test for VALA_0_XX and GLIB_2_XX
- Date: Thu, 6 Dec 2018 15:04:01 +0000 (UTC)
commit bdbe1d9619cc0ca51ff7f03b08a58e671fb7a37e
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sat Nov 24 22:43:21 2018 +0100
tests: Add default defines test for VALA_0_XX and GLIB_2_XX
tests/Makefile.am | 2 ++
tests/parser/preprocessor-glib.vala | 25 ++++++++++++++++++++++
tests/parser/preprocessor-vala.vala | 41 +++++++++++++++++++++++++++++++++++++
3 files changed, 68 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 778c18971..b254f9fa2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -376,6 +376,8 @@ TESTS = \
parser/continue-statement.vala \
parser/do-statement.vala \
parser/preprocessor.vala \
+ parser/preprocessor-glib.vala \
+ parser/preprocessor-vala.vala \
parser/template.vala \
parser/tuple.vala \
parser/bug728574.vala \
diff --git a/tests/parser/preprocessor-glib.vala b/tests/parser/preprocessor-glib.vala
new file mode 100644
index 000000000..3b391c2b6
--- /dev/null
+++ b/tests/parser/preprocessor-glib.vala
@@ -0,0 +1,25 @@
+void main () {
+#if !GLIB_2_16
+ assert_not_reached ();
+#elif !GLIB_2_18
+ assert_not_reached ();
+#elif !GLIB_2_18
+ assert_not_reached ();
+#elif !GLIB_2_20
+ assert_not_reached ();
+#elif !GLIB_2_22
+ assert_not_reached ();
+#elif !GLIB_2_24
+ assert_not_reached ();
+#elif !GLIB_2_26
+ assert_not_reached ();
+#elif !GLIB_2_28
+ assert_not_reached ();
+#elif !GLIB_2_30
+ assert_not_reached ();
+#elif !GLIB_2_32
+ assert_not_reached ();
+#else
+ assert (true);
+#endif
+}
diff --git a/tests/parser/preprocessor-vala.vala b/tests/parser/preprocessor-vala.vala
new file mode 100644
index 000000000..b4f59f548
--- /dev/null
+++ b/tests/parser/preprocessor-vala.vala
@@ -0,0 +1,41 @@
+void main () {
+#if !VALA_0_2
+ assert_not_reached ();
+#elif !VALA_0_4
+ assert_not_reached ();
+#elif !VALA_0_6
+ assert_not_reached ();
+#elif !VALA_0_8
+ assert_not_reached ();
+#elif !VALA_0_10
+ assert_not_reached ();
+#elif !VALA_0_12
+ assert_not_reached ();
+#elif !VALA_0_14
+ assert_not_reached ();
+#elif !VALA_0_16
+ assert_not_reached ();
+#elif !VALA_0_18
+ assert_not_reached ();
+#elif !VALA_0_20
+ assert_not_reached ();
+#elif !VALA_0_22
+ assert_not_reached ();
+#elif !VALA_0_24
+ assert_not_reached ();
+#elif !VALA_0_26
+ assert_not_reached ();
+#elif !VALA_0_28
+ assert_not_reached ();
+#elif !VALA_0_30
+ assert_not_reached ();
+#elif !VALA_0_32
+ assert_not_reached ();
+#elif !VALA_0_34
+ assert_not_reached ();
+#elif !VALA_0_36
+ assert_not_reached ();
+#else
+ assert (true);
+#endif
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]