diff options
author | Alex Chronopoulos <[email protected]> | 2017-02-03 18:38:45 +0200 |
---|---|---|
committer | Paul Adenot <[email protected]> | 2017-02-06 16:02:27 +0100 |
commit | 2fb0dfc35d752e936433cbf276169897a6365d5f (patch) | |
tree | 5394e17dd424b207fab54ae65cd7afd2a68709ac /test | |
parent | 490e379b1caa4825e547aca287f06319cf042b9c (diff) | |
download | cubeb-2fb0dfc35d752e936433cbf276169897a6365d5f.tar.gz cubeb-2fb0dfc35d752e936433cbf276169897a6365d5f.zip |
tests: add log method in common and set callback in test_record
Diffstat (limited to 'test')
-rw-r--r-- | test/common.h | 10 | ||||
-rw-r--r-- | test/test_record.cpp | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/test/common.h b/test/common.h index d6d6e34..7e733cf 100644 --- a/test/common.h +++ b/test/common.h @@ -16,6 +16,8 @@ #include <unistd.h> #endif +#include <cstdarg> + template<typename T, size_t N> constexpr size_t ARRAY_LENGTH(T(&)[N]) @@ -96,4 +98,12 @@ int has_available_input_device(cubeb * ctx) return 1; } +void print_log(const char * msg, ...) +{ + va_list args; + va_start(args, msg); + vprintf(msg, args); + va_end(args); +} + #endif /* TEST_COMMON */ diff --git a/test/test_record.cpp b/test/test_record.cpp index 1ce8582..677e299 100644 --- a/test/test_record.cpp +++ b/test/test_record.cpp @@ -67,6 +67,9 @@ void state_cb_record(cubeb_stream * stream, void * /*user*/, cubeb_state state) TEST(cubeb, record) { + if (cubeb_set_log_callback(CUBEB_LOG_DISABLED, nullptr /*print_log*/) != CUBEB_OK) { + printf("Set log callback failed\n"); + } cubeb *ctx; cubeb_stream *stream; cubeb_stream_params params; |