check_aec.h 914 Bytes
Newer Older
1
#ifndef CHECK_AEC_H
2
#define CHECK_AEC_H 1
3 4 5
#include "libaec.h"

struct test_state {
6
    int (* codec)(struct test_state *state);
7
    int id;
8
    int id_len;
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
9
    int bytes_per_sample;
10 11 12 13 14 15 16 17
    unsigned char *ubuf;
    unsigned char *cbuf;
    unsigned char *obuf;
    size_t ibuf_len; /* input buffer legth may be shorter than buf_len */
    size_t buf_len;
    size_t cbuf_len;
    long long int xmax;
    long long int xmin;
18
    void (*out)(unsigned char *dest, unsigned long long int val, int size);
19
    int dump; /* dump buffer to file for fuzzing corpus */
20 21 22 23
    struct aec_stream *strm;
};

int update_state(struct test_state *state);
24
int encode_decode_small(struct test_state *state);
25
int encode_decode_large(struct test_state *state);
26

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
27 28 29 30
#ifdef _WIN32
#define CHECK_PASS "PASS"
#define CHECK_FAIL "FAIL"
#else
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
31 32
#define CHECK_PASS "PASS"
#define CHECK_FAIL "FAIL"
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
33
#endif
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
34

35
#endif /* CHECK_AEC_H */