[libgdata] tests: Fix use of an unsigned variable as signed
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata] tests: Fix use of an unsigned variable as signed
- Date: Wed, 25 Jan 2017 00:40:22 +0000 (UTC)
commit 2ad79db3a3e9c315152b3470a6cb2fba644d7ac8
Author: Philip Withnall <philip tecnocode co uk>
Date: Wed Jan 25 00:34:13 2017 +0000
tests: Fix use of an unsigned variable as signed
This code was supposed to be using a signed variable for the comparison,
but accidentally ended up using a signed one (and the wrong abs()
function). Fix that.
Spotted by Clang.
gdata/tests/picasaweb.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdata/tests/picasaweb.c b/gdata/tests/picasaweb.c
index 6a9f71e..b77f7c8 100644
--- a/gdata/tests/picasaweb.c
+++ b/gdata/tests/picasaweb.c
@@ -1778,7 +1778,7 @@ test_album_new (void)
gchar *xml, *parsed_time_str;
GRegex *regex;
GMatchInfo *match_info;
- guint64 delta;
+ gint64 delta;
GTimeVal timeval;
g_test_bug ("598893");
@@ -1818,7 +1818,7 @@ test_album_new (void)
g_assert (g_regex_match (regex, xml, 0, &match_info) == TRUE);
parsed_time_str = g_match_info_fetch (match_info, 2);
delta = g_ascii_strtoull (parsed_time_str, NULL, 10) - (((guint64) timeval.tv_sec) * 1000 +
((guint64) timeval.tv_usec) / 1000);
- g_assert_cmpuint (abs (delta), <, 1000);
+ g_assert_cmpuint (ABS (delta), <, 1000);
g_free (parsed_time_str);
g_free (xml);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]