Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flac
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hugo Beauzée-Luyssen
flac
Commits
f01a3aa7
Commit
f01a3aa7
authored
May 19, 2018
by
Robert Kausch
Committed by
Erik de Castro Lopo
May 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes for bitwriter unit test.
parent
096a63d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
src/test_libFLAC/bitwriter.c
src/test_libFLAC/bitwriter.c
+11
-16
No files found.
src/test_libFLAC/bitwriter.c
View file @
f01a3aa7
/* test_libFLAC - Unit tester for libFLAC
/* test_libFLAC - Unit tester for libFLAC
* Copyright (C) 2000-2009 Josh Coalson
* Copyright (C) 2000-2009 Josh Coalson
* Copyright (C) 2011-201
6
Xiph.Org Foundation
* Copyright (C) 2011-201
8
Xiph.Org Foundation
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* modify it under the terms of the GNU General Public License
...
@@ -112,9 +112,8 @@ FLAC__bool test_bitwriter(void)
...
@@ -112,9 +112,8 @@ FLAC__bool test_bitwriter(void)
printf
(
"OK
\n
"
);
printf
(
"OK
\n
"
);
printf
(
"testing init... "
);
printf
(
"testing init... "
);
FLAC__bitwriter_init
(
bw
);
if
(
!
FLAC__bitwriter_init
(
bw
))
{
if
(
0
==
bw
)
{
printf
(
"FAILED, returned false
\n
"
);
printf
(
"FAILED, returned NULL
\n
"
);
return
false
;
return
false
;
}
}
printf
(
"OK
\n
"
);
printf
(
"OK
\n
"
);
...
@@ -135,19 +134,14 @@ FLAC__bool test_bitwriter(void)
...
@@ -135,19 +134,14 @@ FLAC__bool test_bitwriter(void)
printf
(
"OK
\n
"
);
printf
(
"OK
\n
"
);
printf
(
"testing init... "
);
printf
(
"testing init... "
);
FLAC__bitwriter_init
(
bw
);
if
(
!
FLAC__bitwriter_init
(
bw
))
{
if
(
0
==
bw
)
{
printf
(
"FAILED, returned false
\n
"
);
printf
(
"FAILED, returned NULL
\n
"
);
return
false
;
return
false
;
}
}
printf
(
"OK
\n
"
);
printf
(
"OK
\n
"
);
printf
(
"testing clear... "
);
printf
(
"testing clear... "
);
FLAC__bitwriter_clear
(
bw
);
FLAC__bitwriter_clear
(
bw
);
if
(
0
==
bw
)
{
printf
(
"FAILED, returned NULL
\n
"
);
return
false
;
}
printf
(
"OK
\n
"
);
printf
(
"OK
\n
"
);
printf
(
"testing delete... "
);
printf
(
"testing delete... "
);
...
@@ -166,10 +160,11 @@ FLAC__bool test_bitwriter(void)
...
@@ -166,10 +160,11 @@ FLAC__bool test_bitwriter(void)
printf
(
"OK
\n
"
);
printf
(
"OK
\n
"
);
printf
(
"testing init... "
);
printf
(
"testing init... "
);
ok
=
FLAC__bitwriter_init
(
bw
);
if
(
!
FLAC__bitwriter_init
(
bw
))
{
printf
(
"%s
\n
"
,
ok
?
"OK"
:
"FAILED"
);
printf
(
"FAILED, returned false
\n
"
);
if
(
!
ok
)
return
false
;
return
false
;
}
printf
(
"OK
\n
"
);
printf
(
"testing clear... "
);
printf
(
"testing clear... "
);
FLAC__bitwriter_clear
(
bw
);
FLAC__bitwriter_clear
(
bw
);
...
@@ -204,7 +199,7 @@ FLAC__bool test_bitwriter(void)
...
@@ -204,7 +199,7 @@ FLAC__bool test_bitwriter(void)
bits
=
152
-
words
*
FLAC__BITS_PER_WORD
;
bits
=
152
-
words
*
FLAC__BITS_PER_WORD
;
if
(
bw
->
words
!=
words
)
{
if
(
bw
->
words
!=
words
)
{
printf
(
"FAILED
byte
count %u != %u
\n
"
,
bw
->
words
,
words
);
printf
(
"FAILED
word
count %u != %u
\n
"
,
bw
->
words
,
words
);
FLAC__bitwriter_dump
(
bw
,
stdout
);
FLAC__bitwriter_dump
(
bw
,
stdout
);
return
false
;
return
false
;
}
}
...
@@ -237,7 +232,7 @@ FLAC__bool test_bitwriter(void)
...
@@ -237,7 +232,7 @@ FLAC__bool test_bitwriter(void)
test_pattern1
[
words
]
<<=
6
;
test_pattern1
[
words
]
<<=
6
;
test_pattern1
[
words
]
|=
0x3d
;
test_pattern1
[
words
]
|=
0x3d
;
if
(
bw
->
words
!=
words
)
{
if
(
bw
->
words
!=
words
)
{
printf
(
"FAILED
byte
count %u != %u
\n
"
,
bw
->
words
,
words
);
printf
(
"FAILED
word
count %u != %u
\n
"
,
bw
->
words
,
words
);
FLAC__bitwriter_dump
(
bw
,
stdout
);
FLAC__bitwriter_dump
(
bw
,
stdout
);
return
false
;
return
false
;
}
}
...
...
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