diff --git a/cmd/eofdump/parse_test.go b/cmd/eofdump/parse_test.go index 7256d7ab4c..f492d99df6 100644 --- a/cmd/eofdump/parse_test.go +++ b/cmd/eofdump/parse_test.go @@ -69,7 +69,7 @@ func TestEofParseRegular(t *testing.T) { func testEofParse(t *testing.T, isInitCode bool, wantFile string) { var wantFn func() string - + var wantLoc = 0 { // Configure the want-reader wants, err := os.Open(wantFile) if err != nil { @@ -79,6 +79,7 @@ func testEofParse(t *testing.T, isInitCode bool, wantFile string) { scanner.Buffer(make([]byte, 1024), 10*1024*1024) wantFn = func() string { if scanner.Scan() { + wantLoc++ return scanner.Text() } return "end of file reached" @@ -119,8 +120,8 @@ func testEofParse(t *testing.T, isInitCode bool, wantFile string) { if len(b) > 100 { b = b[:100] } - t.Fatalf("%v:%d\ninput %x\nisInit: %v\nhave: %q\nwant: %q\n", - fname, line, b, isInitCode, have, want) + t.Fatalf("%v:%d\n%v\ninput %x\nisInit: %v\nhave: %q\nwant: %q\n", + fname, line, fmt.Sprintf("%v:%d", wantFile, wantLoc), b, isInitCode, have, want) } } line++ diff --git a/cmd/eofdump/testdata/results.initcode.txt b/cmd/eofdump/testdata/results.initcode.txt index 1e96de84d1..f60b983e56 100644 --- a/cmd/eofdump/testdata/results.initcode.txt +++ b/cmd/eofdump/testdata/results.initcode.txt @@ -1841,7 +1841,7 @@ ERR: initcode contains a RETURN or STOP opcode ERR: invalid magic: want ef00 in sub container 0 ERR: initcode contains a RETURN or STOP opcode ERR: initcode contains a RETURN or STOP opcode -ERR: missing data header: found section 0 instead in sub container 0 +ERR: invalid container section size: total container count must not be zero in sub container 0 ERR: initcode contains a RETURN or STOP opcode ERR: invalid magic: want ef00 in sub container 0 ERR: missing code header: found section kind 80 instead in sub container 0 @@ -2025,7 +2025,7 @@ ERR: initcode contains a RETURN or STOP opcode ERR: eofcreate with truncated section: container 0, have 4, claimed 0, pos 8 ERR: stack limit reached 1087 (1024): at pos 1022 ERR: invalid number of outputs: at pos 0 -ERR: invalid number of outputs: have 128, want 7, at pos 9 +ERR: Invalid non-returning flag, bad RETF: at pos 9 ERR: initcode contains a RETURN or STOP opcode ERR: initcode contains a RETURN or STOP opcode ERR: missing code header: found section kind 30 instead diff --git a/cmd/eofdump/testdata/results.regular.txt b/cmd/eofdump/testdata/results.regular.txt index 5b754adafe..10c4f52436 100644 --- a/cmd/eofdump/testdata/results.regular.txt +++ b/cmd/eofdump/testdata/results.regular.txt @@ -1750,24 +1750,24 @@ ERR: invalid number of outputs: at pos 7 OK OK OK -ERR: invalid section argument: arg 2, last 4, pos 7 -ERR: invalid section argument: arg 2, last 4, pos 7 -ERR: invalid section argument: arg 2, last 4, pos 7 -ERR: invalid section argument: arg 2, last 4, pos 7 OK -ERR: invalid section argument: arg 2, last 4, pos 9 -ERR: invalid section argument: arg 2, last 4, pos 9 -ERR: invalid section argument: arg 2, last 4, pos 11 +ERR: invalid number of outputs: arg 2, last 4, pos 7 +ERR: invalid number of outputs: arg 2, last 4, pos 7 +ERR: invalid number of outputs: arg 2, last 4, pos 7 +OK +ERR: invalid number of outputs: arg 2, last 4, pos 9 +ERR: invalid number of outputs: arg 2, last 4, pos 9 +OK +OK +OK +ERR: invalid number of outputs: arg 2, last 4, pos 11 OK OK -ERR: invalid section argument: arg 2, last 4, pos 11 OK -ERR: invalid section argument: arg 2, last 4, pos 15 OK OK OK OK -ERR: invalid section argument: arg 2, last 4, pos 261 OK OK ERR: invalid code size: mismatch of code sections found and type signatures, types 25, code 1 @@ -1841,7 +1841,7 @@ ERR: invalid code termination: end with ADDRESS, pos 7 ERR: invalid magic: want ef00 in sub container 0 ERR: undefined instruction: op opcode 0xea not defined, pos 4 ERR: stack underflow (1 <=> 2): at pos 1 -ERR: missing data header: found section 0 instead in sub container 0 +ERR: invalid container section size: total container count must not be zero in sub container 0 ERR: invalid max stack height in code section 0: have 4, want 260 ERR: invalid container size: have 49114, want 49108 ERR: invalid container size: have 49111, want 49108 @@ -1958,7 +1958,7 @@ ERR: invalid max stack height in code section 0: have 3, want 2 ERR: stack underflow (0 <=> 10): at pos 609 ERR: stack underflow (0 <=> 2): at pos 664 ERR: invalid jump destination: out-of-bounds offset: offset -7968, dest -7531, pos 435 -ERR: invalid number of outputs: have 128, want 835, at pos 899 +ERR: Invalid non-returning flag, bad RETF: at pos 899 ERR: invalid jump destination: out-of-bounds offset: offset -6401, dest -5227, pos 662 ERR: invalid jump destination: out-of-bounds offset: offset -6401, dest -5227, pos 662 ERR: invalid jump destination: out-of-bounds offset: offset -6401, dest -5227, pos 662 @@ -2025,9 +2025,9 @@ ERR: stack underflow (0 <=> 48): at pos 0 ERR: invalid container size: have 24, want 20 in sub container 0 ERR: stack limit reached 1087 (1024): at pos 1022 ERR: invalid number of outputs: at pos 0 -ERR: invalid number of outputs: have 128, want 7, at pos 9 -ERR: invalid section argument: arg 2, last 4, pos 7 -ERR: invalid section argument: arg 2, last 4, pos 7 +ERR: Invalid non-returning flag, bad RETF: at pos 9 +ERR: Invalid non-returning flag, bad RETF no RETF or qualified JUMPF +ERR: invalid number of outputs: arg 2, last 4, pos 7 ERR: missing code header: found section kind 30 instead ERR: missing code header: found section kind 30 instead ERR: missing code header: found section kind 30 instead