summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2011-12-02 15:33:52 +0100
committerDavid Herrmann <dh.herrmann@googlemail.com>2011-12-02 15:33:52 +0100
commit9d2fe62bd9d12f017a8777d53232f7d25e21b80e (patch)
tree6c4afab61b1ef6ccda019cedbd64616288cf2247 /tests
parent3aad1107d88ec410b3f2d740c03aef896c3594d2 (diff)
test_output: Use log API
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_console.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/test_console.c b/tests/test_console.c
index eb70463..6eab19a 100644
--- a/tests/test_console.c
+++ b/tests/test_console.c
@@ -46,7 +46,6 @@
#include <inttypes.h>
#include <locale.h>
#include <signal.h>
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -54,6 +53,7 @@
#include <GL/gl.h>
#include <GL/glext.h>
#include "console.h"
+#include "log.h"
#include "output.h"
static volatile sig_atomic_t terminate;
@@ -76,7 +76,7 @@ static int map_outputs(struct kmscon_compositor *comp,
ret = kmscon_output_use(iter);
if (ret) {
- printf("Cannot use output %p: %d\n", iter, ret);
+ log_warning("Cannot use output %p: %d\n", iter, ret);
continue;
}
@@ -87,7 +87,7 @@ static int map_outputs(struct kmscon_compositor *comp,
ret = kmscon_output_swap(iter);
if (ret) {
- printf("Cannot swap buffers of output %p: %d\n",
+ log_warning("Cannot swap buffers of output %p: %d\n",
iter, ret);
continue;
}
@@ -109,10 +109,10 @@ static int run_console(struct kmscon_compositor *comp)
iter = kmscon_compositor_get_outputs(comp);
for ( ; iter; iter = kmscon_output_next(iter)) {
- printf("Activating output %p...\n", iter);
+ log_info("Activating output %p...\n", iter);
ret = kmscon_output_activate(iter, NULL);
if (ret) {
- printf("Cannot activate output: %d\n", ret);
+ log_err("Cannot activate output: %d\n", ret);
continue;
}
@@ -126,19 +126,19 @@ static int run_console(struct kmscon_compositor *comp)
}
if (max_x == 0 || max_y == 0) {
- printf("Cannot retrieve output resolution\n");
+ log_err("Cannot retrieve output resolution\n");
return -EINVAL;
}
ret = kmscon_console_new(&con);
if (ret) {
- printf("Cannot create console: %d\n", ret);
+ log_err("Cannot create console: %d\n", ret);
return ret;
}
ret = kmscon_console_set_res(con, max_x, max_y);
if (ret) {
- printf("Cannot set console resolution: %d\n", ret);
+ log_err("Cannot set console resolution: %d\n", ret);
goto err_unref;
}
@@ -148,7 +148,7 @@ static int run_console(struct kmscon_compositor *comp)
usleep(10000);
}
- printf("Terminating due to user request\n");
+ log_info("Terminating due to user request\n");
err_unref:
kmscon_console_unref(con);
@@ -170,18 +170,18 @@ int main(int argc, char **argv)
ret = kmscon_compositor_new(&comp);
if (ret) {
- printf("Cannot create compositor: %d\n", ret);
+ log_err("Cannot create compositor: %d\n", ret);
return abs(ret);
}
ret = kmscon_compositor_wake_up(comp);
if (ret < 0) {
- printf("Cannot wake up compositor: %d\n", ret);
+ log_err("Cannot wake up compositor: %d\n", ret);
goto err_unref;
}
if (ret == 0) {
- printf("No output available\n");
+ log_err("No output available\n");
ret = -EINVAL;
goto err_unref;
}