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
0307801d
Commit
0307801d
authored
Jan 31, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/test_pcm: convert to C++
parent
72cf8dd8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
49 deletions
+57
-49
Makefile.am
Makefile.am
+6
-6
test_pcm_all.hxx
test/test_pcm_all.hxx
+14
-14
test_pcm_channels.cxx
test/test_pcm_channels.cxx
+6
-4
test_pcm_dither.cxx
test/test_pcm_dither.cxx
+8
-5
test_pcm_main.cxx
test/test_pcm_main.cxx
+2
-2
test_pcm_pack.cxx
test/test_pcm_pack.cxx
+8
-5
test_pcm_volume.cxx
test/test_pcm_volume.cxx
+13
-13
No files found.
Makefile.am
View file @
0307801d
...
...
@@ -1401,12 +1401,12 @@ test_test_byte_reverse_LDADD = \
$(GLIB_LIBS)
test_test_pcm_SOURCES
=
\
test
/test_pcm_dither.c
\
test
/test_pcm_pack.c
\
test
/test_pcm_channels.c
\
test
/test_pcm_volume.c
\
test
/test_pcm_all.h
\
test
/test_pcm_main.c
test
/test_pcm_dither.c
xx
\
test
/test_pcm_pack.c
xx
\
test
/test_pcm_channels.c
xx
\
test
/test_pcm_volume.c
xx
\
test
/test_pcm_all.h
xx
\
test
/test_pcm_main.c
xx
test_test_pcm_LDADD
=
\
$(PCM_LIBS)
\
libutil.a
\
...
...
test/test_pcm_all.h
→
test/test_pcm_all.h
xx
View file @
0307801d
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,40 +17,40 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_TEST_PCM_ALL_H
#define MPD_TEST_PCM_ALL_H
#ifndef MPD_TEST_PCM_ALL_H
XX
#define MPD_TEST_PCM_ALL_H
XX
void
test_pcm_dither_24
(
void
);
test_pcm_dither_24
();
void
test_pcm_dither_32
(
void
);
test_pcm_dither_32
();
void
test_pcm_pack_24
(
void
);
test_pcm_pack_24
();
void
test_pcm_unpack_24
(
void
);
test_pcm_unpack_24
();
void
test_pcm_channels_16
(
void
);
test_pcm_channels_16
();
void
test_pcm_channels_32
(
void
);
test_pcm_channels_32
();
void
test_pcm_volume_8
(
void
);
test_pcm_volume_8
();
void
test_pcm_volume_16
(
void
);
test_pcm_volume_16
();
void
test_pcm_volume_24
(
void
);
test_pcm_volume_24
();
void
test_pcm_volume_32
(
void
);
test_pcm_volume_32
();
void
test_pcm_volume_float
(
void
);
test_pcm_volume_float
();
#endif
test/test_pcm_channels.c
→
test/test_pcm_channels.c
xx
View file @
0307801d
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,14 +18,16 @@
*/
#include "config.h"
#include "test_pcm_all.h"
#include "test_pcm_all.hxx"
extern
"C"
{
#include "pcm_channels.h"
}
#include "pcm_buffer.h"
#include <glib.h>
void
test_pcm_channels_16
(
void
)
test_pcm_channels_16
()
{
enum
{
N
=
256
};
int16_t
src
[
N
*
2
];
...
...
@@ -63,7 +65,7 @@ test_pcm_channels_16(void)
}
void
test_pcm_channels_32
(
void
)
test_pcm_channels_32
()
{
enum
{
N
=
256
};
int32_t
src
[
N
*
2
];
...
...
test/test_pcm_dither.c
→
test/test_pcm_dither.c
xx
View file @
0307801d
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,8 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "test_pcm_all.h"
#include "test_pcm_all.hxx"
extern
"C"
{
#include "pcm_dither.h"
}
#include <glib.h>
...
...
@@ -26,7 +29,7 @@
* Generate a random 24 bit PCM sample.
*/
static
int32_t
random24
(
void
)
random24
()
{
int32_t
x
=
g_random_int
()
&
0xffffff
;
if
(
x
&
0x800000
)
...
...
@@ -35,7 +38,7 @@ random24(void)
}
void
test_pcm_dither_24
(
void
)
test_pcm_dither_24
()
{
struct
pcm_dither
dither
;
...
...
@@ -57,7 +60,7 @@ test_pcm_dither_24(void)
}
void
test_pcm_dither_32
(
void
)
test_pcm_dither_32
()
{
struct
pcm_dither
dither
;
...
...
test/test_pcm_main.c
→
test/test_pcm_main.c
xx
View file @
0307801d
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "test_pcm_all.h"
#include "test_pcm_all.h
xx
"
#include <glib.h>
...
...
test/test_pcm_pack.c
→
test/test_pcm_pack.c
xx
View file @
0307801d
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,8 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "test_pcm_all.h"
#include "test_pcm_all.hxx"
extern
"C"
{
#include "pcm_pack.h"
}
#include <glib.h>
...
...
@@ -26,7 +29,7 @@
* Generate a random 24 bit PCM sample.
*/
static
int32_t
random24
(
void
)
random24
()
{
int32_t
x
=
g_random_int
()
&
0xffffff
;
if
(
x
&
0x800000
)
...
...
@@ -35,7 +38,7 @@ random24(void)
}
void
test_pcm_pack_24
(
void
)
test_pcm_pack_24
()
{
enum
{
N
=
256
};
int32_t
src
[
N
*
3
];
...
...
@@ -62,7 +65,7 @@ test_pcm_pack_24(void)
}
void
test_pcm_unpack_24
(
void
)
test_pcm_unpack_24
()
{
enum
{
N
=
256
};
uint8_t
src
[
N
*
3
];
...
...
test/test_pcm_volume.c
→
test/test_pcm_volume.c
xx
View file @
0307801d
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "test_pcm_all.h"
#include "test_pcm_all.h
xx
"
#include "pcm_volume.h"
#include <glib.h>
...
...
@@ -25,10 +25,10 @@
#include <string.h>
void
test_pcm_volume_8
(
void
)
test_pcm_volume_8
()
{
enum
{
N
=
256
};
static
const
int8_t
zero
[
N
];
static
int8_t
zero
[
N
];
int8_t
src
[
N
];
for
(
unsigned
i
=
0
;
i
<
N
;
++
i
)
src
[
i
]
=
g_random_int
();
...
...
@@ -56,10 +56,10 @@ test_pcm_volume_8(void)
}
void
test_pcm_volume_16
(
void
)
test_pcm_volume_16
()
{
enum
{
N
=
256
};
static
const
int16_t
zero
[
N
];
static
int16_t
zero
[
N
];
int16_t
src
[
N
];
for
(
unsigned
i
=
0
;
i
<
N
;
++
i
)
src
[
i
]
=
g_random_int
();
...
...
@@ -90,7 +90,7 @@ test_pcm_volume_16(void)
* Generate a random 24 bit PCM sample.
*/
static
int32_t
random24
(
void
)
random24
()
{
int32_t
x
=
g_random_int
()
&
0xffffff
;
if
(
x
&
0x800000
)
...
...
@@ -99,10 +99,10 @@ random24(void)
}
void
test_pcm_volume_24
(
void
)
test_pcm_volume_24
()
{
enum
{
N
=
256
};
static
const
int32_t
zero
[
N
];
static
int32_t
zero
[
N
];
int32_t
src
[
N
];
for
(
unsigned
i
=
0
;
i
<
N
;
++
i
)
src
[
i
]
=
random24
();
...
...
@@ -130,10 +130,10 @@ test_pcm_volume_24(void)
}
void
test_pcm_volume_32
(
void
)
test_pcm_volume_32
()
{
enum
{
N
=
256
};
static
const
int32_t
zero
[
N
];
static
int32_t
zero
[
N
];
int32_t
src
[
N
];
for
(
unsigned
i
=
0
;
i
<
N
;
++
i
)
src
[
i
]
=
g_random_int
();
...
...
@@ -161,10 +161,10 @@ test_pcm_volume_32(void)
}
void
test_pcm_volume_float
(
void
)
test_pcm_volume_float
()
{
enum
{
N
=
256
};
static
const
float
zero
[
N
];
static
float
zero
[
N
];
float
src
[
N
];
for
(
unsigned
i
=
0
;
i
<
N
;
++
i
)
src
[
i
]
=
g_random_double_range
(
-
1.0
,
1.0
);
...
...
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