]> Cypherpunks repositories - gostls13.git/commit
io: correctly compute call depth in test
authorDavid Lazar <lazard@golang.org>
Tue, 18 Apr 2017 19:12:54 +0000 (15:12 -0400)
committerDavid Lazar <lazard@golang.org>
Tue, 18 Apr 2017 19:56:54 +0000 (19:56 +0000)
commit46ecac99fb83c3e9ea0d817839c7136ef74d3d10
treeb4dea673cac15e8ffa9ceadd2edef5d17961bba5
parent17137fae2e9abed50a1e6499f0a2fffedc6f0256
io: correctly compute call depth in test

TestMultiReaderFlatten determines the call depth by counting PCs
returned by runtime.Callers. With inlining, this is incorrect because
a PC can represent multiple calls. Furthermore, runtime.Callers might
return an additional "skip" PC, which does not represent a real call.
This modifies the test to use CallersFrames to determine the call depth.
Now the test passes with -l=4.

Change-Id: I284f3b1e0b2d194bd08c230c616914503e5a370d
Reviewed-on: https://go-review.googlesource.com/40990
Run-TryBot: David Lazar <lazard@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/io/multi_test.go