Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d5fd8df2
Commit
d5fd8df2
authored
Oct 20, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add yet some 24-bit tests.
parent
ce82eb2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
Lib/test/test_audioop.py
Lib/test/test_audioop.py
+11
-12
No files found.
Lib/test/test_audioop.py
View file @
d5fd8df2
...
@@ -87,6 +87,7 @@ class TestAudioop(unittest.TestCase):
...
@@ -87,6 +87,7 @@ class TestAudioop(unittest.TestCase):
self
.
assertEqual
(
audioop
.
avgpp
(
packs
[
w
](
9
,
10
,
5
,
5
,
0
,
1
),
w
),
10
)
self
.
assertEqual
(
audioop
.
avgpp
(
packs
[
w
](
9
,
10
,
5
,
5
,
0
,
1
),
w
),
10
)
self
.
assertEqual
(
audioop
.
avgpp
(
datas
[
1
],
1
),
196
)
self
.
assertEqual
(
audioop
.
avgpp
(
datas
[
1
],
1
),
196
)
self
.
assertEqual
(
audioop
.
avgpp
(
datas
[
2
],
2
),
50534
)
self
.
assertEqual
(
audioop
.
avgpp
(
datas
[
2
],
2
),
50534
)
self
.
assertEqual
(
audioop
.
avgpp
(
datas
[
3
],
3
),
12937096
)
self
.
assertEqual
(
audioop
.
avgpp
(
datas
[
4
],
4
),
3311897002
)
self
.
assertEqual
(
audioop
.
avgpp
(
datas
[
4
],
4
),
3311897002
)
def
test_rms
(
self
):
def
test_rms
(
self
):
...
@@ -100,6 +101,7 @@ class TestAudioop(unittest.TestCase):
...
@@ -100,6 +101,7 @@ class TestAudioop(unittest.TestCase):
-
minvalues
[
w
],
delta
=
1
)
-
minvalues
[
w
],
delta
=
1
)
self
.
assertEqual
(
audioop
.
rms
(
datas
[
1
],
1
),
77
)
self
.
assertEqual
(
audioop
.
rms
(
datas
[
1
],
1
),
77
)
self
.
assertEqual
(
audioop
.
rms
(
datas
[
2
],
2
),
20001
)
self
.
assertEqual
(
audioop
.
rms
(
datas
[
2
],
2
),
20001
)
self
.
assertEqual
(
audioop
.
rms
(
datas
[
3
],
3
),
5120523
)
self
.
assertEqual
(
audioop
.
rms
(
datas
[
4
],
4
),
1310854152
)
self
.
assertEqual
(
audioop
.
rms
(
datas
[
4
],
4
),
1310854152
)
def
test_cross
(
self
):
def
test_cross
(
self
):
...
@@ -227,10 +229,9 @@ class TestAudioop(unittest.TestCase):
...
@@ -227,10 +229,9 @@ class TestAudioop(unittest.TestCase):
def
test_lin2adpcm
(
self
):
def
test_lin2adpcm
(
self
):
self
.
assertEqual
(
audioop
.
lin2adpcm
(
datas
[
1
],
1
,
None
),
self
.
assertEqual
(
audioop
.
lin2adpcm
(
datas
[
1
],
1
,
None
),
(
b'
\
x07
\
x7f
\
x7f
'
,
(
-
221
,
39
)))
(
b'
\
x07
\
x7f
\
x7f
'
,
(
-
221
,
39
)))
self
.
assertEqual
(
audioop
.
lin2adpcm
(
datas
[
2
],
2
,
None
),
for
w
in
2
,
3
,
4
:
(
b'
\
x07
\
x7f
\
x7f
'
,
(
31
,
39
)))
self
.
assertEqual
(
audioop
.
lin2adpcm
(
datas
[
w
],
w
,
None
),
self
.
assertEqual
(
audioop
.
lin2adpcm
(
datas
[
4
],
4
,
None
),
(
b'
\
x07
\
x7f
\
x7f
'
,
(
31
,
39
)))
(
b'
\
x07
\
x7f
\
x7f
'
,
(
31
,
39
)))
# Very cursory test
# Very cursory test
for
w
in
1
,
2
,
3
,
4
:
for
w
in
1
,
2
,
3
,
4
:
...
@@ -240,10 +241,9 @@ class TestAudioop(unittest.TestCase):
...
@@ -240,10 +241,9 @@ class TestAudioop(unittest.TestCase):
def
test_lin2alaw
(
self
):
def
test_lin2alaw
(
self
):
self
.
assertEqual
(
audioop
.
lin2alaw
(
datas
[
1
],
1
),
self
.
assertEqual
(
audioop
.
lin2alaw
(
datas
[
1
],
1
),
b'
\
xd5
\
x87
\
xa4
\
x24
\
xaa
\
x2a
\
x5a
'
)
b'
\
xd5
\
x87
\
xa4
\
x24
\
xaa
\
x2a
\
x5a
'
)
self
.
assertEqual
(
audioop
.
lin2alaw
(
datas
[
2
],
2
),
for
w
in
2
,
3
,
4
:
b'
\
xd5
\
x87
\
xa4
\
x24
\
xaa
\
x2a
\
x55
'
)
self
.
assertEqual
(
audioop
.
lin2alaw
(
datas
[
w
],
w
),
self
.
assertEqual
(
audioop
.
lin2alaw
(
datas
[
4
],
4
),
b'
\
xd5
\
x87
\
xa4
\
x24
\
xaa
\
x2a
\
x55
'
)
b'
\
xd5
\
x87
\
xa4
\
x24
\
xaa
\
x2a
\
x55
'
)
def
test_alaw2lin
(
self
):
def
test_alaw2lin
(
self
):
encoded
=
b'
\
x00
\
x03
\
x24
\
x2a
\
x51
\
x54
\
x55
\
x58
\
x6b
\
x71
\
x7f
'
\
encoded
=
b'
\
x00
\
x03
\
x24
\
x2a
\
x51
\
x54
\
x55
\
x58
\
x6b
\
x71
\
x7f
'
\
...
@@ -262,10 +262,9 @@ class TestAudioop(unittest.TestCase):
...
@@ -262,10 +262,9 @@ class TestAudioop(unittest.TestCase):
def
test_lin2ulaw
(
self
):
def
test_lin2ulaw
(
self
):
self
.
assertEqual
(
audioop
.
lin2ulaw
(
datas
[
1
],
1
),
self
.
assertEqual
(
audioop
.
lin2ulaw
(
datas
[
1
],
1
),
b'
\
xff
\
xad
\
x8e
\
x0e
\
x80
\
x00
\
x67
'
)
b'
\
xff
\
xad
\
x8e
\
x0e
\
x80
\
x00
\
x67
'
)
self
.
assertEqual
(
audioop
.
lin2ulaw
(
datas
[
2
],
2
),
for
w
in
2
,
3
,
4
:
b'
\
xff
\
xad
\
x8e
\
x0e
\
x80
\
x00
\
x7e
'
)
self
.
assertEqual
(
audioop
.
lin2ulaw
(
datas
[
w
],
w
),
self
.
assertEqual
(
audioop
.
lin2ulaw
(
datas
[
4
],
4
),
b'
\
xff
\
xad
\
x8e
\
x0e
\
x80
\
x00
\
x7e
'
)
b'
\
xff
\
xad
\
x8e
\
x0e
\
x80
\
x00
\
x7e
'
)
def
test_ulaw2lin
(
self
):
def
test_ulaw2lin
(
self
):
encoded
=
b'
\
x00
\
x0e
\
x28
\
x3f
\
x57
\
x6a
\
x76
\
x7c
\
x7e
\
x7f
'
\
encoded
=
b'
\
x00
\
x0e
\
x28
\
x3f
\
x57
\
x6a
\
x76
\
x7c
\
x7e
\
x7f
'
\
...
...
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