Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
131
Issues
131
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
b4082cb0
Commit
b4082cb0
authored
Oct 09, 2008
by
Emmanuel Milou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add init audio layer tests
parent
f8f07467
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
4 deletions
+57
-4
src/managerimpl.cpp
src/managerimpl.cpp
+5
-2
test/configurationTest.cpp
test/configurationTest.cpp
+36
-2
test/configurationTest.h
test/configurationTest.h
+16
-0
No files found.
src/managerimpl.cpp
View file @
b4082cb0
...
...
@@ -1526,8 +1526,11 @@ ManagerImpl::getCurrentAudioOutputPlugin( void )
void
ManagerImpl
::
initAudioDriver
(
void
)
{
_debugInit
(
"AudioLayer Creation"
);
int
error
;
_debugInit
(
"AudioLayer Creation"
);
if
(
getConfigInt
(
PREFERENCES
,
CONFIG_AUDIO
)
==
ALSA
)
_audiodriver
=
new
AlsaLayer
(
this
);
else
if
(
getConfigInt
(
PREFERENCES
,
CONFIG_AUDIO
)
==
PULSEAUDIO
)
...
...
@@ -1538,7 +1541,7 @@ ManagerImpl::initAudioDriver(void)
if
(
_audiodriver
==
0
)
{
_debug
(
"Init audio driver error
\n
"
);
}
else
{
int
error
=
getAudioDriver
()
->
getErrorMessage
();
error
=
getAudioDriver
()
->
getErrorMessage
();
if
(
error
==
-
1
)
{
_debug
(
"Init audio driver: %i
\n
"
,
error
);
}
...
...
test/configurationTest.cpp
View file @
b4082cb0
...
...
@@ -69,13 +69,17 @@ void ConfigurationTest::testLoadSIPAccount(){
AccountMap
accounts
;
Account
*
current
;
std
::
ostringstream
ss
;
int
nb_account
;
// Must be 1
// Load the accounts from the user file
Manager
::
instance
().
loadAccountMap
();
// Load the account from the user file
nb_account
=
Manager
::
instance
().
loadAccountMap
();
CPPUNIT_ASSERT_EQUAL
(
1
,
nb_account
);
// Save the account information
accounts
=
Manager
::
instance
().
_accountMap
;
AccountMap
::
iterator
iter
=
accounts
.
begin
();
CPPUNIT_ASSERT
(
Manager
::
instance
().
accountExists
(
iter
->
first
)
==
true
);
while
(
iter
!=
accounts
.
end
()
){
current
=
iter
->
second
;
CPPUNIT_ASSERT
(
iter
->
first
==
current
->
getAccountID
()
);
...
...
@@ -96,8 +100,38 @@ void ConfigurationTest::testUnloadSIPAccount(){
accounts
=
Manager
::
instance
().
_accountMap
;
AccountMap
::
iterator
iter
=
accounts
.
begin
();
CPPUNIT_ASSERT
(
Manager
::
instance
().
accountExists
(
iter
->
first
)
==
false
);
if
(
iter
!=
accounts
.
end
()
){
CPPUNIT_FAIL
(
"Unload account map failed
\n
"
);
}
}
void
ConfigurationTest
::
testInitVolume
(){
Manager
::
instance
().
initVolume
();
CPPUNIT_ASSERT
(
Manager
::
instance
().
getConfigInt
(
AUDIO
,
VOLUME_SPKR
)
==
Manager
::
instance
().
getSpkrVolume
()
);
CPPUNIT_ASSERT
(
Manager
::
instance
().
getConfigInt
(
AUDIO
,
VOLUME_MICRO
)
==
Manager
::
instance
().
getMicVolume
()
);
}
void
ConfigurationTest
::
testInitAudioDriver
(){
// Load the audio driver
Manager
::
instance
().
initAudioDriver
();
// Check the creation
if
(
Manager
::
instance
().
getAudioDriver
()
==
NULL
)
CPPUNIT_FAIL
(
"Error while loading audio layer"
);
// Check if it has been created with the right type
if
(
Manager
::
instance
().
getConfigInt
(
PREFERENCES
,
CONFIG_AUDIO
)
==
ALSA
)
CPPUNIT_ASSERT_EQUAL
(
Manager
::
instance
().
getAudioDriver
()
->
getLayerType
(),
ALSA
);
else
if
(
Manager
::
instance
().
getConfigInt
(
PREFERENCES
,
CONFIG_AUDIO
)
==
PULSEAUDIO
)
CPPUNIT_ASSERT_EQUAL
(
Manager
::
instance
().
getAudioDriver
()
->
getLayerType
(),
PULSEAUDIO
);
else
CPPUNIT_FAIL
(
"Wrong audio layer type"
);
}
void
ConfigurationTest
::
testSelectAudioDriver
(){
}
test/configurationTest.h
View file @
b4082cb0
...
...
@@ -27,6 +27,7 @@
// Application import
#include "manager.h"
#include "audio/audiolayer.h"
#include "global.h"
#include "user_cfg.h"
...
...
@@ -50,6 +51,9 @@ class ConfigurationTest : public CppUnit::TestCase {
CPPUNIT_TEST
(
testDefaultValueSignalisation
);
CPPUNIT_TEST
(
testLoadSIPAccount
);
CPPUNIT_TEST
(
testUnloadSIPAccount
);
CPPUNIT_TEST
(
testInitVolume
);
CPPUNIT_TEST
(
testInitAudioDriver
);
CPPUNIT_TEST
(
testSelectAudioDriver
);
CPPUNIT_TEST_SUITE_END
();
public:
...
...
@@ -79,10 +83,22 @@ class ConfigurationTest : public CppUnit::TestCase {
*/
void
testDefaultValuePreferences
();
/*
* Unit tests related to the global settings
*/
void
testDefaultValueSignalisation
();
/*
* Try to load one SIP account.
* So be sure to have only one SIP account so that the test could succeed
*/
void
testLoadSIPAccount
();
void
testUnloadSIPAccount
();
void
testInitVolume
();
void
testInitAudioDriver
();
void
testSelectAudioDriver
();
};
...
...
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