[vala/staging] tests: Add invalid "target/destroy access" tests to increase coverage



commit 59e5d31b9edc399b968f0e2af6bb1a653f5b1242
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Oct 18 09:02:33 2021 +0200

    tests: Add invalid "target/destroy access" tests to increase coverage

 tests/Makefile.am                                   | 2 ++
 tests/semantic/delegate-access-destroy-invalid.test | 9 +++++++++
 tests/semantic/delegate-access-target-invalid.test  | 9 +++++++++
 3 files changed, 20 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2541eb97f..904ae9739 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1002,6 +1002,8 @@ TESTS = \
        semantic/creation-method-errordomain.test \
        semantic/creation-method-interface.test \
        semantic/creation-method-namespace.test \
+       semantic/delegate-access-destroy-invalid.test \
+       semantic/delegate-access-target-invalid.test \
        semantic/delegate-error-accessibility.test \
        semantic/delegate-return-valist.test \
        semantic/delegate-too-few-type-arguments.test \
diff --git a/tests/semantic/delegate-access-destroy-invalid.test 
b/tests/semantic/delegate-access-destroy-invalid.test
new file mode 100644
index 000000000..207d12873
--- /dev/null
+++ b/tests/semantic/delegate-access-destroy-invalid.test
@@ -0,0 +1,9 @@
+Invalid Code
+
+[CCode (has_target = false)]
+delegate void Foo ();
+
+void main () {
+       Foo foo = null;
+       var d = foo.destroy;
+}
diff --git a/tests/semantic/delegate-access-target-invalid.test 
b/tests/semantic/delegate-access-target-invalid.test
new file mode 100644
index 000000000..054186c0f
--- /dev/null
+++ b/tests/semantic/delegate-access-target-invalid.test
@@ -0,0 +1,9 @@
+Invalid Code
+
+[CCode (has_target = false)]
+delegate void Foo ();
+
+void main () {
+       Foo foo = null;
+       var t = foo.target;
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]