1
0
mirror of https://github.com/golang/go synced 2024-11-18 11:24:41 -07:00

debug/pe: removed search for specific import name in test

It was suggested to search for the "EngMulDiv"
import for "atmfd.dll" in order to prove that
ImportedSymbols actually works. Unfortunately
not all instances of "atmfd.dll" actually import
the "EngMulDiv" symbol as shown by TryBots.

This essentially reverts 83d8179235.

src/debug/pe/file_test.go: removed symbolname from test
This commit is contained in:
Ali Rizvi-Santiago 2018-05-18 13:46:19 -05:00
parent 82e6a28ddf
commit ce8077cb15

View File

@ -538,14 +538,10 @@ func TestImportTableInUnknownSection(t *testing.T) {
t.Skip("skipping windows only test")
}
// driver and symbol to look for
const Filename = "atmfd.dll"
const Symbol = "EngMulDiv"
// first we need to find this font driver
path, err := exec.LookPath(Filename)
path, err := exec.LookPath("atmfd.dll")
if err != nil {
t.Fatalf("unable to locate required file (%s) in search path: %s", Filename, err)
t.Fatalf("unable to locate required file %q in search path: %s", "atmfd.dll", err)
}
f, err := Open(path)
@ -554,23 +550,13 @@ func TestImportTableInUnknownSection(t *testing.T) {
}
defer f.Close()
// now we can extract its imports
symbols, err := f.ImportedSymbols()
if err != nil {
t.Error(err)
}
if len(symbols) == 0 {
t.Fatalf("unable to locate any imported symbols within file %s", path)
}
found := false
for _, s := range symbols {
if s == "EngMulDiv" {
found = true
}
}
if !found {
t.Fatalf("unable to locate expected symbol (%s) within file %s", Symbol, path)
t.Fatalf("unable to locate any imported symbols within file %q.", path)
}
}