1
0
mirror of https://github.com/gluster/glusterd2.git synced 2026-02-06 15:46:00 +01:00
Files
glusterd2/tests/assert.go
Krishnan Parthasarathi 545e8df1a7 fixed lint issues in 72a7aa4
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
2015-09-23 14:40:16 +05:30

23 lines
444 B
Go

// Package tests borrows Assert() from https://github.com/heketi/heketi
package tests
import (
"runtime"
"testing"
)
// Assert provides a simple assert call for unit and functional tests
func Assert(t *testing.T, b bool) {
if !b {
pc, file, line, _ := runtime.Caller(1)
callFuncInfo := runtime.FuncForPC(pc)
t.Errorf("\n\rASSERT:\tfunc (%s) 0x%x\n\r\tFile %s:%d",
callFuncInfo.Name(),
pc,
file,
line)
t.FailNow()
}
}