[tracker/wip/sam/meson: 120/124] 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/wip/sam/meson: 120/124] tests: Fix invalid call to tracker_getline in libtracker-extract test
- Date: Sun, 30 Oct 2016 20:55:02 +0000 (UTC)
commit b71b536daa1361efa7062e70e8e3ed4b65d73852
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]