Skip to content

Commit

Permalink
crc test: manual fix cases
Browse files Browse the repository at this point in the history
Leave as it is for readability
  • Loading branch information
0xc0170 committed Aug 3, 2018
1 parent e52bb68 commit 5f39232
Showing 1 changed file with 66 additions and 64 deletions.
130 changes: 66 additions & 64 deletions TESTS/mbed_hal/crc/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5f39232

Please sign in to comment.