Commit 9e44ed90 authored by Mathis Rosenhauer's avatar Mathis Rosenhauer

check long fs

parent 12a94f75
AUTOMAKE_OPTIONS = color-tests
AM_CPPFLAGS = -I$(top_srcdir)/src
TESTS = check_code_options check_buffer_sizes sampledata.sh
TESTS = check_code_options check_buffer_sizes check_long_fs sampledata.sh
check_LTLIBRARIES = libcheck_aec.la
libcheck_aec_la_SOURCES = check_aec.c check_aec.h
check_PROGRAMS = check_code_options check_buffer_sizes
check_PROGRAMS = check_code_options check_buffer_sizes check_long_fs
check_code_options_SOURCES = check_code_options.c check_aec.h \
$(top_builddir)/src/libaec.h
check_buffer_sizes_SOURCES = check_buffer_sizes.c check_aec.h \
$(top_builddir)/src/libaec.h
check_long_fs_SOURCES = check_long_fs.c check_aec.h \
$(top_builddir)/src/libaec.h
LDADD = libcheck_aec.la $(top_builddir)/src/libaec.la
EXTRA_DIST = sampledata.sh
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "libaec.h"
#include "check_aec.h"
#define BUF_SIZE (4 * 64 * 4)
int check_long_fs(struct test_state *state)
{
int status, size;
unsigned char *tmp;
size = state->bytes_per_sample;
for (tmp = state->ubuf;
tmp < state->ubuf + state->buf_len;
tmp += 2 * size) {
state->out(tmp, state->xmin, size);
state->out(tmp + size, state->xmin + 2, size);
}
state->out(state->ubuf + (64 + 1) * size, state->xmax-1, size);
printf("Checking long fs ... ");
status = state->codec(state);
if (status)
return status;
printf ("%s\n", CHECK_PASS);
return 0;
}
int main (void)
{
int status;
struct aec_stream strm;
struct test_state state;
state.buf_len = state.ibuf_len = BUF_SIZE;
state.cbuf_len = 2 * BUF_SIZE;
state.ubuf = (unsigned char *)malloc(state.buf_len);
state.cbuf = (unsigned char *)malloc(state.cbuf_len);
state.obuf = (unsigned char *)malloc(state.buf_len);
if (!state.ubuf || !state.cbuf || !state.obuf) {
printf("Not enough memory.\n");
return 99;
}
strm.flags = AEC_DATA_PREPROCESS;
state.strm = &strm;
strm.bits_per_sample = 32;
strm.block_size = 64;
strm.rsi = 64;
state.codec = encode_decode_large;
update_state(&state);
status = check_long_fs(&state);
if (status)
goto DESTRUCT;
DESTRUCT:
free(state.ubuf);
free(state.cbuf);
free(state.obuf);
return status;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment