]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add default defines test for VALA_0_XX and GLIB_2_XX e3e098f4f389ce857e5ac9099d170869d3ff9973
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 24 Nov 2018 21:43:21 +0000 (22:43 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 24 Nov 2018 21:57:42 +0000 (22:57 +0100)
tests/Makefile.am
tests/parser/preprocessor-glib.vala [new file with mode: 0644]
tests/parser/preprocessor-vala.vala [new file with mode: 0644]

index 7caf2d461b377b619e5aad8dd7c049130f9a0976..1a8ed5ec1ae8b366a3f5422354d83911cf67bc71 100644 (file)
@@ -480,6 +480,8 @@ TESTS = \
        parser/namespaces.vala \
        parser/namespace-missing-bracket.test \
        parser/preprocessor.vala \
+       parser/preprocessor-glib.vala \
+       parser/preprocessor-vala.vala \
        parser/property-default-redefined.test \
        parser/property-get-must-have-body.test \
        parser/property-get-redefined.test \
diff --git a/tests/parser/preprocessor-glib.vala b/tests/parser/preprocessor-glib.vala
new file mode 100644 (file)
index 0000000..ee44f45
--- /dev/null
@@ -0,0 +1,33 @@
+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 ();
+#elif !GLIB_2_34
+       assert_not_reached ();
+#elif !GLIB_2_36
+       assert_not_reached ();
+#elif !GLIB_2_38
+       assert_not_reached ();
+#elif !GLIB_2_40
+       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 (file)
index 0000000..7e0b098
--- /dev/null
@@ -0,0 +1,49 @@
+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 ();
+#elif !VALA_0_38
+       assert_not_reached ();
+#elif !VALA_0_40
+       assert_not_reached ();
+#elif !VALA_0_42
+       assert_not_reached ();
+#elif !VALA_0_44
+       assert_not_reached ();
+#else
+       assert (true);
+#endif
+}