@@ -54,7 +54,7 @@ void crc_is_supported_test()
5454 uint32_t num_of_supported_polynomials = 0 ;
5555
5656 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 ) ) {
5858
5959 num_of_supported_polynomials++;
6060 }
@@ -68,7 +68,7 @@ void crc_is_supported_test()
6868void crc_calc_single_test ()
6969{
7070 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 ) ) {
7272
7373 hal_crc_compute_partial_start (&test_cases[i].config_data );
7474 hal_crc_compute_partial ((uint8_t *) input_data, strlen ((const char *) input_data));
@@ -84,7 +84,7 @@ void crc_calc_single_test()
8484void crc_calc_multi_test ()
8585{
8686 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 ) ) {
8888
8989 const uint32_t first_part_bytes = 3 ;
9090 const uint32_t second_part_bytes = 1 ;
@@ -117,7 +117,7 @@ void crc_reconfigure_test()
117117 for (unsigned int i = 0 ; i < (test_cases_size / sizeof (TEST_CASE)); i++) {
118118
119119 /* 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 ) ) {
121121 if (pol_cnt == 0 ) {
122122 pol_idx[pol_cnt] = i;
123123 pol_cnt++;
@@ -159,7 +159,7 @@ void crc_compute_partial_invalid_param_test()
159159
160160 /* At least one polynomial must be supported. */
161161 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 ) ) {
163163
164164 hal_crc_compute_partial_start (&test_cases[i].config_data );
165165
@@ -180,19 +180,12 @@ void crc_compute_partial_invalid_param_test()
180180 }
181181}
182182
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-
189183Case cases[] = {
190184 Case (" test: supported polynomials." , crc_is_supported_test),
191185 Case (" test: CRC calculation - single input." , crc_calc_single_test),
192186 Case (" test: CRC calculation - multi input." , crc_calc_multi_test),
193187 Case (" test: re-configure without getting the result." , crc_reconfigure_test),
194188 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),
196189};
197190
198191utest::v1::status_t greentea_test_setup (const size_t number_of_cases)
@@ -208,12 +201,12 @@ int main()
208201 // *INDENT-OFF*
209202 TEST_CASE local_test_cases[] = {
210203 /* 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 },
217210 /* 06 */ { {POLY_7BIT_SD , 7 , 0x00000000 , 0x00000000 , false , true }, 0x57 },
218211
219212 /* 07 */ { {POLY_8BIT_CCITT , 8 , 0x00000000 , 0x00000000 , false , false }, 0xF4 },
0 commit comments