[tracker] tests: Fix invalid call to tracker_getline in libtracker-extract test
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tests: Fix invalid call to tracker_getline in libtracker-extract test
- Date: Mon, 21 Nov 2016 18:42:04 +0000 (UTC)
commit 723b393b67b44479b28cf182834b91c06a01cb2c
Author: Sam Thursfield <sam afuera me uk>
Date: Sun Oct 30 18:50:15 2016 +0000
tests: Fix invalid call to tracker_getline in libtracker-extract test
The test passes when used with glibc's getline(), but the fallback
implementation we ship will return EINVAL if the size pointer is not set
to zero before the call. The man page suggests that this is valid
behaviour for a getline() implementation, so let's fix the test.
tests/libtracker-extract/tracker-test-utils.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/tests/libtracker-extract/tracker-test-utils.c b/tests/libtracker-extract/tracker-test-utils.c
index fce4643..33cd685 100644
--- a/tests/libtracker-extract/tracker-test-utils.c
+++ b/tests/libtracker-extract/tracker-test-utils.c
@@ -263,7 +263,7 @@ test_getline (void)
{
FILE *f;
gchar *line = NULL;
- gsize n;
+ gsize n = 0;
f = fopen (TOP_SRCDIR "/tests/libtracker-extract/getline-test.txt", "r");
g_assert_cmpint (tracker_getline (&line, &n, f), >, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]