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
d1456ae0
Commit
d1456ae0
authored
Feb 10, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/*: use class EventThread instead of ScopeIOThread
parent
115af4f5
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
37 additions
and
83 deletions
+37
-83
Makefile.am
Makefile.am
+1
-18
ScopeIOThread.hxx
test/ScopeIOThread.hxx
+0
-36
dump_playlist.cxx
test/dump_playlist.cxx
+4
-3
dump_text_file.cxx
test/dump_text_file.cxx
+4
-3
read_tags.cxx
test/read_tags.cxx
+4
-3
run_decoder.cxx
test/run_decoder.cxx
+4
-3
run_input.cxx
test/run_input.cxx
+4
-3
run_output.cxx
test/run_output.cxx
+5
-6
run_storage.cxx
test/run_storage.cxx
+7
-5
visit_archive.cxx
test/visit_archive.cxx
+4
-3
No files found.
Makefile.am
View file @
d1456ae0
...
...
@@ -1786,8 +1786,6 @@ test_run_storage_LDADD = \
libutil.a
test_run_storage_SOURCES
=
\
src/Log.cxx src/LogBackend.cxx
\
src/IOThread.cxx
\
test
/ScopeIOThread.hxx
\
test
/run_storage.cxx
if
ENABLE_WEBDAV
...
...
@@ -1808,16 +1806,13 @@ test_run_input_LDADD = \
libsystem.a
\
libutil.a
test_run_input_SOURCES
=
test
/run_input.cxx
\
test
/ScopeIOThread.hxx
\
src/Log.cxx src/LogBackend.cxx
\
src/IOThread.cxx
\
src/TagSave.cxx
if
ENABLE_NEIGHBOR_PLUGINS
test_run_neighbor_explorer_SOURCES
=
\
src/Log.cxx src/LogBackend.cxx
\
src/IOThread.cxx
\
test
/run_neighbor_explorer.cxx
test_run_neighbor_explorer_LDADD
=
$(AM_LDADD)
\
$(NEIGHBOR_LIBS)
\
...
...
@@ -1852,9 +1847,7 @@ test_visit_archive_LDADD = \
libsystem.a
\
libutil.a
test_visit_archive_SOURCES
=
test
/visit_archive.cxx
\
test
/ScopeIOThread.hxx
\
src/Log.cxx src/LogBackend.cxx
\
src/IOThread.cxx
\
src/input/Open.cxx
endif
...
...
@@ -1900,9 +1893,7 @@ test_dump_text_file_LDADD = \
libthread.a
\
libutil.a
test_dump_text_file_SOURCES
=
test
/dump_text_file.cxx
\
test
/ScopeIOThread.hxx
\
src/Log.cxx src/LogBackend.cxx
\
src/IOThread.cxx
src/Log.cxx src/LogBackend.cxx
test_dump_playlist_LDADD
=
\
$(PLAYLIST_LIBS)
\
...
...
@@ -1923,9 +1914,7 @@ test_dump_playlist_LDADD = \
libpcm.a
test_dump_playlist_SOURCES
=
test
/dump_playlist.cxx
\
test
/FakeDecoderAPI.cxx
test
/FakeDecoderAPI.hxx
\
test
/ScopeIOThread.hxx
\
src/Log.cxx src/LogBackend.cxx
\
src/IOThread.cxx
\
src/TagSave.cxx
\
src/TagFile.cxx
\
src/DetachedSong.cxx
...
...
@@ -1952,10 +1941,8 @@ test_run_decoder_LDADD = \
libutil.a
test_run_decoder_SOURCES
=
test
/run_decoder.cxx
\
test
/FakeDecoderAPI.cxx
test
/FakeDecoderAPI.hxx
\
test
/ScopeIOThread.hxx
\
src/DetachedSong.cxx
\
src/Log.cxx src/LogBackend.cxx
\
src/IOThread.cxx
\
src/ReplayGainInfo.cxx
test_read_tags_LDADD
=
\
...
...
@@ -1974,10 +1961,8 @@ test_read_tags_LDADD = \
libutil.a
test_read_tags_SOURCES
=
test
/read_tags.cxx
\
test
/FakeDecoderAPI.cxx
test
/FakeDecoderAPI.hxx
\
test
/ScopeIOThread.hxx
\
src/DetachedSong.cxx
\
src/Log.cxx src/LogBackend.cxx
\
src/IOThread.cxx
\
src/ReplayGainInfo.cxx
test_ReadApeTags_LDADD
=
\
...
...
@@ -2130,9 +2115,7 @@ test_run_output_LDADD = $(MPD_LIBS) \
libthread.a
\
libutil.a
test_run_output_SOURCES
=
test
/run_output.cxx
\
test
/ScopeIOThread.hxx
\
src/Log.cxx src/LogBackend.cxx
\
src/IOThread.cxx
\
src/output/Domain.cxx
\
src/output/Init.cxx src/output/Finish.cxx src/output/Registry.cxx
\
src/output/OutputPlugin.cxx
\
...
...
test/ScopeIOThread.hxx
deleted
100644 → 0
View file @
115af4f5
/*
* Copyright 2003-2017 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_SCOPE_IO_THREAD_HXX
#define MPD_SCOPE_IO_THREAD_HXX
#include "IOThread.hxx"
struct
ScopeIOThread
{
ScopeIOThread
()
{
io_thread_init
();
io_thread_start
();
}
~
ScopeIOThread
()
{
io_thread_deinit
();
}
};
#endif
test/dump_playlist.cxx
View file @
d1456ae0
...
...
@@ -25,7 +25,7 @@
#include "config/ConfigGlobal.hxx"
#include "decoder/DecoderList.hxx"
#include "input/Init.hxx"
#include "
ScopeIO
Thread.hxx"
#include "
event/
Thread.hxx"
#include "playlist/PlaylistRegistry.hxx"
#include "playlist/PlaylistPlugin.hxx"
#include "fs/Path.hxx"
...
...
@@ -64,9 +64,10 @@ try {
ReadConfigFile
(
config_path
);
const
ScopeIOThread
io_thread
;
EventThread
io_thread
;
io_thread
.
Start
();
input_stream_global_init
(
io_thread
_get
());
input_stream_global_init
(
io_thread
.
GetEventLoop
());
playlist_list_global_init
();
decoder_plugin_init_all
();
...
...
test/dump_text_file.cxx
View file @
d1456ae0
...
...
@@ -18,7 +18,7 @@
*/
#include "config.h"
#include "
ScopeIO
Thread.hxx"
#include "
event/
Thread.hxx"
#include "input/Init.hxx"
#include "input/InputStream.hxx"
#include "input/TextInputStream.hxx"
...
...
@@ -37,15 +37,16 @@
#include <stdlib.h>
class
GlobalInit
{
const
ScopeIO
Thread
io_thread
;
Event
Thread
io_thread
;
public
:
GlobalInit
()
{
io_thread
.
Start
();
config_global_init
();
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
#endif
input_stream_global_init
(
io_thread
_get
());
input_stream_global_init
(
io_thread
.
GetEventLoop
());
}
~
GlobalInit
()
{
...
...
test/read_tags.cxx
View file @
d1456ae0
...
...
@@ -18,7 +18,7 @@
*/
#include "config.h"
#include "
ScopeIO
Thread.hxx"
#include "
event/
Thread.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderPlugin.hxx"
#include "input/Init.hxx"
...
...
@@ -86,9 +86,10 @@ try {
decoder_name
=
argv
[
1
];
const
Path
path
=
Path
::
FromFS
(
argv
[
2
]);
const
ScopeIOThread
io_thread
;
EventThread
io_thread
;
io_thread
.
Start
();
input_stream_global_init
(
io_thread
_get
());
input_stream_global_init
(
io_thread
.
GetEventLoop
());
AtScopeExit
()
{
input_stream_global_finish
();
};
decoder_plugin_init_all
();
...
...
test/run_decoder.cxx
View file @
d1456ae0
...
...
@@ -18,7 +18,7 @@
*/
#include "config.h"
#include "
ScopeIO
Thread.hxx"
#include "
event/
Thread.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderPlugin.hxx"
#include "FakeDecoderAPI.hxx"
...
...
@@ -46,9 +46,10 @@ try {
const
char
*
const
decoder_name
=
argv
[
1
];
const
char
*
const
uri
=
argv
[
2
];
const
ScopeIOThread
io_thread
;
EventThread
io_thread
;
io_thread
.
Start
();
input_stream_global_init
(
io_thread
_get
());
input_stream_global_init
(
io_thread
.
GetEventLoop
());
decoder_plugin_init_all
();
...
...
test/run_input.cxx
View file @
d1456ae0
...
...
@@ -23,7 +23,7 @@
#include "config/ConfigGlobal.hxx"
#include "input/InputStream.hxx"
#include "input/Init.hxx"
#include "
ScopeIO
Thread.hxx"
#include "
event/
Thread.hxx"
#include "thread/Cond.hxx"
#include "Log.hxx"
#include "fs/io/BufferedOutputStream.hxx"
...
...
@@ -39,15 +39,16 @@
#include <stdlib.h>
class
GlobalInit
{
const
ScopeIO
Thread
io_thread
;
Event
Thread
io_thread
;
public
:
GlobalInit
()
{
io_thread
.
Start
();
config_global_init
();
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
#endif
input_stream_global_init
(
io_thread
_get
());
input_stream_global_init
(
io_thread
.
GetEventLoop
());
}
~
GlobalInit
()
{
...
...
test/run_output.cxx
View file @
d1456ae0
...
...
@@ -26,8 +26,7 @@
#include "config/ConfigOption.hxx"
#include "Idle.hxx"
#include "Main.hxx"
#include "event/Loop.hxx"
#include "ScopeIOThread.hxx"
#include "event/Thread.hxx"
#include "fs/Path.hxx"
#include "AudioParser.hxx"
#include "ReplayGainConfig.hxx"
...
...
@@ -136,14 +135,14 @@ try {
config_global_init
();
ReadConfigFile
(
config_path
);
EventLoop
event_loop
;
const
ScopeIOThread
io_thread
;
EventThread
io_thread
;
io_thread
.
Start
();
/* initialize the audio output */
DummyAudioOutputClient
client
;
AudioOutput
*
ao
=
load_audio_output
(
event_loop
,
client
,
argv
[
2
]);
AudioOutput
*
ao
=
load_audio_output
(
io_thread
.
GetEventLoop
(),
client
,
argv
[
2
]);
/* parse the audio format */
...
...
test/run_storage.cxx
View file @
d1456ae0
...
...
@@ -19,7 +19,7 @@
#include "config.h"
#include "Log.hxx"
#include "
ScopeIO
Thread.hxx"
#include "
event/
Thread.hxx"
#include "storage/Registry.hxx"
#include "storage/StorageInterface.hxx"
#include "storage/FileInfo.hxx"
...
...
@@ -34,9 +34,9 @@
#include <time.h>
static
Storage
*
MakeStorage
(
const
char
*
uri
)
MakeStorage
(
EventLoop
&
event_loop
,
const
char
*
uri
)
{
Storage
*
storage
=
CreateStorageURI
(
io_thread_get
()
,
uri
);
Storage
*
storage
=
CreateStorageURI
(
event_loop
,
uri
);
if
(
storage
==
nullptr
)
throw
std
::
runtime_error
(
"Unrecognized storage URI"
);
...
...
@@ -95,7 +95,8 @@ try {
const
char
*
const
command
=
argv
[
1
];
const
char
*
const
storage_uri
=
argv
[
2
];
const
ScopeIOThread
io_thread
;
EventThread
io_thread
;
io_thread
.
Start
();
if
(
strcmp
(
command
,
"ls"
)
==
0
)
{
if
(
argc
!=
4
)
{
...
...
@@ -105,7 +106,8 @@ try {
const
char
*
const
path
=
argv
[
3
];
std
::
unique_ptr
<
Storage
>
storage
(
MakeStorage
(
storage_uri
));
std
::
unique_ptr
<
Storage
>
storage
(
MakeStorage
(
io_thread
.
GetEventLoop
(),
storage_uri
));
return
Ls
(
*
storage
,
path
);
}
else
{
...
...
test/visit_archive.cxx
View file @
d1456ae0
...
...
@@ -20,7 +20,7 @@
#include "config.h"
#include "tag/Tag.hxx"
#include "config/ConfigGlobal.hxx"
#include "
ScopeIO
Thread.hxx"
#include "
event/
Thread.hxx"
#include "input/Init.hxx"
#include "archive/ArchiveList.hxx"
#include "archive/ArchivePlugin.hxx"
...
...
@@ -36,15 +36,16 @@
#include <stdio.h>
class
GlobalInit
{
const
ScopeIO
Thread
io_thread
;
Event
Thread
io_thread
;
public
:
GlobalInit
()
{
io_thread
.
Start
();
config_global_init
();
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all
();
#endif
input_stream_global_init
(
io_thread
_get
());
input_stream_global_init
(
io_thread
.
GetEventLoop
());
}
~
GlobalInit
()
{
...
...
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