Fix transposition of expected and computed values in error message
authorMartin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Sat, 3 Mar 2018 17:01:51 +0000 (18:01 +0100)
committerGitHub <noreply@github.com>
Sat, 3 Mar 2018 17:01:51 +0000 (18:01 +0100)
utest/test_axpy.c
utest/test_dotu.c
utest/test_dsdot.c
utest/test_rot.c
utest/test_swap.c

index 7837553..6030430 100644 (file)
@@ -48,8 +48,8 @@ CTEST(axpy,daxpy_inc_0)
        BLASFUNC(daxpy)(&N,&a,x1,&incX,y1,&incY);
 
        for(i=0; i<N; i++){
-               ASSERT_DBL_NEAR_TOL(x1[i], x2[i], DOUBLE_EPS);
-               ASSERT_DBL_NEAR_TOL(y1[i], y2[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(x2[i], x1[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(y2[i], y1[i], DOUBLE_EPS);
        }
 }
 
@@ -67,8 +67,8 @@ CTEST(axpy,zaxpy_inc_0)
        BLASFUNC(zaxpy)(&N,a,x1,&incX,y1,&incY);
 
        for(i=0; i<2*N; i++){
-               ASSERT_DBL_NEAR_TOL(x1[i], x2[i], DOUBLE_EPS);
-               ASSERT_DBL_NEAR_TOL(y1[i], y2[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(x2[i], x1[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(y2[i], y1[i], DOUBLE_EPS);
        }
 }
 
@@ -86,8 +86,8 @@ CTEST(axpy,saxpy_inc_0)
        BLASFUNC(saxpy)(&N,&a,x1,&incX,y1,&incY);
 
        for(i=0; i<N; i++){
-               ASSERT_DBL_NEAR_TOL(x1[i], x2[i], DOUBLE_EPS);
-               ASSERT_DBL_NEAR_TOL(y1[i], y2[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(x2[i], x1[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(y2[i], y1[i], DOUBLE_EPS);
        }
 }
 
@@ -105,7 +105,7 @@ CTEST(axpy,caxpy_inc_0)
        BLASFUNC(caxpy)(&N,a,x1,&incX,y1,&incY);
 
        for(i=0; i<2*N; i++){
-               ASSERT_DBL_NEAR_TOL(x1[i], x2[i], DOUBLE_EPS);
-               ASSERT_DBL_NEAR_TOL(y1[i], y2[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(x2[i], x1[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(y2[i], y1[i], DOUBLE_EPS);
        }
 }
index 37441a2..ef04dd9 100644 (file)
@@ -33,7 +33,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include "openblas_utest.h"
 #include <complex.h>
-#include <stdio.h>
 
 CTEST( zdotu,zdotu_n_1)
 {
@@ -50,11 +49,11 @@ CTEST( zdotu,zdotu_n_1)
 #endif
        
 #ifdef OPENBLAS_COMPLEX_STRUCT
-       ASSERT_DBL_NEAR_TOL(result1.real, result2.real, DOUBLE_EPS);
-       ASSERT_DBL_NEAR_TOL(result1.imag, result2.imag, DOUBLE_EPS);
+       ASSERT_DBL_NEAR_TOL(result2.real, result1.real, DOUBLE_EPS);
+       ASSERT_DBL_NEAR_TOL(result2.imag, result1.imag, DOUBLE_EPS);
 #else
-       ASSERT_DBL_NEAR_TOL(creal(result1), creal(result2), DOUBLE_EPS);
-       ASSERT_DBL_NEAR_TOL(cimag(result1), cimag(result2), DOUBLE_EPS);
+       ASSERT_DBL_NEAR_TOL(creal(result2), creal(result1), DOUBLE_EPS);
+       ASSERT_DBL_NEAR_TOL(cimag(result2), cimag(result1), DOUBLE_EPS);
 #endif
        
 }
@@ -74,11 +73,11 @@ CTEST(zdotu, zdotu_offset_1)
 #endif
        
 #ifdef OPENBLAS_COMPLEX_STRUCT
-       ASSERT_DBL_NEAR_TOL(result1.real, result2.real, DOUBLE_EPS);
-       ASSERT_DBL_NEAR_TOL(result1.imag, result2.imag, DOUBLE_EPS);
+       ASSERT_DBL_NEAR_TOL(result2.real, result1.real, DOUBLE_EPS);
+       ASSERT_DBL_NEAR_TOL(result2.imag, result1.imag, DOUBLE_EPS);
 #else
-       ASSERT_DBL_NEAR_TOL(creal(result1), creal(result2), DOUBLE_EPS);
-       ASSERT_DBL_NEAR_TOL(cimag(result1), cimag(result2), DOUBLE_EPS);
+       ASSERT_DBL_NEAR_TOL(creal(result2), creal(result1), DOUBLE_EPS);
+       ASSERT_DBL_NEAR_TOL(cimag(result2), cimag(result1), DOUBLE_EPS);
 #endif
 
 }
index 7d082a3..d58b398 100644 (file)
@@ -44,6 +44,6 @@ CTEST(dsdot,dsdot_n_1)
        double res1=0.0f, res2=-0.00239335360107;
 
        res1=BLASFUNC(dsdot)(&n, &x, &incx, &y, &incy);
-       ASSERT_DBL_NEAR_TOL(res1, res2, DOUBLE_EPS);
+       ASSERT_DBL_NEAR_TOL(res2, res1, DOUBLE_EPS);
 
 }
index 2a47b80..cf72ad2 100644 (file)
@@ -48,8 +48,8 @@ CTEST(rot,drot_inc_0)
        BLASFUNC(drot)(&N,x1,&incX,y1,&incY,&c,&s);
 
        for(i=0; i<N; i++){
-               ASSERT_DBL_NEAR_TOL(x1[i], x2[i], DOUBLE_EPS);
-               ASSERT_DBL_NEAR_TOL(y1[i], y2[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(x2[i], x1[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(y2[i], y1[i], DOUBLE_EPS);
        }
 }
 
@@ -68,8 +68,8 @@ CTEST(rot,zdrot_inc_0)
        BLASFUNC(zdrot)(&N,x1,&incX,y1,&incY,&c,&s);
 
        for(i=0; i<2*N; i++){
-               ASSERT_DBL_NEAR_TOL(x1[i], x2[i], DOUBLE_EPS);
-               ASSERT_DBL_NEAR_TOL(y1[i], y2[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(x2[i], x1[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(y2[i], y1[i], DOUBLE_EPS);
        }
 }
 
@@ -87,8 +87,8 @@ CTEST(rot,srot_inc_0)
        BLASFUNC(srot)(&N,x1,&incX,y1,&incY,&c,&s);
 
        for(i=0; i<N; i++){
-               ASSERT_DBL_NEAR_TOL(x1[i], x2[i], SINGLE_EPS);
-               ASSERT_DBL_NEAR_TOL(y1[i], y2[i], SINGLE_EPS);
+               ASSERT_DBL_NEAR_TOL(x2[i], x1[i], SINGLE_EPS);
+               ASSERT_DBL_NEAR_TOL(y2[i], y1[i], SINGLE_EPS);
        }
 }
 
@@ -106,7 +106,7 @@ CTEST(rot, csrot_inc_0)
        BLASFUNC(csrot)(&N,x1,&incX,y1,&incY,&c,&s);
 
        for(i=0; i<2*N; i++){
-               ASSERT_DBL_NEAR_TOL(x1[i], x2[i], SINGLE_EPS);
-               ASSERT_DBL_NEAR_TOL(y1[i], y2[i], SINGLE_EPS);
+               ASSERT_DBL_NEAR_TOL(x2[i], x1[i], SINGLE_EPS);
+               ASSERT_DBL_NEAR_TOL(y2[i], y1[i], SINGLE_EPS);
        }
 }
index 2f8b68e..259c83a 100644 (file)
@@ -46,8 +46,8 @@ CTEST(swap,dswap_inc_0)
        BLASFUNC(dswap)(&N,x1,&incX,y1,&incY);
 
        for(i=0; i<N; i++){
-               ASSERT_DBL_NEAR_TOL(x1[i], x2[i], DOUBLE_EPS);
-               ASSERT_DBL_NEAR_TOL(y1[i], y2[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(x2[i], x1[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(y2[i], y1[i], DOUBLE_EPS);
        }
 }
 
@@ -64,8 +64,8 @@ CTEST(swap,zswap_inc_0)
        BLASFUNC(zswap)(&N,x1,&incX,y1,&incY);
 
        for(i=0; i<2*N; i++){
-               ASSERT_DBL_NEAR_TOL(x1[i], x2[i], DOUBLE_EPS);
-               ASSERT_DBL_NEAR_TOL(y1[i], y2[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(x2[i], x1[i], DOUBLE_EPS);
+               ASSERT_DBL_NEAR_TOL(y2[i], y1[i], DOUBLE_EPS);
        }
 }
 
@@ -82,8 +82,8 @@ CTEST(swap,sswap_inc_0)
        BLASFUNC(sswap)(&N,x1,&incX,y1,&incY);
 
        for(i=0; i<N; i++){
-               ASSERT_DBL_NEAR_TOL(x1[i], x2[i], SINGLE_EPS);
-               ASSERT_DBL_NEAR_TOL(y1[i], y2[i], SINGLE_EPS);
+               ASSERT_DBL_NEAR_TOL(x2[i], x1[i], SINGLE_EPS);
+               ASSERT_DBL_NEAR_TOL(y2[i], y1[i], SINGLE_EPS);
        }
 }
 
@@ -100,7 +100,7 @@ CTEST(swap,cswap_inc_0)
        BLASFUNC(cswap)(&N,x1,&incX,y1,&incY);
 
        for(i=0; i<2*N; i++){
-               ASSERT_DBL_NEAR_TOL(x1[i], x2[i], SINGLE_EPS);
-               ASSERT_DBL_NEAR_TOL(y1[i], y2[i], SINGLE_EPS);
+               ASSERT_DBL_NEAR_TOL(x2[i], x1[i], SINGLE_EPS);
+               ASSERT_DBL_NEAR_TOL(y2[i], y1[i], SINGLE_EPS);
        }
 }