Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Bug 502511 – g_assert_cmphex prints invalid message
Browse files Browse the repository at this point in the history
        * 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
  • Loading branch information
Matthias Clasen committed Jun 30, 2008
1 parent 281f4c5 commit 695a864
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions ChangeLog
@@ -1,3 +1,13 @@
2008-06-30 Matthias Clasen <mclasen@redhat.com>

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 <mclasen@redhat.com>

Backport from trunk:
Expand Down
2 changes: 1 addition & 1 deletion glib/gtestutils.c
Expand Up @@ -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 */
}
Expand Down

0 comments on commit 695a864

Please sign in to comment.