Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
c03389c1
Commit
c03389c1
authored
Mar 20, 2015
by
Gautier Pelloux-Prayer
Browse files
bc_tester_utils.c: use tester_printf instead of fprintf and fix android log handling
parent
66fa2a03
Changes
3
Hide whitespace changes
Inline
Side-by-side
mediastreamer2
@
ffbe08f5
Subproject commit
29402bc07879edf7895780fc85f72664e1b725c3
Subproject commit
ffbe08f56dfb2e5f7aa70d5ac6ab5a84d0a7acc1
tester/common/bc_tester_utils.c
View file @
c03389c1
...
...
@@ -115,7 +115,7 @@ int bc_tester_nb_tests(const char *suite_name) {
void
bc_tester_list_suites
()
{
int
j
;
for
(
j
=
0
;
j
<
nb_test_suites
;
j
++
)
{
fprintf
(
stdout
,
"%s
\n
"
,
bc_tester_suite_name
(
j
));
tester_printf
(
verbosity_info
,
"%s
\n
"
,
bc_tester_suite_name
(
j
));
}
}
...
...
@@ -123,7 +123,7 @@ void bc_tester_list_tests(const char *suite_name) {
int
j
;
for
(
j
=
0
;
j
<
bc_tester_nb_tests
(
suite_name
);
j
++
)
{
const
char
*
test_name
=
bc_tester_test_name
(
suite_name
,
j
);
fprintf
(
stdout
,
"%s
\n
"
,
test_name
);
tester_printf
(
verbosity_info
,
"%s
\n
"
,
test_name
);
}
}
...
...
@@ -252,7 +252,7 @@ int bc_tester_run_tests(const char *suite_name, const char *test_name) {
void
bc_tester_helper
(
const
char
*
name
,
const
char
*
additionnal_helper
)
{
fprintf
(
stdout
,
"%s --help
\n
"
tester_printf
(
verbosity_info
,
"%s --help
\n
"
"
\t\t\t
--list-suites
\n
"
"
\t\t\t
--list-tests <suite>
\n
"
"
\t\t\t
--suite <suite name>
\n
"
...
...
@@ -277,7 +277,6 @@ void bc_tester_init(void (*ftester_printf)(int level, const char *fmt, va_list a
int
bc_tester_parse_args
(
int
argc
,
char
**
argv
,
int
argid
)
{
int
i
=
argid
;
if
(
strcmp
(
argv
[
i
],
"--help"
)
==
0
){
return
-
1
;
}
else
if
(
strcmp
(
argv
[
i
],
"--test"
)
==
0
){
...
...
@@ -301,12 +300,12 @@ int bc_tester_parse_args(int argc, char **argv, int argid)
}
else
if
(
strcmp
(
argv
[
i
],
"--xml"
)
==
0
){
xml_enabled
=
1
;
}
else
{
fprintf
(
stder
r
,
"Unknown option
\"
%s
\"\n
"
,
argv
[
i
]);
tester_printf
(
verbosity_erro
r
,
"Unknown option
\"
%s
\"\n
"
,
argv
[
i
]);
return
-
1
;
}
if
(
xml_enabled
&&
(
suite_name
||
test_name
)
){
fprintf
(
stder
r
,
"Cannot use both XML and specific test suite
\n
"
);
tester_printf
(
verbosity_erro
r
,
"Cannot use both XML and specific test suite
\n
"
);
return
-
1
;
}
...
...
tester/liblinphone_tester.c
View file @
c03389c1
...
...
@@ -132,8 +132,13 @@ static void liblinphone_tester_qnx_log_handler(OrtpLogLevel lev, const char *fmt
#endif
/* __QNX__ */
static
void
log_handler
(
int
lev
,
const
char
*
fmt
,
va_list
args
)
{
#ifdef ANDROID
/* IMPORTANT: needed by liblinphone tester to retrieve suite list...*/
cunit_android_trace_handler
(
lev
==
ORTP_ERROR
,
fmt
,
args
);
#else
ortp_set_log_file
(
stderr
);
ortp_log_handler
(
lev
,
fmt
,
args
);
#endif
if
(
log_file
){
ortp_set_log_file
(
log_file
);
ortp_log_handler
(
lev
,
fmt
,
args
);
...
...
@@ -141,7 +146,6 @@ static void log_handler(int lev, const char *fmt, va_list args) {
}
void
liblinphone_tester_init
(
void
)
{
ortp_log_handler
=
ortp_get_log_handler
();
#if defined(ANDROID)
linphone_core_set_log_handler
(
liblinphone_android_ortp_log_handler
);
#elif defined(__QNX__)
...
...
@@ -149,6 +153,7 @@ void liblinphone_tester_init(void) {
#else
linphone_core_set_log_handler
(
ortp_logv_out
);
#endif
ortp_log_handler
=
ortp_get_log_handler
();
bc_tester_init
(
log_handler
,
ORTP_MESSAGE
,
ORTP_ERROR
);
liblinphone_tester_add_suites
();
...
...
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