Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
730e67d7
Commit
730e67d7
authored
6 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/test_pcm_export: add tests for Get{In,Out}put{Frame,Block}Size()
parent
34c63378
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
test_pcm_export.cxx
test/test_pcm_export.cxx
+42
-0
No files found.
test/test_pcm_export.cxx
View file @
730e67d7
...
...
@@ -41,6 +41,11 @@ TEST(PcmTest, ExportShift8)
PcmExport
e
;
e
.
Open
(
SampleFormat
::
S24_P32
,
2
,
params
);
EXPECT_EQ
(
e
.
GetInputFrameSize
(),
8u
);
EXPECT_EQ
(
e
.
GetOutputFrameSize
(),
8u
);
EXPECT_EQ
(
e
.
GetInputBlockSize
(),
8u
);
EXPECT_EQ
(
e
.
GetOutputBlockSize
(),
8u
);
auto
dest
=
e
.
Export
({
src
,
sizeof
(
src
)});
EXPECT_EQ
(
sizeof
(
expected
),
dest
.
size
);
EXPECT_TRUE
(
memcmp
(
dest
.
data
,
expected
,
dest
.
size
)
==
0
);
...
...
@@ -79,6 +84,11 @@ TEST(PcmTest, ExportPack24)
PcmExport
e
;
e
.
Open
(
SampleFormat
::
S24_P32
,
2
,
params
);
EXPECT_EQ
(
e
.
GetInputFrameSize
(),
8u
);
EXPECT_EQ
(
e
.
GetOutputFrameSize
(),
6u
);
EXPECT_EQ
(
e
.
GetInputBlockSize
(),
8u
);
EXPECT_EQ
(
e
.
GetOutputBlockSize
(),
6u
);
auto
dest
=
e
.
Export
({
src
,
sizeof
(
src
)});
EXPECT_EQ
(
expected_size
,
dest
.
size
);
EXPECT_TRUE
(
memcmp
(
dest
.
data
,
expected
,
dest
.
size
)
==
0
);
...
...
@@ -107,16 +117,33 @@ TEST(PcmTest, ExportReverseEndian)
PcmExport
e
;
e
.
Open
(
SampleFormat
::
S8
,
2
,
params
);
EXPECT_EQ
(
e
.
GetInputFrameSize
(),
2u
);
EXPECT_EQ
(
e
.
GetOutputFrameSize
(),
2u
);
EXPECT_EQ
(
e
.
GetInputBlockSize
(),
2u
);
EXPECT_EQ
(
e
.
GetOutputBlockSize
(),
2u
);
auto
dest
=
e
.
Export
({
src
,
sizeof
(
src
)});
EXPECT_EQ
(
sizeof
(
src
),
dest
.
size
);
EXPECT_TRUE
(
memcmp
(
dest
.
data
,
src
,
dest
.
size
)
==
0
);
e
.
Open
(
SampleFormat
::
S16
,
2
,
params
);
EXPECT_EQ
(
e
.
GetInputFrameSize
(),
4u
);
EXPECT_EQ
(
e
.
GetOutputFrameSize
(),
4u
);
EXPECT_EQ
(
e
.
GetInputBlockSize
(),
4u
);
EXPECT_EQ
(
e
.
GetOutputBlockSize
(),
4u
);
dest
=
e
.
Export
({
src
,
sizeof
(
src
)});
EXPECT_EQ
(
sizeof
(
expected2
),
dest
.
size
);
EXPECT_TRUE
(
memcmp
(
dest
.
data
,
expected2
,
dest
.
size
)
==
0
);
e
.
Open
(
SampleFormat
::
S32
,
2
,
params
);
EXPECT_EQ
(
e
.
GetInputFrameSize
(),
8u
);
EXPECT_EQ
(
e
.
GetOutputFrameSize
(),
8u
);
EXPECT_EQ
(
e
.
GetInputBlockSize
(),
8u
);
EXPECT_EQ
(
e
.
GetOutputBlockSize
(),
8u
);
dest
=
e
.
Export
({
src
,
sizeof
(
src
)});
EXPECT_EQ
(
sizeof
(
expected4
),
dest
.
size
);
EXPECT_TRUE
(
memcmp
(
dest
.
data
,
expected4
,
dest
.
size
)
==
0
);
...
...
@@ -149,6 +176,11 @@ TEST(PcmTest, ExportDsdU16)
PcmExport
e
;
e
.
Open
(
SampleFormat
::
DSD
,
2
,
params
);
EXPECT_EQ
(
e
.
GetInputFrameSize
(),
2u
);
EXPECT_EQ
(
e
.
GetOutputFrameSize
(),
4u
);
EXPECT_EQ
(
e
.
GetInputBlockSize
(),
4u
);
EXPECT_EQ
(
e
.
GetOutputBlockSize
(),
4u
);
auto
dest
=
e
.
Export
({
src
,
sizeof
(
src
)});
EXPECT_EQ
(
sizeof
(
expected
),
dest
.
size
);
EXPECT_TRUE
(
memcmp
(
dest
.
data
,
expected
,
dest
.
size
)
==
0
);
...
...
@@ -200,6 +232,11 @@ TEST(PcmTest, ExportDsdU32)
PcmExport
e
;
e
.
Open
(
SampleFormat
::
DSD
,
2
,
params
);
EXPECT_EQ
(
e
.
GetInputFrameSize
(),
2u
);
EXPECT_EQ
(
e
.
GetOutputFrameSize
(),
8u
);
EXPECT_EQ
(
e
.
GetInputBlockSize
(),
8u
);
EXPECT_EQ
(
e
.
GetOutputBlockSize
(),
8u
);
auto
dest
=
e
.
Export
({
src
,
sizeof
(
src
)});
EXPECT_EQ
(
sizeof
(
expected
),
dest
.
size
);
EXPECT_TRUE
(
memcmp
(
dest
.
data
,
expected
,
dest
.
size
)
==
0
);
...
...
@@ -249,6 +286,11 @@ TEST(PcmTest, ExportDop)
PcmExport
e
;
e
.
Open
(
SampleFormat
::
DSD
,
2
,
params
);
EXPECT_EQ
(
e
.
GetInputFrameSize
(),
2u
);
EXPECT_EQ
(
e
.
GetOutputFrameSize
(),
8u
);
EXPECT_EQ
(
e
.
GetInputBlockSize
(),
8u
);
EXPECT_EQ
(
e
.
GetOutputBlockSize
(),
16u
);
auto
dest
=
e
.
Export
({
src
,
sizeof
(
src
)});
EXPECT_EQ
(
sizeof
(
expected
),
dest
.
size
);
EXPECT_TRUE
(
memcmp
(
dest
.
data
,
expected
,
dest
.
size
)
==
0
);
...
...
This diff is collapsed.
Click to expand it.
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