From ce8077cb154f18ada7a86e152ab03de813937816 Mon Sep 17 00:00:00 2001 From: Ali Rizvi-Santiago Date: Fri, 18 May 2018 13:46:19 -0500 Subject: [PATCH] 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 83d8179235db9f6df9af4852bed5bad87c43808b. src/debug/pe/file_test.go: removed symbolname from test --- src/debug/pe/file_test.go | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/debug/pe/file_test.go b/src/debug/pe/file_test.go index 47775d0927..24cd673254 100644 --- a/src/debug/pe/file_test.go +++ b/src/debug/pe/file_test.go @@ -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) } }