[glib: 3/4] tests: Remove redundant non-NULL checks in g_strlcat() test
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 3/4] tests: Remove redundant non-NULL checks in g_strlcat() test
- Date: Thu, 2 May 2019 14:56:02 +0000 (UTC)
commit 81ba6e54fe7ecbf1b8e179ca103c78a1bd9de7b5
Author: Philip Withnall <withnall endlessm com>
Date: Thu May 2 13:28:55 2019 +0100
tests: Remove redundant non-NULL checks in g_strlcat() test
The buffer is a local array, not a pointer, so can never be NULL.
Signed-off-by: Philip Withnall <withnall endlessm com>
glib/tests/strfuncs.c | 5 -----
1 file changed, 5 deletions(-)
---
diff --git a/glib/tests/strfuncs.c b/glib/tests/strfuncs.c
index e3d27e244..e1f9619c7 100644
--- a/glib/tests/strfuncs.c
+++ b/glib/tests/strfuncs.c
@@ -342,31 +342,26 @@ test_strlcat (void)
* for testing purposes. */
g_assert_cmpuint (strlen (str) + 1, <=, sizeof (str_cpy));
str_cpy_size = g_strlcat (str_cpy, str, strlen (str) + 1);
- g_assert_nonnull (str_cpy);
g_assert_cmpstr (str, ==, str_cpy);
g_assert_cmpint (str_cpy_size, ==, strlen (str));
g_assert_cmpuint (strlen (str), <=, sizeof (str_cpy));
str_cpy_size = g_strlcat (str_cpy, str, strlen (str));
- g_assert_nonnull (str_cpy);
g_assert_cmpstr (str, ==, str_cpy);
g_assert_cmpint (str_cpy_size, ==, 2 * strlen (str));
g_assert_cmpuint (strlen (str) - 15, <=, sizeof (str_cpy));
str_cpy_size = g_strlcat (str_cpy, str, strlen (str) - 15);
- g_assert_nonnull (str_cpy);
g_assert_cmpstr (str, ==, str_cpy);
g_assert_cmpint (str_cpy_size, ==, 2 * strlen (str) - 15);
g_assert_cmpuint (0, <=, sizeof (str_cpy));
str_cpy_size = g_strlcat (str_cpy, str, 0);
- g_assert_nonnull (str_cpy);
g_assert_cmpstr (str, ==, str_cpy);
g_assert_cmpint (str_cpy_size, ==, strlen (str));
g_assert_cmpuint (strlen (str) + 15, <=, sizeof (str_cpy));
str_cpy_size = g_strlcat (str_cpy, str, strlen (str) + 15);
- g_assert_nonnull (str_cpy);
g_assert_cmpstr ("The quick brown fox jumps over the lazy dogThe quick brow",
==, str_cpy);
g_assert_cmpint (str_cpy_size, ==, 2 * strlen (str));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]