mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-26 07:38:09 +00:00
fix liblinphone android tester
This commit is contained in:
parent
48a2e6622c
commit
113dece9cc
4 changed files with 25 additions and 8 deletions
|
|
@ -515,7 +515,7 @@ lpc_cmd_help(LinphoneCore *lc, char *arg)
|
|||
i=0;
|
||||
while (advanced_commands[i].help)
|
||||
{
|
||||
linphonec_out("%10.10s\t%s\n", advanced_commands[i].name,
|
||||
linphonec_out("%20.20s\t%s\n", advanced_commands[i].name,
|
||||
advanced_commands[i].help);
|
||||
i++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,9 +27,6 @@
|
|||
|
||||
#ifdef ANDROID
|
||||
|
||||
extern void AndroidPrintf(FILE *stream, const char *fmt, ...);
|
||||
#define fprintf(file, fmt, ...) AndroidPrintf(file, fmt, ##__VA_ARGS__)
|
||||
|
||||
#include <android/log.h>
|
||||
#include <jni.h>
|
||||
#include <CUnit/Util.h>
|
||||
|
|
@ -118,8 +115,9 @@ static void liblinphone_tester_qnx_log_handler(OrtpLogLevel lev, const char *fmt
|
|||
#endif /* __QNX__ */
|
||||
|
||||
|
||||
|
||||
void helper(const char *name) {
|
||||
fprintf(stderr,"%s --help\n"
|
||||
liblinphone_tester_fprintf(stderr,"%s --help\n"
|
||||
"\t\t\t--verbose\n"
|
||||
"\t\t\t--silent\n"
|
||||
"\t\t\t--list-suites\n"
|
||||
|
|
@ -197,7 +195,7 @@ int main (int argc, char *argv[])
|
|||
liblinphone_tester_list_suite_tests(suite_name);
|
||||
return 0;
|
||||
} else {
|
||||
fprintf(stderr, "Unknown option \"%s\"\n", argv[i]); \
|
||||
liblinphone_tester_fprintf(stderr, "Unknown option \"%s\"\n", argv[i]); \
|
||||
helper(argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,5 +248,7 @@ void liblinphone_tester_check_rtcp(LinphoneCoreManager* caller, LinphoneCoreMana
|
|||
void liblinphone_tester_clock_start(MSTimeSpec *start);
|
||||
bool_t liblinphone_tester_clock_elapsed(const MSTimeSpec *start, int value_ms);
|
||||
|
||||
int liblinphone_tester_fprintf(FILE * restrict stream, const char * restrict format, ...);
|
||||
|
||||
#endif /* LIBLINPHONE_TESTER_H_ */
|
||||
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ int liblinphone_tester_test_suite_index(const char *suite_name) {
|
|||
void liblinphone_tester_list_suites() {
|
||||
int j;
|
||||
for(j=0;j<liblinphone_tester_nb_test_suites();j++) {
|
||||
fprintf(stdout, "%s\n", liblinphone_tester_test_suite_name(j));
|
||||
liblinphone_tester_fprintf(stdout, "%s\n", liblinphone_tester_test_suite_name(j));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -302,7 +302,7 @@ void liblinphone_tester_list_suite_tests(const char *suite_name) {
|
|||
int j;
|
||||
for( j = 0; j < liblinphone_tester_nb_tests(suite_name); j++) {
|
||||
const char *test_name = liblinphone_tester_test_name(suite_name, j);
|
||||
fprintf(stdout, "%s\n", test_name);
|
||||
liblinphone_tester_fprintf(stdout, "%s\n", test_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -443,4 +443,21 @@ int liblinphone_tester_run_tests(const char *suite_name, const char *test_name)
|
|||
CU_cleanup_registry();
|
||||
return ret;
|
||||
}
|
||||
#ifdef ANDROID
|
||||
/*implemented in cunit*/
|
||||
extern void AndroidPrintf(FILE *stream, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
int liblinphone_tester_fprintf(FILE * restrict stream, const char * restrict format, ...) {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
int result;
|
||||
#ifndef ANDROID
|
||||
result = vfprintf(stream,format,args);
|
||||
#else
|
||||
/*used by liblinphone tester to retrieve suite list*/
|
||||
result = AndroidPrintf(stream, format, args);
|
||||
#endif
|
||||
va_end(args);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue