Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
92ff27f5
Commit
92ff27f5
authored
Jan 21, 2016
by
Hugo Beauzée-Luyssen
Browse files
MediaLibrary: Move createDevice wrapper in test code
parent
86bdf8b7
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/MediaLibrary.cpp
View file @
92ff27f5
...
...
@@ -276,11 +276,6 @@ std::shared_ptr<Device> MediaLibrary::device( const std::string& uuid )
return
Device
::
fromUuid
(
m_dbConnection
.
get
(),
uuid
);
}
std
::
shared_ptr
<
Device
>
MediaLibrary
::
addDevice
(
const
std
::
string
&
uuid
,
bool
isRemovable
)
{
return
Device
::
create
(
m_dbConnection
.
get
(),
uuid
,
isRemovable
);
}
LabelPtr
MediaLibrary
::
createLabel
(
const
std
::
string
&
label
)
{
return
Label
::
create
(
m_dbConnection
.
get
(),
label
);
...
...
src/MediaLibrary.h
View file @
92ff27f5
...
...
@@ -59,7 +59,6 @@ class MediaLibrary : public IMediaLibrary
bool
deleteFolder
(
const
Folder
&
folder
);
std
::
shared_ptr
<
Device
>
device
(
const
std
::
string
&
uuid
);
std
::
shared_ptr
<
Device
>
addDevice
(
const
std
::
string
&
uuid
,
bool
isRemovable
);
virtual
LabelPtr
createLabel
(
const
std
::
string
&
label
)
override
;
virtual
bool
deleteLabel
(
LabelPtr
label
)
override
;
...
...
test/unittest/Tests.cpp
View file @
92ff27f5
...
...
@@ -26,6 +26,7 @@
#include
"Album.h"
#include
"Artist.h"
#include
"Device.h"
#include
"File.h"
#include
"filesystem/IFile.h"
#include
"filesystem/IDirectory.h"
...
...
@@ -147,3 +148,8 @@ void MediaLibraryTester::deleteArtist( unsigned int artistId )
{
Artist
::
destroy
(
m_dbConnection
.
get
(),
artistId
);
}
std
::
shared_ptr
<
Device
>
MediaLibraryTester
::
addDevice
(
const
std
::
string
&
uuid
,
bool
isRemovable
)
{
return
Device
::
create
(
m_dbConnection
.
get
(),
uuid
,
isRemovable
);
}
test/unittest/Tests.h
View file @
92ff27f5
...
...
@@ -41,6 +41,7 @@ public:
std
::
shared_ptr
<
Genre
>
createGenre
(
const
std
::
string
&
name
);
void
deleteGenre
(
unsigned
int
genreId
);
void
deleteArtist
(
unsigned
int
artistId
);
std
::
shared_ptr
<
Device
>
addDevice
(
const
std
::
string
&
uuid
,
bool
isRemovable
);
private:
std
::
unique_ptr
<
fs
::
IDirectory
>
dummyDirectory
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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