Skip to content

Commit

Permalink
blas/testblas: use subtests in Ztbmv test
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-ch committed Apr 25, 2018
1 parent 0802470 commit 368b432
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions blas/testblas/ztbmv.go
Expand Up @@ -27,7 +27,10 @@ func ZtbmvTest(t *testing.T, impl Ztbmver) {
for k := 0; k < n; k++ {
for _, ldab := range []int{k + 1, k + 1 + 10} {
for _, incX := range []int{-4, 1, 5} {
testZtbmv(t, impl, rnd, uplo, trans, diag, n, k, ldab, incX)
name := fmt.Sprintf("uplo=%v,trans=%v,diag=%v,n=%v,k=%v,ldab=%v,incX=%v", uplo, trans, diag, n, k, ldab, incX)
t.Run(name, func(t *testing.T) {
testZtbmv(t, impl, rnd, uplo, trans, diag, n, k, ldab, incX)
})
}
}
}
Expand Down Expand Up @@ -90,14 +93,13 @@ func testZtbmv(t *testing.T, impl Ztbmver, rnd *rand.Rand, uplo blas.Uplo, trans
impl.Ztrmv(uplo, trans, diag, n, a, lda, want, incX)
impl.Ztbmv(uplo, trans, diag, n, k, ab, ldab, x, incX)

prefix := fmt.Sprintf("Case uplo=%v,trans=%v,diag=%v,n=%v,k=%v,incX=%v,ldab=%v", uplo, trans, diag, n, k, incX, ldab)
if !zsame(ab, abCopy) {
t.Errorf("%v: unexpected modification of ab", prefix)
t.Errorf("unexpected modification of ab")
}
if !zSameAtNonstrided(x, want, incX) {
t.Errorf("%v: unexpected modification of x", prefix)
t.Errorf("unexpected modification of x")
}
if !zEqualApproxAtStrided(x, want, incX, tol) {
t.Errorf("%v: unexpected result\nwant %v\ngot %v", prefix, want, x)
t.Errorf("unexpected result\nwant %v\ngot %v", want, x)
}
}

0 comments on commit 368b432

Please sign in to comment.