Commit 113dece9 authored by jehan's avatar jehan

fix liblinphone android tester

parent 48a2e662
......@@ -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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment