Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
f6252b48
Commit
f6252b48
authored
Jun 29, 2011
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adler32: make test program more useful and add fate test
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
e0b8fff6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
adler32.c
libavutil/adler32.c
+15
-7
fate2.mak
tests/fate2.mak
+5
-0
No files found.
libavutil/adler32.c
View file @
f6252b48
...
...
@@ -52,22 +52,30 @@ unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, unsigne
}
#ifdef TEST
#include <string.h>
#include "log.h"
#include "timer.h"
#define LEN 7001
volatile
int
checksum
;
int
main
(
void
){
int
main
(
int
argc
,
char
**
argv
)
{
int
i
;
char
data
[
LEN
];
av_log_set_level
(
AV_LOG_DEBUG
);
for
(
i
=
0
;
i
<
LEN
;
i
++
)
data
[
i
]
=
((
i
*
i
)
>>
3
)
+
123
*
i
;
for
(
i
=
0
;
i
<
1000
;
i
++
){
START_TIMER
checksum
=
av_adler32_update
(
1
,
data
,
LEN
);
STOP_TIMER
(
"adler"
)
if
(
argc
>
1
&&
!
strcmp
(
argv
[
1
],
"-t"
))
{
for
(
i
=
0
;
i
<
1000
;
i
++
)
{
START_TIMER
;
checksum
=
av_adler32_update
(
1
,
data
,
LEN
);
STOP_TIMER
(
"adler"
);
}
}
else
{
checksum
=
av_adler32_update
(
1
,
data
,
LEN
);
}
av_log
(
NULL
,
AV_LOG_DEBUG
,
"%X == 50E6E508
\n
"
,
checksum
);
return
0
;
av_log
(
NULL
,
AV_LOG_DEBUG
,
"%X (expected 50E6E508)
\n
"
,
checksum
);
return
checksum
==
0x50e6e508
?
0
:
1
;
}
#endif
tests/fate2.mak
View file @
f6252b48
...
...
@@ -217,6 +217,11 @@ FATE_TESTS += fate-sha
fate-sha: libavutil/sha-test$(EXESUF)
fate-sha: CMD = run libavutil/sha-test
FATE_TESTS += fate-adler32
fate-adler32: libavutil/adler32-test$(EXESUF)
fate-adler32: CMD = run libavutil/adler32-test
fate-adler32: REF = /dev/null
FATE_TESTS += fate-musepack7
fate-musepack7: CMD = pcm -i $(SAMPLES)/musepack/inside-mp7.mpc
fate-musepack7: CMP = oneoff
...
...
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