Skip to content

Commit

Permalink
add tests with the imaginary part of the array infinite
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-frbg authored May 30, 2024
1 parent ad2b5c6 commit a16f824
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions utest/test_zscal.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,31 @@ CTEST(zscal, inf_i_inc_2)
ASSERT_TRUE(isinf(i[17]));
}

CTEST(zscal, i_0inf)
{
blasint N=9;
blasint incX=1;
double i[] = {0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1 };
double inf[] = {0,INFINITY, 0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY};
BLASFUNC(zscal)(&N, i, inf, &incX);
ASSERT_TRUE(isinf(inf[0]));
ASSERT_TRUE(isnan(inf[1]));
ASSERT_TRUE(isinf(inf[16]));
ASSERT_TRUE(isnan(inf[17]));
}

CTEST(zscal, i_0inf_inc_2)
{
blasint N=9;
blasint incX=2;
double i[] = {0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1 };
double inf[] = {0,INFINITY, 0,INFINITY, 0,INFINITY, 0,INFINITY, 0,INFINITY, 0,INFINITY, 0,INFINITY, 0,INFINITY, 0,INFINITY,
0,INFINITY, 0,INFINITY, 0,INFINITY, 0,INFINITY, 0,INFINITY, 0,INFINITY, 0,INFINITY, 0,INFINITY, 0,INFINITY};
BLASFUNC(zscal)(&N, i, inf, &incX);
ASSERT_TRUE(isinf(inf[0]));
ASSERT_TRUE(isnan(inf[1]));
ASSERT_TRUE(isinf(inf[16]));
ASSERT_TRUE(isnan(inf[17]));
}

#endif

0 comments on commit a16f824

Please sign in to comment.