From 44acb7503e0826122bf11dd900aca7b39a6d56d4 Mon Sep 17 00:00:00 2001 From: Xianyi Zhang Date: Wed, 2 Mar 2011 18:03:40 +0800 Subject: [PATCH] Added zdotu with x & y offset=1 test case. --- utest/common_utest.h | 1 + utest/main.c | 2 ++ utest/test_dotu.c | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/utest/common_utest.h b/utest/common_utest.h index 613003307..3e9ecb422 100644 --- a/utest/common_utest.h +++ b/utest/common_utest.h @@ -55,5 +55,6 @@ void test_saxpy_inc_0(void); void test_caxpy_inc_0(void); void test_zdotu_n_1(void); +void test_zdotu_offset_1(void); #endif diff --git a/utest/main.c b/utest/main.c index c6fbd48e2..f6ecf3cc0 100644 --- a/utest/main.c +++ b/utest/main.c @@ -53,6 +53,8 @@ CU_TestInfo test_level1[]={ {"Testing zaxpy with incx || incy == 0",test_zaxpy_inc_0}, {"Testing zdotu with n == 1",test_zdotu_n_1}, + {"Testing zdotu with input x & y offset == 1",test_zdotu_offset_1}, + CU_TEST_INFO_NULL, }; diff --git a/utest/test_dotu.c b/utest/test_dotu.c index bb720c85a..60bb3a6da 100644 --- a/utest/test_dotu.c +++ b/utest/test_dotu.c @@ -53,4 +53,23 @@ void test_zdotu_n_1(void) } +void test_zdotu_offset_1(void) +{ + int N=1,incX=1,incY=1; + double x1[]={1.0,2.0,3.0,4.0}; + double y1[]={5.0,6.0,7.0,8.0}; + double x2[]={1.0,2.0,3.0,4.0}; + double y2[]={5.0,6.0,7.0,8.0}; + double _Complex result1=0.0; + double _Complex result2=0.0; + //OpenBLAS + result1=BLASFUNC(zdotu)(&N,x1+1,&incX,y1+1,&incY); + //reference + result2=BLASFUNC_REF(zdotu)(&N,x2+1,&incX,y2+1,&incY); + + CU_ASSERT_DOUBLE_EQUAL(creal(result1), creal(result2), CHECK_EPS); + CU_ASSERT_DOUBLE_EQUAL(cimag(result1), cimag(result2), CHECK_EPS); +// printf("\%lf,%lf\n",creal(result1),cimag(result1)); + +}