diff options
author | zelig <viktor.tron@gmail.com> | 2015-03-24 05:34:05 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-03-27 03:00:18 +0800 |
commit | 859f1f08ca48de99408c825eba8d6ed4bfea3235 (patch) | |
tree | 416f928afbaf0333d76ea8d5f08ea5ef030d1287 /blockpool/test/util.go | |
parent | c4ea921876b0535022882c568b5cc6b0269db7d4 (diff) | |
download | dexon-859f1f08ca48de99408c825eba8d6ed4bfea3235.tar dexon-859f1f08ca48de99408c825eba8d6ed4bfea3235.tar.gz dexon-859f1f08ca48de99408c825eba8d6ed4bfea3235.tar.bz2 dexon-859f1f08ca48de99408c825eba8d6ed4bfea3235.tar.lz dexon-859f1f08ca48de99408c825eba8d6ed4bfea3235.tar.xz dexon-859f1f08ca48de99408c825eba8d6ed4bfea3235.tar.zst dexon-859f1f08ca48de99408c825eba8d6ed4bfea3235.zip |
blockpool: wrap intermittent status test in a loop
Diffstat (limited to 'blockpool/test/util.go')
-rw-r--r-- | blockpool/test/util.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/blockpool/test/util.go b/blockpool/test/util.go index 0349493c3..930601278 100644 --- a/blockpool/test/util.go +++ b/blockpool/test/util.go @@ -10,16 +10,20 @@ import ( func CheckInt(name string, got int, expected int, t *testing.T) (err error) { if got != expected { - t.Errorf("status for %v incorrect. expected %v, got %v", name, expected, got) - err = fmt.Errorf("") + err = fmt.Errorf("status for %v incorrect. expected %v, got %v", name, expected, got) + if t != nil { + t.Error(err) + } } return } func CheckDuration(name string, got time.Duration, expected time.Duration, t *testing.T) (err error) { if got != expected { - t.Errorf("status for %v incorrect. expected %v, got %v", name, expected, got) - err = fmt.Errorf("") + err = fmt.Errorf("status for %v incorrect. expected %v, got %v", name, expected, got) + if t != nil { + t.Error(err) + } } return } |