~ubuntu-branches/ubuntu/maverick/vala/maverick

« back to all changes in this revision

Viewing changes to tests/errors/bug567181.vala

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-02-13 17:59:22 UTC
  • mfrom: (7.3.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100213175922-n8bq2xv2q1hihhqb
Tags: 0.7.10-1ubuntu1
* Sync with Debian unstable.
* Remaining changes :
 - debian/rules: Don't make unit test failures fatal to fix FTBFS. It was
   needed if vala need to enter main but it's not the case for now. 
   (See #374151)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
GLib.List<Foo> list;
 
2
 
 
3
errordomain Error {
 
4
        FOOBAR,
 
5
}
 
6
 
 
7
class Foo : Object {
 
8
        public Foo () throws Error {
 
9
                list.append (this);
 
10
                throw new Error.FOOBAR ("foo");
 
11
        }
 
12
}
 
13
 
 
14
void main () {
 
15
        Foo foo = null;
 
16
        list = new List<Foo> ();
 
17
        try {
 
18
                foo = new Foo ();
 
19
        } catch (Error err) {
 
20
        }
 
21
        assert (foo == null);
 
22
        /* There should be only 1 ref in the list */
 
23
        assert (list.nth_data (0).ref_count == 1);
 
24
}