Skip to content

Commit c5041ae

Browse files
authored
properly embed test_dnrm2
1 parent 8e6f719 commit c5041ae

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

utest/utest_main2.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,38 @@ CTEST(dsdot,dsdot_n_1)
369369

370370
}
371371

372+
#if defined(BUILD_DOUBLE)
373+
CTEST(dnrm2,dnrm2_inf)
374+
{
375+
#ifndef INFINITY
376+
#define INFINITY HUGE_VAL
377+
#endif
378+
int i;
379+
double x[29];
380+
blasint incx=1;
381+
blasint n=28;
382+
double res1=0.0f, res2=INFINITY;
383+
384+
for (i=0;i<n;i++)x[i]=0.0f;
385+
x[10]=-INFINITY;
386+
res1=BLASFUNC(dnrm2)(&n, x, &incx);
387+
ASSERT_DBL_NEAR_TOL(res2, res1, DOUBLE_EPS);
388+
389+
}
390+
CTEST(dnrm2,dnrm2_tiny)
391+
{
392+
int i;
393+
double x[29];
394+
blasint incx=1;
395+
blasint n=28;
396+
double res1=0.0f, res2=0.0f;
397+
398+
for (i=0;i<n;i++)x[i]=7.457008414e-310;
399+
res1=BLASFUNC(dnrm2)(&n, x, &incx);
400+
ASSERT_DBL_NEAR_TOL(res2, res1, DOUBLE_EPS);
401+
}
402+
#endif
403+
372404
CTEST(rot,drot_inc_0)
373405
{
374406
blasint i=0;
@@ -606,6 +638,7 @@ int main(int argc, const char ** argv){
606638
CTEST_ADD (zdotu,zdotu_n_1);
607639
CTEST_ADD (zdotu,zdotu_offset_1);
608640
CTEST_ADD (dsdot,dsdot_n_1);
641+
CTEST_ADD (dnrm2,dnrm2_inf);
609642
CTEST_ADD (dnrm2,dnrm2_tiny);
610643
CTEST_ADD (rot,drot_inc_0);
611644
CTEST_ADD (rot,zdrot_inc_0);

0 commit comments

Comments
 (0)