Skip to content

Commit 225a3bf

Browse files
theamirocohenYossi Levy
authored andcommitted
Erase debug prints
1 parent 1f4405c commit 225a3bf

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

TESTS/mbed_hal/trng/main.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,33 +134,28 @@ static void compress_and_compare(char *key, char *value)
134134
TEST_ASSERT_EQUAL(0, result);
135135

136136
/*pithy_Compress will try to compress the random data, if it succeeded it means the data is not really random*/
137-
if (strcmp(key, MSG_TRNG_TEST_STEP1) == 0) {
138-
139-
printf("\n***TRNG_TEST_STEP1***\n trng_get_bytes for buffer size %d\n", sizeof(buffer));
137+
if (strcmp(key, MSG_TRNG_TEST_STEP2) == 0) {
140138

141139
comp_sz = pithy_Compress((char *)buffer,
142140
sizeof(buffer),
143141
(char *)out_comp_buf,
144142
sizeof(out_comp_buf),
145143
9);
146-
TEST_ASSERT(comp_sz > sizeof(buffer));
147-
148-
} else if (strcmp(key, MSG_TRNG_TEST_STEP2) == 0) {
144+
TEST_ASSERT_MESSAGE(comp_sz > sizeof(buffer),
145+
"TRNG_TEST_STEP1: trng_get_bytes was able to compressed thus not random");
149146

150147
/*pithy_Compress will try to compress the random data with a different buffer sizem*/
151148
result = fill_buffer_trng(temp_buf, &trng_obj, sizeof(temp_buf));
152149
TEST_ASSERT_EQUAL(0, result);
153150

154-
printf("\n***TRNG_TEST_STEP2***\n trng_get_bytes for buffer size %d\n", sizeof(temp_buf));
155-
156151
comp_sz = pithy_Compress((char *)temp_buf,
157152
sizeof(temp_buf),
158153
(char *)out_comp_buf,
159154
sizeof(out_comp_buf),
160155
9);
161-
TEST_ASSERT(comp_sz > sizeof(temp_buf));
156+
TEST_ASSERT_MESSAGE(comp_sz > sizeof(temp_buf),
157+
"TRNG_TEST_STEP2: trng_get_bytes was able to compressed thus not random");
162158

163-
printf("\n***TRNG_TEST_STEP3***\n compression of concatenated buffer after reset\n");
164159
memcpy(input_buf + sizeof(buffer), temp_buf, sizeof(temp_buf));
165160

166161
/*pithy_Compress will try to compress the random data from before reset concatenated with new random data*/
@@ -169,7 +164,8 @@ static void compress_and_compare(char *key, char *value)
169164
(char *)out_comp_buf,
170165
sizeof(out_comp_buf),
171166
9);
172-
TEST_ASSERT(comp_sz > sizeof(temp_buf) + sizeof(buffer));
167+
TEST_ASSERT_MESSAGE(comp_sz > sizeof(temp_buf) + sizeof(buffer),
168+
"TRNG_TEST_STEP3: concatenated buffer after reset was able to compressed thus not random");
173169
}
174170

175171
/*At the end of step 1 store trng buffer and reset the device*/

0 commit comments

Comments
 (0)