Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Mathis Rosenhauer
libaec
Commits
9e44ed90
Commit
9e44ed90
authored
Feb 07, 2014
by
Mathis Rosenhauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check long fs
parent
12a94f75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
2 deletions
+77
-2
tests/Makefile.am
tests/Makefile.am
+5
-2
tests/check_long_fs.c
tests/check_long_fs.c
+72
-0
No files found.
tests/Makefile.am
View file @
9e44ed90
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
tests/check_long_fs.c
0 → 100644
View file @
9e44ed90
#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
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment