From afbe3c97914ad15f2c83d2fd02005c794a37135b Mon Sep 17 00:00:00 2001 From: Xianyi Zhang Date: Mon, 21 Feb 2011 00:42:46 +0800 Subject: [PATCH] =?utf8?q?Improved=20the=20quality=20of=20codes=20in=20uni?= =?utf8?q?t=20test.=20Thanks=20Jos=C3=A9=20Luis=20Garc=C3=ADa=20Pallero?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- common_reference.h | 22 +++++++++++----------- utest/common_utest.h | 8 ++++---- utest/main.c | 24 ++++++++++++------------ utest/test_rot.c | 20 ++++++++++---------- utest/test_swap.c | 37 +++++++++++++++++-------------------- 5 files changed, 54 insertions(+), 57 deletions(-) diff --git a/common_reference.h b/common_reference.h index 4bc46bc..27a27a6 100644 --- a/common_reference.h +++ b/common_reference.h @@ -43,16 +43,16 @@ void BLASFUNC_REF(csrot) (blasint *, float *, blasint *, float *, blasint *, void BLASFUNC_REF(zdrot) (blasint *, double *, blasint *, double *, blasint *, double *, double *); void BLASFUNC_REF(xqrot) (blasint *, xdouble *, blasint *, xdouble *, blasint *, xdouble *, xdouble *); -void BLASFUNC_REF(sswap) (blasint *, float *, blasint *, float *, blasint *); -void BLASFUNC_REF(dswap) (blasint *, double *, blasint *, double *, blasint *); -void BLASFUNC_REF(qswap) (blasint *, xdouble *, blasint *, xdouble *, blasint *); -void BLASFUNC_REF(cswap) (blasint *, float *, blasint *, float *, blasint *); -void BLASFUNC_REF(zswap) (blasint *, double *, blasint *, double *, blasint *); -void BLASFUNC_REF(xswap) (blasint *, xdouble *, blasint *, xdouble *, blasint *); - -void BLASFUNC_REF(saxpy) (blasint *, float *, float *, blasint *, float *, blasint *); -void BLASFUNC_REF(daxpy) (blasint *, double *, double *, blasint *, double *, blasint *); -void BLASFUNC_REF(caxpy) (blasint *, float *, float *, blasint *, float *, blasint *); -void BLASFUNC_REF(zaxpy) (blasint *, double *, double *, blasint *, double *, blasint *); +void BLASFUNC_REF(sswap) (blasint *, float *, blasint *, float *, blasint *); +void BLASFUNC_REF(dswap) (blasint *, double *, blasint *, double *, blasint *); +void BLASFUNC_REF(qswap) (blasint *, xdouble *, blasint *, xdouble *, blasint *); +void BLASFUNC_REF(cswap) (blasint *, float *, blasint *, float *, blasint *); +void BLASFUNC_REF(zswap) (blasint *, double *, blasint *, double *, blasint *); +void BLASFUNC_REF(xswap) (blasint *, xdouble *, blasint *, xdouble *, blasint *); + +void BLASFUNC_REF(saxpy) (blasint *, float *, float *, blasint *, float *, blasint *); +void BLASFUNC_REF(daxpy) (blasint *, double *, double *, blasint *, double *, blasint *); +void BLASFUNC_REF(caxpy) (blasint *, float *, float *, blasint *, float *, blasint *); +void BLASFUNC_REF(zaxpy) (blasint *, double *, double *, blasint *, double *, blasint *); #endif diff --git a/utest/common_utest.h b/utest/common_utest.h index f4fc728..43c7f7f 100644 --- a/utest/common_utest.h +++ b/utest/common_utest.h @@ -39,10 +39,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define CHECK_EPS 0.00002 //Testcase list -void test_drot_incx_0(void); -void test_srot_incx_0(void); -void test_zdrot_incx_0(void); -void test_csrot_incx_0(void); +void test_drot_inc_0(void); +void test_srot_inc_0(void); +void test_zdrot_inc_0(void); +void test_csrot_inc_0(void); void test_dswap_inc_0(void); void test_zswap_inc_0(void); diff --git a/utest/main.c b/utest/main.c index eddf1ce..ef4232d 100644 --- a/utest/main.c +++ b/utest/main.c @@ -37,20 +37,20 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include CU_TestInfo test_level1[]={ - {"Testing srot when incx & incy == 0",test_srot_incx_0}, - {"Testing drot when incx & incy == 0",test_drot_incx_0}, - {"Testing csrot when incx & incy == 0",test_csrot_incx_0}, - {"Testing zdrot when incx & incy == 0",test_zdrot_incx_0}, + {"Testing srot when incx || incy == 0",test_srot_inc_0}, + {"Testing drot when incx || incy == 0",test_drot_inc_0}, + {"Testing csrot when incx || incy == 0",test_csrot_inc_0}, + {"Testing zdrot when incx || incy == 0",test_zdrot_inc_0}, - {"Testing sswap with incx & incy == 0",test_sswap_inc_0}, - {"Testing dswap with incx & incy == 0",test_dswap_inc_0}, - {"Testing cswap with incx & incy == 0",test_cswap_inc_0}, - {"Testing zswap with incx & incy == 0",test_zswap_inc_0}, + {"Testing sswap with incx || incy == 0",test_sswap_inc_0}, + {"Testing dswap with incx || incy == 0",test_dswap_inc_0}, + {"Testing cswap with incx || incy == 0",test_cswap_inc_0}, + {"Testing zswap with incx || incy == 0",test_zswap_inc_0}, - {"Testing saxpy with incx & incy == 0",test_saxpy_inc_0}, - {"Testing daxpy with incx & incy == 0",test_daxpy_inc_0}, - {"Testing caxpy with incx & incy == 0",test_caxpy_inc_0}, - {"Testing zaxpy with incx & incy == 0",test_zaxpy_inc_0}, + {"Testing saxpy with incx || incy == 0",test_saxpy_inc_0}, + {"Testing daxpy with incx || incy == 0",test_daxpy_inc_0}, + {"Testing caxpy with incx || incy == 0",test_caxpy_inc_0}, + {"Testing zaxpy with incx || incy == 0",test_zaxpy_inc_0}, CU_TEST_INFO_NULL, }; diff --git a/utest/test_rot.c b/utest/test_rot.c index 18a2bbd..f5332d4 100644 --- a/utest/test_rot.c +++ b/utest/test_rot.c @@ -32,9 +32,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "common_utest.h" -void test_drot_incx_0(void) +void test_drot_inc_0(void) { - int i; + int i=0; int N=4,incX=0,incY=0; double c=0.25,s=0.5; double x1[]={1.0,3.0,5.0,7.0}; @@ -53,9 +53,9 @@ void test_drot_incx_0(void) } } -void test_zdrot_incx_0(void) +void test_zdrot_inc_0(void) { - int i; + int i=0; int N=4,incX=0,incY=0; double c=0.25,s=0.5; double x1[]={1.0,3.0,5.0,7.0,1.0,3.0,5.0,7.0}; @@ -68,15 +68,15 @@ void test_zdrot_incx_0(void) //reference BLASFUNC_REF(zdrot)(&N,x2,&incX,y2,&incY,&c,&s); - for(i=0; i