Skip to content

Commit 13fa0c5

Browse files
aescolarfabiobaltieri
authored andcommitted
tests/c_lib/common/src/test_sqrt: Fix code compliance issues
Fix several code compliance issues. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
1 parent 37089cf commit 13fa0c5

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

tests/lib/c_lib/common/src/test_sqrt.c

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <zephyr/kernel.h>
1010
#include <zephyr/ztest.h>
1111

12-
1312
#define local_abs(x) (((x) < 0) ? -(x) : (x))
1413

1514
#ifndef NAN
@@ -30,11 +29,11 @@ static float test_floats[] = {
3029
#define NUM_TEST_FLOATS (sizeof(test_floats)/sizeof(float))
3130

3231
static double test_doubles[] = {
33-
1.0, 2.0, 3.0, 4.0,
34-
5.0, 6.0, 7.0, 8.0, 9.0, /* numbers across the decade */
35-
3.14159265359, 2.718281828, /* irrational numbers pi and e */
36-
123.4, 0.025, 0.10, 1.875 /* numbers with infinite */
37-
/* repeating binary representationa */
32+
1.0, 2.0, 3.0, 4.0,
33+
5.0, 6.0, 7.0, 8.0, 9.0, /* numbers across the decade */
34+
3.14159265359, 2.718281828, /* irrational numbers pi and e */
35+
123.4, 0.025, 0.10, 1.875 /* numbers with infinite */
36+
/* repeating binary representationa */
3837
};
3938
#define NUM_TEST_DOUBLES (sizeof(test_floats)/sizeof(float))
4039

@@ -88,13 +87,12 @@ static int isnanf(float x)
8887

8988
ZTEST(libc_common, test_sqrtf)
9089
{
91-
int i;
92-
float exponent, resf, square, root_squared, error;
93-
uint32_t max_error;
94-
int32_t ierror;
95-
int32_t *p_square = (int32_t *)&square;
96-
int32_t *p_root_squared = (int32_t *)&root_squared;
97-
90+
int i;
91+
float exponent, resf, square, root_squared, error;
92+
uint32_t max_error;
93+
int32_t ierror;
94+
int32_t *p_square = (int32_t *)&square;
95+
int32_t *p_root_squared = (int32_t *)&root_squared;
9896

9997
max_error = 0;
10098

@@ -150,13 +148,13 @@ ZTEST(libc_common, test_sqrt)
150148
if (sizeof(double) != 8) {
151149
ztest_test_skip();
152150
}
153-
int i;
154-
double resd, error, square, root_squared, exponent;
155-
uint64_t max_error;
156-
int64_t ierror;
157-
int64_t *p_square = (int64_t *)&square;
158-
int64_t *p_root_squared = (int64_t *)&root_squared;
159151

152+
int i;
153+
double resd, error, square, root_squared, exponent;
154+
uint64_t max_error;
155+
int64_t ierror;
156+
int64_t *p_square = (int64_t *)&square;
157+
int64_t *p_root_squared = (int64_t *)&root_squared;
160158

161159
max_error = 0;
162160

0 commit comments

Comments
 (0)