]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "delete" test to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 28 Apr 2021 19:33:10 +0000 (21:33 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 28 Apr 2021 20:01:49 +0000 (22:01 +0200)
tests/Makefile.am
tests/pointers/delete.vala [new file with mode: 0644]

index 684546e44868796e2cd6b20b79c3bb246027307b..16cd7303bb32f2188d0875de32c0fb5bee2b112c 100644 (file)
@@ -158,6 +158,7 @@ TESTS = \
        chainup/struct-this.vala \
        chainup/struct-this-foo.vala \
        chainup/bug791785.vala \
+       pointers/delete.vala \
        pointers/bug590641.vala \
        methods/array-length-type.vala \
        methods/lambda.vala \
diff --git a/tests/pointers/delete.vala b/tests/pointers/delete.vala
new file mode 100644 (file)
index 0000000..f19dd85
--- /dev/null
@@ -0,0 +1,16 @@
+class Foo {
+}
+
+class Bar : Foo {
+}
+
+void main () {
+       {
+               Foo* foo = new Foo ();
+               delete foo;
+       }
+       {
+               Bar* bar = new Bar ();
+               delete bar;
+       }
+}