-typedef struct {
- const char *case_name;
- int num;
- const TESTDATA *data;
-} SIMPLE_FIXTURE;
-
-/**********************************************************************
- *
- * Test of mdc2 internal functions
- *
- ***/
-
-static SIMPLE_FIXTURE setup_mdc2(const char *const test_case_name)
-{
- SIMPLE_FIXTURE fixture;
- fixture.case_name = test_case_name;
- return fixture;
-}
-
-static int execute_mdc2(SIMPLE_FIXTURE fixture)
-{
- unsigned char md[MDC2_DIGEST_LENGTH];
- MDC2_CTX c;
-
- MDC2_Init(&c);
- MDC2_Update(&c, (const unsigned char *)fixture.data->input,
- strlen(fixture.data->input));
- MDC2_Final(&(md[0]), &c);
-
- if (memcmp(fixture.data->expected, md, MDC2_DIGEST_LENGTH)) {
- fprintf(stderr, "mdc2 test %d: unexpected output\n", fixture.num);
- return 0;
- }
-
- return 1;
-}
-
-static void teardown_mdc2(SIMPLE_FIXTURE fixture)
-{
- ERR_print_errors_fp(stderr);
-}