From 5f3923250c2ab50a36d03a8d53647b0190d0da6f Mon Sep 17 00:00:00 2001 From: Martin Kojtal Date: Fri, 3 Aug 2018 10:21:11 +0100 Subject: [PATCH] crc test: manual fix cases Leave as it is for readability --- TESTS/mbed_hal/crc/main.cpp | 130 ++++++++++++++++++------------------ 1 file changed, 66 insertions(+), 64 deletions(-) diff --git a/TESTS/mbed_hal/crc/main.cpp b/TESTS/mbed_hal/crc/main.cpp index 51ecdcc962f..c233c120d60 100644 --- a/TESTS/mbed_hal/crc/main.cpp +++ b/TESTS/mbed_hal/crc/main.cpp @@ -205,73 +205,75 @@ Specification specification(greentea_test_setup, cases, greentea_test_teardown_h int main() { + // *INDENT-OFF* TEST_CASE local_test_cases[] = { /* Predefined polynomials. */ - /* 00 */{ {POLY_7BIT_SD, 7, 0x00000000, 0x00000000, false, false}, 0xEA }, - /* 01 */{ {POLY_7BIT_SD, 7, 0x0000007F, 0x00000000, false, false}, 0xA0 }, - /* 02 */{ {POLY_7BIT_SD, 7, 0x0000002B, 0x00000000, false, false}, 0x74 }, - /* 03 */{ {POLY_7BIT_SD, 7, 0x00000000, 0x0000007F, false, false}, 0x95 }, - /* 04 */{ {POLY_7BIT_SD, 7, 0x00000000, 0x0000002B, false, false}, 0xC1 }, - /* 05 */{ {POLY_7BIT_SD, 7, 0x00000000, 0x00000000, true, false}, 0xA4 }, - /* 06 */{ {POLY_7BIT_SD, 7, 0x00000000, 0x00000000, false, true }, 0x57 }, - - /* 07 */{ {POLY_8BIT_CCITT, 8, 0x00000000, 0x00000000, false, false}, 0xF4 }, - /* 08 */{ {POLY_8BIT_CCITT, 8, 0x000000FF, 0x00000000, false, false}, 0xFB }, - /* 09 */{ {POLY_8BIT_CCITT, 8, 0x000000AB, 0x00000000, false, false}, 0x87 }, - /* 10 */{ {POLY_8BIT_CCITT, 8, 0x00000000, 0x000000FF, false, false}, 0x0B }, - /* 11 */{ {POLY_8BIT_CCITT, 8, 0x00000000, 0x000000AB, false, false}, 0x5F }, - /* 12 */{ {POLY_8BIT_CCITT, 8, 0x00000000, 0x00000000, true, false}, 0x04 }, - /* 13 */{ {POLY_8BIT_CCITT, 8, 0x00000000, 0x00000000, false, true }, 0x2F }, - - /* 14 */{ {POLY_16BIT_CCITT, 16, 0x00000000, 0x00000000, false, false}, 0x31C3 }, - /* 15 */{ {POLY_16BIT_CCITT, 16, 0x0000FFFF, 0x00000000, false, false}, 0x29B1 }, - /* 16 */{ {POLY_16BIT_CCITT, 16, 0x0000ABAB, 0x00000000, false, false}, 0x7D70 }, - /* 17 */{ {POLY_16BIT_CCITT, 16, 0x00000000, 0x0000FFFF, false, false}, 0xCE3C }, - /* 18 */{ {POLY_16BIT_CCITT, 16, 0x00000000, 0x0000ABAB, false, false}, 0x9A68 }, - /* 19 */{ {POLY_16BIT_CCITT, 16, 0x00000000, 0x00000000, true, false}, 0x9184 }, - /* 20 */{ {POLY_16BIT_CCITT, 16, 0x00000000, 0x00000000, false, true }, 0xC38C }, - - /* 21 */{ {POLY_16BIT_IBM, 16, 0x00000000, 0x00000000, false, false}, 0xFEE8 }, - /* 22 */{ {POLY_16BIT_IBM, 16, 0x0000FFFF, 0x00000000, false, false}, 0xAEE7 }, - /* 23 */{ {POLY_16BIT_IBM, 16, 0x0000ABAB, 0x00000000, false, false}, 0x0887 }, - /* 24 */{ {POLY_16BIT_IBM, 16, 0x00000000, 0x0000FFFF, false, false}, 0x0117 }, - /* 25 */{ {POLY_16BIT_IBM, 16, 0x00000000, 0x0000ABAB, false, false}, 0x5543 }, - /* 26 */{ {POLY_16BIT_IBM, 16, 0x00000000, 0x00000000, true, false}, 0xBCDD }, - /* 27 */{ {POLY_16BIT_IBM, 16, 0x00000000, 0x00000000, false, true }, 0x177F }, - - /* 28 */{ {POLY_32BIT_ANSI, 32, 0x00000000, 0x00000000, false, false}, 0x89A1897F }, - /* 29 */{ {POLY_32BIT_ANSI, 32, 0xFFFFFFFF, 0x00000000, false, false}, 0x0376E6E7 }, - /* 30 */{ {POLY_32BIT_ANSI, 32, 0xABABABAB, 0x00000000, false, false}, 0x871A2FAA }, - /* 31 */{ {POLY_32BIT_ANSI, 32, 0x00000000, 0xFFFFFFFF, false, false}, 0x765E7680 }, - /* 32 */{ {POLY_32BIT_ANSI, 32, 0x00000000, 0xABABABAB, false, false}, 0x220A22D4 }, - /* 33 */{ {POLY_32BIT_ANSI, 32, 0x00000000, 0x00000000, true, false}, 0x11B4BFB4 }, - /* 34 */{ {POLY_32BIT_ANSI, 32, 0x00000000, 0x00000000, false, true }, 0xFE918591 }, - - /* Not-predefined polynomials. */ - /* 35 */{ {POLY_8BIT_MAXIM, 8, 0x00000000, 0x00000000, false, false}, 0xA2 }, - /* 36 */{ {POLY_8BIT_MAXIM, 8, 0x000000FF, 0x00000000, false, false}, 0xF7 }, - /* 37 */{ {POLY_8BIT_MAXIM, 8, 0x000000AB, 0x00000000, false, false}, 0x71 }, - /* 38 */{ {POLY_8BIT_MAXIM, 8, 0x00000000, 0x000000FF, false, false}, 0x5D }, - /* 39 */{ {POLY_8BIT_MAXIM, 8, 0x00000000, 0x000000AB, false, false}, 0x09 }, - /* 40 */{ {POLY_8BIT_MAXIM, 8, 0x00000000, 0x00000000, true, false}, 0x85 }, - /* 41 */{ {POLY_8BIT_MAXIM, 8, 0x00000000, 0x00000000, false, true }, 0x45 }, - - /* 42 */{ {POLY_16BIT_MAXIM, 16, 0x00000000, 0x00000000, false, false}, 0xFEE8 }, - /* 43 */{ {POLY_16BIT_MAXIM, 16, 0x0000FFFF, 0x00000000, false, false}, 0xAEE7 }, - /* 44 */{ {POLY_16BIT_MAXIM, 16, 0x0000ABAB, 0x00000000, false, false}, 0x0887 }, - /* 45 */{ {POLY_16BIT_MAXIM, 16, 0x00000000, 0x0000FFFF, false, false}, 0x0117 }, - /* 46 */{ {POLY_16BIT_MAXIM, 16, 0x00000000, 0x0000ABAB, false, false}, 0x5543 }, - /* 47 */{ {POLY_16BIT_MAXIM, 16, 0x00000000, 0x00000000, true, false}, 0xBCDD }, - /* 48 */{ {POLY_16BIT_MAXIM, 16, 0x00000000, 0x00000000, false, true }, 0x177F }, - - /* 49 */{ {POLY_32BIT_POSIX, 32, 0x00000000, 0x00000000, false, false}, 0x89A1897F }, - /* 50 */{ {POLY_32BIT_POSIX, 32, 0xFFFFFFFF, 0x00000000, false, false}, 0x0376E6E7 }, - /* 51 */{ {POLY_32BIT_POSIX, 32, 0xABABABAB, 0x00000000, false, false}, 0x871A2FAA }, - /* 52 */{ {POLY_32BIT_POSIX, 32, 0x00000000, 0xFFFFFFFF, false, false}, 0x765E7680 }, - /* 53 */{ {POLY_32BIT_POSIX, 32, 0x00000000, 0xABABABAB, false, false}, 0x220A22D4 }, - /* 54 */{ {POLY_32BIT_POSIX, 32, 0x00000000, 0x00000000, true, false}, 0x11B4BFB4 }, - /* 55 */{ {POLY_32BIT_POSIX, 32, 0x00000000, 0x00000000, false, true }, 0xFE918591 }, + /* 00 */{ {POLY_7BIT_SD , 7, 0x00000000, 0x00000000, false, false}, 0xEA }, + /* 01 */{ {POLY_7BIT_SD , 7, 0x0000007F, 0x00000000, false, false}, 0xA0 }, + /* 02 */{ {POLY_7BIT_SD , 7, 0x0000002B, 0x00000000, false, false}, 0x74 }, + /* 03 */{ {POLY_7BIT_SD , 7, 0x00000000, 0x0000007F, false, false}, 0x95 }, + /* 04 */{ {POLY_7BIT_SD , 7, 0x00000000, 0x0000002B, false, false}, 0xC1 }, + /* 05 */{ {POLY_7BIT_SD , 7, 0x00000000, 0x00000000, true , false}, 0xA4 }, + /* 06 */{ {POLY_7BIT_SD , 7, 0x00000000, 0x00000000, false, true }, 0x57 }, + + /* 07 */{ {POLY_8BIT_CCITT , 8, 0x00000000, 0x00000000, false, false}, 0xF4 }, + /* 08 */{ {POLY_8BIT_CCITT , 8, 0x000000FF, 0x00000000, false, false}, 0xFB }, + /* 09 */{ {POLY_8BIT_CCITT , 8, 0x000000AB, 0x00000000, false, false}, 0x87 }, + /* 10 */{ {POLY_8BIT_CCITT , 8, 0x00000000, 0x000000FF, false, false}, 0x0B }, + /* 11 */{ {POLY_8BIT_CCITT , 8, 0x00000000, 0x000000AB, false, false}, 0x5F }, + /* 12 */{ {POLY_8BIT_CCITT , 8, 0x00000000, 0x00000000, true , false}, 0x04 }, + /* 13 */{ {POLY_8BIT_CCITT , 8, 0x00000000, 0x00000000, false, true }, 0x2F }, + + /* 14 */{ {POLY_16BIT_CCITT , 16, 0x00000000, 0x00000000, false, false}, 0x31C3 }, + /* 15 */{ {POLY_16BIT_CCITT , 16, 0x0000FFFF, 0x00000000, false, false}, 0x29B1 }, + /* 16 */{ {POLY_16BIT_CCITT , 16, 0x0000ABAB, 0x00000000, false, false}, 0x7D70 }, + /* 17 */{ {POLY_16BIT_CCITT , 16, 0x00000000, 0x0000FFFF, false, false}, 0xCE3C }, + /* 18 */{ {POLY_16BIT_CCITT , 16, 0x00000000, 0x0000ABAB, false, false}, 0x9A68 }, + /* 19 */{ {POLY_16BIT_CCITT , 16, 0x00000000, 0x00000000, true , false}, 0x9184 }, + /* 20 */{ {POLY_16BIT_CCITT , 16, 0x00000000, 0x00000000, false, true }, 0xC38C }, + + /* 21 */{ {POLY_16BIT_IBM , 16, 0x00000000, 0x00000000, false, false}, 0xFEE8 }, + /* 22 */{ {POLY_16BIT_IBM , 16, 0x0000FFFF, 0x00000000, false, false}, 0xAEE7 }, + /* 23 */{ {POLY_16BIT_IBM , 16, 0x0000ABAB, 0x00000000, false, false}, 0x0887 }, + /* 24 */{ {POLY_16BIT_IBM , 16, 0x00000000, 0x0000FFFF, false, false}, 0x0117 }, + /* 25 */{ {POLY_16BIT_IBM , 16, 0x00000000, 0x0000ABAB, false, false}, 0x5543 }, + /* 26 */{ {POLY_16BIT_IBM , 16, 0x00000000, 0x00000000, true , false}, 0xBCDD }, + /* 27 */{ {POLY_16BIT_IBM , 16, 0x00000000, 0x00000000, false, true }, 0x177F }, + + /* 28 */{ {POLY_32BIT_ANSI , 32, 0x00000000, 0x00000000, false, false}, 0x89A1897F }, + /* 29 */{ {POLY_32BIT_ANSI , 32, 0xFFFFFFFF, 0x00000000, false, false}, 0x0376E6E7 }, + /* 30 */{ {POLY_32BIT_ANSI , 32, 0xABABABAB, 0x00000000, false, false}, 0x871A2FAA }, + /* 31 */{ {POLY_32BIT_ANSI , 32, 0x00000000, 0xFFFFFFFF, false, false}, 0x765E7680 }, + /* 32 */{ {POLY_32BIT_ANSI , 32, 0x00000000, 0xABABABAB, false, false}, 0x220A22D4 }, + /* 33 */{ {POLY_32BIT_ANSI , 32, 0x00000000, 0x00000000, true , false}, 0x11B4BFB4 }, + /* 34 */{ {POLY_32BIT_ANSI , 32, 0x00000000, 0x00000000, false, true }, 0xFE918591 }, + + /* Not-predefined polynomials. */ + /* 35 */{ {POLY_8BIT_MAXIM , 8, 0x00000000, 0x00000000, false, false}, 0xA2 }, + /* 36 */{ {POLY_8BIT_MAXIM , 8, 0x000000FF, 0x00000000, false, false}, 0xF7 }, + /* 37 */{ {POLY_8BIT_MAXIM , 8, 0x000000AB, 0x00000000, false, false}, 0x71 }, + /* 38 */{ {POLY_8BIT_MAXIM , 8, 0x00000000, 0x000000FF, false, false}, 0x5D }, + /* 39 */{ {POLY_8BIT_MAXIM , 8, 0x00000000, 0x000000AB, false, false}, 0x09 }, + /* 40 */{ {POLY_8BIT_MAXIM , 8, 0x00000000, 0x00000000, true , false}, 0x85 }, + /* 41 */{ {POLY_8BIT_MAXIM , 8, 0x00000000, 0x00000000, false, true }, 0x45 }, + + /* 42 */{ {POLY_16BIT_MAXIM , 16, 0x00000000, 0x00000000, false, false}, 0xFEE8 }, + /* 43 */{ {POLY_16BIT_MAXIM , 16, 0x0000FFFF, 0x00000000, false, false}, 0xAEE7 }, + /* 44 */{ {POLY_16BIT_MAXIM , 16, 0x0000ABAB, 0x00000000, false, false}, 0x0887 }, + /* 45 */{ {POLY_16BIT_MAXIM , 16, 0x00000000, 0x0000FFFF, false, false}, 0x0117 }, + /* 46 */{ {POLY_16BIT_MAXIM , 16, 0x00000000, 0x0000ABAB, false, false}, 0x5543 }, + /* 47 */{ {POLY_16BIT_MAXIM , 16, 0x00000000, 0x00000000, true , false}, 0xBCDD }, + /* 48 */{ {POLY_16BIT_MAXIM , 16, 0x00000000, 0x00000000, false, true }, 0x177F }, + + /* 49 */{ {POLY_32BIT_POSIX , 32, 0x00000000, 0x00000000, false, false}, 0x89A1897F }, + /* 50 */{ {POLY_32BIT_POSIX , 32, 0xFFFFFFFF, 0x00000000, false, false}, 0x0376E6E7 }, + /* 51 */{ {POLY_32BIT_POSIX , 32, 0xABABABAB, 0x00000000, false, false}, 0x871A2FAA }, + /* 52 */{ {POLY_32BIT_POSIX , 32, 0x00000000, 0xFFFFFFFF, false, false}, 0x765E7680 }, + /* 53 */{ {POLY_32BIT_POSIX , 32, 0x00000000, 0xABABABAB, false, false}, 0x220A22D4 }, + /* 54 */{ {POLY_32BIT_POSIX , 32, 0x00000000, 0x00000000, true , false}, 0x11B4BFB4 }, + /* 55 */{ {POLY_32BIT_POSIX , 32, 0x00000000, 0x00000000, false, true }, 0xFE918591 }, }; + // *INDENT-ON* test_cases = local_test_cases; test_cases_size = sizeof(local_test_cases);