mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
cleanup: Adds t.Helper() to test helper function
This commit adds t.Helper() to the test helper function. With this call go test prints correct lines of code for failed tests. Otherwise, printed lines will be inside helpers functions. For more details check: https://github.com/kulti/thelper Updates: #1586 Signed-off-by: Yati Padia <ypadia@redhat.com>
This commit is contained in:
parent
84c1fe52c7
commit
f35ce3d880
@ -24,12 +24,14 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func checkError(t *testing.T, msg string, err error) {
|
func checkError(t *testing.T, msg string, err error) {
|
||||||
|
t.Helper()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Errorf(msg)
|
t.Errorf(msg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkAndReportError(t *testing.T, msg string, err error) {
|
func checkAndReportError(t *testing.T, msg string, err error) {
|
||||||
|
t.Helper()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("%s (%v)", msg, err)
|
t.Errorf("%s (%v)", msg, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user