[vala] Add test for throwing errors from catch clauses
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Add test for throwing errors from catch clauses
- Date: Fri, 21 Jan 2011 17:33:28 +0000 (UTC)
commit 7a0babe08ac1ee351ef1e71e1efee37d7988380a
Author: Luca Bruno <lucabru src gnome org>
Date: Fri Jan 21 18:31:07 2011 +0100
Add test for throwing errors from catch clauses
tests/Makefile.am | 1 +
tests/errors/bug639589.vala | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a36720c..63d0c9d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -77,6 +77,7 @@ TESTS = \
errors/bug579101.vala \
errors/bug596228.vala \
errors/bug623049.vala \
+ errors/bug639589.vala \
asynchronous/bug595735.vala \
asynchronous/bug595755.vala \
asynchronous/bug596177.vala \
diff --git a/tests/errors/bug639589.vala b/tests/errors/bug639589.vala
new file mode 100644
index 0000000..a88bb0a
--- /dev/null
+++ b/tests/errors/bug639589.vala
@@ -0,0 +1,18 @@
+void foo () throws Error {
+ var bar = new Object ();
+ try
+ {
+ throw new FileError.EXIST ("");
+ } catch (Error e) {
+ throw e;
+ } finally {
+ bar.set_data ("foo", "bar");
+ }
+}
+
+void main() {
+ try {
+ foo ();
+ } catch (Error e) {
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]