@@ -134,33 +134,28 @@ static void compress_and_compare(char *key, char *value)
134
134
TEST_ASSERT_EQUAL (0 , result);
135
135
136
136
/* 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 ) {
140
138
141
139
comp_sz = pithy_Compress ((char *)buffer,
142
140
sizeof (buffer),
143
141
(char *)out_comp_buf,
144
142
sizeof (out_comp_buf),
145
143
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" );
149
146
150
147
/* pithy_Compress will try to compress the random data with a different buffer sizem*/
151
148
result = fill_buffer_trng (temp_buf, &trng_obj, sizeof (temp_buf));
152
149
TEST_ASSERT_EQUAL (0 , result);
153
150
154
- printf (" \n ***TRNG_TEST_STEP2***\n trng_get_bytes for buffer size %d\n " , sizeof (temp_buf));
155
-
156
151
comp_sz = pithy_Compress ((char *)temp_buf,
157
152
sizeof (temp_buf),
158
153
(char *)out_comp_buf,
159
154
sizeof (out_comp_buf),
160
155
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" );
162
158
163
- printf (" \n ***TRNG_TEST_STEP3***\n compression of concatenated buffer after reset\n " );
164
159
memcpy (input_buf + sizeof (buffer), temp_buf, sizeof (temp_buf));
165
160
166
161
/* 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)
169
164
(char *)out_comp_buf,
170
165
sizeof (out_comp_buf),
171
166
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" );
173
169
}
174
170
175
171
/* At the end of step 1 store trng buffer and reset the device*/
0 commit comments