From b883526a34ff49e43b9d719da64e2db47fbe7f5c Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sat, 13 Apr 2024 12:26:35 +0200 Subject: [PATCH] Fix uninitialized variables in the extensions utest --- utest/test_extensions/test_damin.c | 2 +- utest/test_extensions/test_dsum.c | 4 +++- utest/test_extensions/test_dzsum.c | 4 +++- utest/test_extensions/test_scsum.c | 4 +++- utest/test_extensions/test_ssum.c | 4 +++- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/utest/test_extensions/test_damin.c b/utest/test_extensions/test_damin.c index 736921fa3b..50bc5a928e 100644 --- a/utest/test_extensions/test_damin.c +++ b/utest/test_extensions/test_damin.c @@ -351,4 +351,4 @@ CTEST(damin, negative_step_2_N_70){ double amin = BLASFUNC(damin)(&N, x, &inc); ASSERT_DBL_NEAR_TOL(1.0, amin, DOUBLE_EPS); } -#endif \ No newline at end of file +#endif diff --git a/utest/test_extensions/test_dsum.c b/utest/test_extensions/test_dsum.c index e987c5a42a..304619d0a9 100644 --- a/utest/test_extensions/test_dsum.c +++ b/utest/test_extensions/test_dsum.c @@ -62,6 +62,7 @@ CTEST(dsum, step_zero){ blasint i; blasint N = ELEMENTS, inc = 0; double x[ELEMENTS]; + x[0]=0.; for (i = 0; i < N * inc; i ++) { x[i] = i + 1000; } @@ -243,6 +244,7 @@ CTEST(dsum, c_api_step_zero){ blasint i; blasint N = ELEMENTS, inc = 0; double x[ELEMENTS]; + x[0]=0.; for (i = 0; i < N * inc; i ++) { x[i] = i + 1000; } @@ -400,4 +402,4 @@ CTEST(dsum, c_api_step_2_N_50){ double sum = cblas_dsum(N, x, inc); ASSERT_DBL_NEAR_TOL(50.0, sum, DOUBLE_EPS); } -#endif \ No newline at end of file +#endif diff --git a/utest/test_extensions/test_dzsum.c b/utest/test_extensions/test_dzsum.c index 5139f59cbf..a184ad9475 100644 --- a/utest/test_extensions/test_dzsum.c +++ b/utest/test_extensions/test_dzsum.c @@ -62,6 +62,7 @@ CTEST(dzsum, step_zero){ blasint i; blasint N = ELEMENTS, inc = 0; double x[ELEMENTS]; + x[0] = 0.0; for (i = 0; i < N * inc * 2; i ++) { x[i] = i + 1000; } @@ -243,6 +244,7 @@ CTEST(dzsum, c_api_step_zero){ blasint i; blasint N = ELEMENTS, inc = 0; double x[ELEMENTS]; + x[0] = 0.0; for (i = 0; i < N * inc * 2; i ++) { x[i] = i + 1000; } @@ -400,4 +402,4 @@ CTEST(dzsum, c_api_step_2_N_50){ double sum = cblas_dzsum(N, x, inc); ASSERT_DBL_NEAR_TOL(0.0, sum, DOUBLE_EPS); } -#endif \ No newline at end of file +#endif diff --git a/utest/test_extensions/test_scsum.c b/utest/test_extensions/test_scsum.c index 492e1a4ca1..8e943de229 100644 --- a/utest/test_extensions/test_scsum.c +++ b/utest/test_extensions/test_scsum.c @@ -62,6 +62,7 @@ CTEST(scsum, step_zero){ blasint i; blasint N = ELEMENTS, inc = 0; float x[ELEMENTS]; + x[0] = 0.0f; for (i = 0; i < N * inc * 2; i ++) { x[i] = i + 1000; } @@ -243,6 +244,7 @@ CTEST(scsum, c_api_step_zero){ blasint i; blasint N = ELEMENTS, inc = 0; float x[ELEMENTS]; + x[0] = 0.0f; for (i = 0; i < N * inc * 2; i ++) { x[i] = i + 1000; } @@ -400,4 +402,4 @@ CTEST(scsum, c_api_step_2_N_50){ float sum = cblas_scsum(N, x, inc); ASSERT_DBL_NEAR_TOL(0.0f, sum, SINGLE_EPS); } -#endif \ No newline at end of file +#endif diff --git a/utest/test_extensions/test_ssum.c b/utest/test_extensions/test_ssum.c index 971a0d2e07..9c5e297286 100644 --- a/utest/test_extensions/test_ssum.c +++ b/utest/test_extensions/test_ssum.c @@ -62,6 +62,7 @@ CTEST(ssum, step_zero){ blasint i; blasint N = ELEMENTS, inc = 0; float x[ELEMENTS]; + x[0] = 0.0f; for (i = 0; i < N * inc; i ++) { x[i] = i + 1000; } @@ -243,6 +244,7 @@ CTEST(ssum, c_api_step_zero){ blasint i; blasint N = ELEMENTS, inc = 0; float x[ELEMENTS]; + x[0] = 0.0f; for (i = 0; i < N * inc; i ++) { x[i] = i + 1000; } @@ -400,4 +402,4 @@ CTEST(ssum, c_api_step_2_N_50){ float sum = cblas_ssum(N, x, inc); ASSERT_DBL_NEAR_TOL(50.0f, sum, SINGLE_EPS); } -#endif \ No newline at end of file +#endif