From 695a864c2a705a6f3078216497648c7113a37419 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 30 Jun 2008 22:40:13 +0000 Subject: [PATCH] =?UTF-8?q?=20=20=20=20=20=20=20=20Bug=20502511=20?= =?UTF-8?q?=E2=80=93=20g=5Fassert=5Fcmphex=20prints=20invalid=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * glib/gtestutils.c (g_assertion_message_cmpnum): Actually print hex numbers in hex. Pointed out by Tor Lillqvist svn path=/branches/glib-2-16/; revision=7115 --- ChangeLog | 10 ++++++++++ glib/gtestutils.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b541d1ab5..726951d4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-06-30 Matthias Clasen + + Backport from trunk: + + Bug 502511 – g_assert_cmphex prints invalid message + + * glib/gtestutils.c (g_assertion_message_cmpnum): Actually print + hex numbers in hex. + Pointed out by Tor Lillqvist + 2008-06-30 Matthias Clasen Backport from trunk: diff --git a/glib/gtestutils.c b/glib/gtestutils.c index 13f670dd0..b39b94014 100644 --- a/glib/gtestutils.c +++ b/glib/gtestutils.c @@ -1245,7 +1245,7 @@ g_assertion_message_cmpnum (const char *domain, switch (numtype) { case 'i': s = g_strdup_printf ("assertion failed (%s): (%.0Lf %s %.0Lf)", expr, arg1, cmp, arg2); break; - case 'x': s = g_strdup_printf ("assertion failed (%s): (0x%08" G_GUINT64_FORMAT " %s 0x%08" G_GUINT64_FORMAT ")", expr, (guint64) arg1, cmp, (guint64) arg2); break; + case 'x': s = g_strdup_printf ("assertion failed (%s): (0x%08" G_GINT64_MODIFIER "x %s 0x%08" G_GINT64_MODIFIER "x)", expr, (guint64) arg1, cmp, (guint64) arg2); break; case 'f': s = g_strdup_printf ("assertion failed (%s): (%.9Lg %s %.9Lg)", expr, arg1, cmp, arg2); break; /* ideally use: floats=%.7g double=%.17g */ }