@@ -54,7 +54,7 @@ void crc_is_supported_test()
54
54
uint32_t num_of_supported_polynomials = 0 ;
55
55
56
56
for (unsigned int i = 0 ; i < (test_cases_size / sizeof (TEST_CASE)); i++) {
57
- if (hal_crc_is_supported (& test_cases[i].config_data ) == true ) {
57
+ if (HAL_CRC_IS_SUPPORTED ( test_cases[i].config_data . polynomial , test_cases[i]. config_data . width ) ) {
58
58
59
59
num_of_supported_polynomials++;
60
60
}
@@ -68,7 +68,7 @@ void crc_is_supported_test()
68
68
void crc_calc_single_test ()
69
69
{
70
70
for (unsigned int i = 0 ; i < (test_cases_size / sizeof (TEST_CASE)); i++) {
71
- if (hal_crc_is_supported (& test_cases[i].config_data ) == true ) {
71
+ if (HAL_CRC_IS_SUPPORTED ( test_cases[i].config_data . polynomial , test_cases[i]. config_data . width ) ) {
72
72
73
73
hal_crc_compute_partial_start (&test_cases[i].config_data );
74
74
hal_crc_compute_partial ((uint8_t *) input_data, strlen ((const char *) input_data));
@@ -84,7 +84,7 @@ void crc_calc_single_test()
84
84
void crc_calc_multi_test ()
85
85
{
86
86
for (unsigned int i = 0 ; i < (test_cases_size / sizeof (TEST_CASE)); i++) {
87
- if (hal_crc_is_supported (& test_cases[i].config_data ) == true ) {
87
+ if (HAL_CRC_IS_SUPPORTED ( test_cases[i].config_data . polynomial , test_cases[i]. config_data . width ) ) {
88
88
89
89
const uint32_t first_part_bytes = 3 ;
90
90
const uint32_t second_part_bytes = 1 ;
@@ -117,7 +117,7 @@ void crc_reconfigure_test()
117
117
for (unsigned int i = 0 ; i < (test_cases_size / sizeof (TEST_CASE)); i++) {
118
118
119
119
/* Find two supported polynomials if possible. */
120
- if (hal_crc_is_supported (& test_cases[i].config_data ) == true ) {
120
+ if (HAL_CRC_IS_SUPPORTED ( test_cases[i].config_data . polynomial , test_cases[i]. config_data . width ) ) {
121
121
if (pol_cnt == 0 ) {
122
122
pol_idx[pol_cnt] = i;
123
123
pol_cnt++;
@@ -159,7 +159,7 @@ void crc_compute_partial_invalid_param_test()
159
159
160
160
/* At least one polynomial must be supported. */
161
161
for (unsigned int i = 0 ; i < (test_cases_size / sizeof (TEST_CASE)); i++) {
162
- if (hal_crc_is_supported (& test_cases[i].config_data ) == true ) {
162
+ if (HAL_CRC_IS_SUPPORTED ( test_cases[i].config_data . polynomial , test_cases[i]. config_data . width ) ) {
163
163
164
164
hal_crc_compute_partial_start (&test_cases[i].config_data );
165
165
@@ -180,19 +180,12 @@ void crc_compute_partial_invalid_param_test()
180
180
}
181
181
}
182
182
183
- /* Test that hal_crc_is_supported() returns false if pointer to the config structure is undefined. */
184
- void crc_is_supported_invalid_param_test ()
185
- {
186
- TEST_ASSERT_EQUAL (false , hal_crc_is_supported (NULL ));
187
- }
188
-
189
183
Case cases[] = {
190
184
Case (" test: supported polynomials." , crc_is_supported_test),
191
185
Case (" test: CRC calculation - single input." , crc_calc_single_test),
192
186
Case (" test: CRC calculation - multi input." , crc_calc_multi_test),
193
187
Case (" test: re-configure without getting the result." , crc_reconfigure_test),
194
188
Case (" test: hal_crc_compute_partial() - invalid parameters." , crc_compute_partial_invalid_param_test),
195
- Case (" test: hal_crc_is_supported() - invalid parameter." , crc_is_supported_invalid_param_test),
196
189
};
197
190
198
191
utest::v1::status_t greentea_test_setup (const size_t number_of_cases)
@@ -208,12 +201,12 @@ int main()
208
201
// *INDENT-OFF*
209
202
TEST_CASE local_test_cases[] = {
210
203
/* Predefined polynomials. */
211
- /* 00 */ { {POLY_7BIT_SD , 7 , 0x00000000 , 0x00000000 , false , false }, 0xEA },
212
- /* 01 */ { {POLY_7BIT_SD , 7 , 0x0000007F , 0x00000000 , false , false }, 0xA0 },
213
- /* 02 */ { {POLY_7BIT_SD , 7 , 0x0000002B , 0x00000000 , false , false }, 0x74 },
214
- /* 03 */ { {POLY_7BIT_SD , 7 , 0x00000000 , 0x0000007F , false , false }, 0x95 },
215
- /* 04 */ { {POLY_7BIT_SD , 7 , 0x00000000 , 0x0000002B , false , false }, 0xC1 },
216
- /* 05 */ { {POLY_7BIT_SD , 7 , 0x00000000 , 0x00000000 , true , false }, 0xA4 },
204
+ /* 00 */ { {POLY_7BIT_SD , 7 , 0x00000000 , 0x00000000 , false , false }, 0x75 },
205
+ /* 01 */ { {POLY_7BIT_SD , 7 , 0x0000007F , 0x00000000 , false , false }, 0x50 },
206
+ /* 02 */ { {POLY_7BIT_SD , 7 , 0x0000002B , 0x00000000 , false , false }, 0x3A },
207
+ /* 03 */ { {POLY_7BIT_SD , 7 , 0x00000000 , 0x0000007F , false , false }, 0x0A },
208
+ /* 04 */ { {POLY_7BIT_SD , 7 , 0x00000000 , 0x0000002B , false , false }, 0x5E },
209
+ /* 05 */ { {POLY_7BIT_SD , 7 , 0x00000000 , 0x00000000 , true , false }, 0x52 },
217
210
/* 06 */ { {POLY_7BIT_SD , 7 , 0x00000000 , 0x00000000 , false , true }, 0x57 },
218
211
219
212
/* 07 */ { {POLY_8BIT_CCITT , 8 , 0x00000000 , 0x00000000 , false , false }, 0xF4 },
0 commit comments