mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 23:13:40 +02:00
2007-12-10 15:08:59 Tim Janik <timj@imendio.com> * let g_warn_if_fail replace g_assert as discussed here: http://mail.gnome.org/archives/gtk-devel-list/2007-October/msg00089.html * fix bug #502498: Test framework assertion failures should follow gcc error format. * gmessages.h, gmessages.c: deprecated g_assert_warning() which is unused now. removed g_assert*() definitions whcih are provided by gtestutils.h now. added g_warn_if_reached() and g_warn_if_fail() which are recommended as g_assert/g_assert_not_reached replacements for non-test programs. added g_warn_message() to implement g_warn_*() macros. use emacs-next-error friendly formatting for file:line: for warnings. * gtestutils.h, gtestutils.c: use emacs-next-error friendly formatting. implement g_assert_not_reached() with g_assertion_message() and g_assert() in terms of g_assertion_message_expr() so we'll be able to provide assertion messages in test logs. * gkeyfile.c, gbookmarkfile.c: changed g_assert*() to g_warn_if_fail() or g_return_if_fail() where suitable. * gio/: changed g_assert to g_warn_if_fail. svn path=/trunk/; revision=6086
This commit is contained in:
committed by
Tim Janik
parent
0dbfa89ba1
commit
cc3de68e21
@@ -313,7 +313,7 @@ read_data (GDataInputStream *stream,
|
||||
res = g_input_stream_read (G_INPUT_STREAM (stream),
|
||||
buffer, size,
|
||||
NULL, NULL);
|
||||
g_assert (res == size);
|
||||
g_warn_if_fail (res == size);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -797,7 +797,7 @@ g_data_input_stream_read_line (GDataInputStream *stream,
|
||||
NULL, NULL);
|
||||
if (length)
|
||||
*length = (gsize)found_pos;
|
||||
g_assert (res == found_pos + newline_len);
|
||||
g_warn_if_fail (res == found_pos + newline_len);
|
||||
line[found_pos] = 0;
|
||||
|
||||
return line;
|
||||
@@ -917,7 +917,7 @@ g_data_input_stream_read_until (GDataInputStream *stream,
|
||||
NULL, NULL);
|
||||
if (length)
|
||||
*length = (gsize)found_pos;
|
||||
g_assert (res == found_pos + stop_char_len);
|
||||
g_warn_if_fail (res == found_pos + stop_char_len);
|
||||
data_until[found_pos] = 0;
|
||||
|
||||
return data_until;
|
||||
|
Reference in New Issue
Block a user