~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/debug/gosym/pclntab_test.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
        return true
53
53
}
54
54
 
 
55
func endtest() {
 
56
        if pclineTempDir != "" {
 
57
                os.RemoveAll(pclineTempDir)
 
58
                pclineTempDir = ""
 
59
                pclinetestBinary = ""
 
60
        }
 
61
}
 
62
 
55
63
func getTable(t *testing.T) *Table {
56
64
        f, tab := crack(os.Args[0], t)
57
65
        f.Close()
95
103
        if !dotest() {
96
104
                return
97
105
        }
 
106
        defer endtest()
98
107
 
99
108
        tab := getTable(t)
100
109
 
129
138
                if !ok {
130
139
                        t.Errorf("file %s starts on line %d", path, line)
131
140
                } else if line != ll+1 {
132
 
                        t.Errorf("expected next line of file %s to be %d, got %d", path, ll+1, line)
 
141
                        t.Fatalf("expected next line of file %s to be %d, got %d", path, ll+1, line)
133
142
                }
134
143
                lastline[path] = line
135
144
        }
142
151
        if !dotest() {
143
152
                return
144
153
        }
 
154
        defer endtest()
145
155
 
146
156
        tab := getTable(t)
147
157
 
183
193
        if !dotest() {
184
194
                return
185
195
        }
186
 
        defer os.RemoveAll(pclineTempDir)
 
196
        defer endtest()
187
197
 
188
198
        f, tab := crack(pclinetestBinary, t)
189
199
        text := f.Section(".text")