~laney/ubuntu/quantal/swig2.0/guile-2.0

« back to all changes in this revision

Viewing changes to Examples/test-suite/go/li_cmalloc_runme.go

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Landschoff
  • Date: 2010-12-19 18:25:59 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101219182559-8lh77o66bo890jwo
Tags: 2.0.1-1
* Merge new upstream release 2.0.1.
* Remove dependency on quilt and usage in debian/rules, the new source
  format will take care of that.
* Remove patch fix-cleaning.diff (applied upstream).
* Remove patch keep_docs.diff (applied upstream).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package main
 
2
 
 
3
import . "./li_cmalloc"
 
4
 
 
5
func main() {
 
6
        p := Malloc_int()
 
7
        Free_int(p)
 
8
 
 
9
        ok := false
 
10
        func() {
 
11
                defer func() {
 
12
                        if recover() != nil {
 
13
                                ok = true
 
14
                        }
 
15
                }()
 
16
                p = Calloc_int(-1)
 
17
                if p == nil {
 
18
                        ok = true
 
19
                }
 
20
                Free_int(p)
 
21
        }()
 
22
        if !ok {
 
23
                panic(0)
 
24
        }
 
25
}