File: t_helpers.c

package info (click to toggle)
codec2 1.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 121,056 kB
  • sloc: ansic: 414,118; sh: 2,612; objc: 2,574; python: 2,105; cpp: 2,091; asm: 683; makefile: 598
file content (38 lines) | stat: -rw-r--r-- 713 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "t_helpers.h"

void test(char * tfn)
{
    fn = tfn;
    printf("========================================\n");
    printf("test function: %s\n", fn);
    printf("========================================\n");
}

void test_failed()
{
    printf("Failed to calculate %s.\n", fn);
    exit(1);
}

void test_failed_s(char * expected, char * res)
{

    printf("Failed to calculate %s.\n", fn);

    printf("expected: %s\ngot: %s\n", expected, res);
    exit(1);
}

void test_failed_f(float expected, float res)
{

    printf("Failed to calculate %s.\n", fn);
    printf("expected: %f\ngot: %f\n", expected, res);
    exit(1);
}