mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-30 20:33:08 +02:00
Improve GChecksum test coverage
This commit is contained in:
parent
4971c43da8
commit
e02d8165d9
@ -593,6 +593,7 @@ test_checksum (gconstpointer d)
|
|||||||
{
|
{
|
||||||
const ChecksumTest *test = d;
|
const ChecksumTest *test = d;
|
||||||
GChecksum *checksum;
|
GChecksum *checksum;
|
||||||
|
GChecksum *checksum2;
|
||||||
const char *p;
|
const char *p;
|
||||||
int chunk_length;
|
int chunk_length;
|
||||||
|
|
||||||
@ -604,9 +605,12 @@ test_checksum (gconstpointer d)
|
|||||||
g_checksum_update (checksum, (const guchar *)p,
|
g_checksum_update (checksum, (const guchar *)p,
|
||||||
MIN (chunk_length, test->length - (p - FIXED_STR)));
|
MIN (chunk_length, test->length - (p - FIXED_STR)));
|
||||||
}
|
}
|
||||||
|
checksum2 = g_checksum_copy (checksum);
|
||||||
g_assert_cmpstr (g_checksum_get_string (checksum), ==, test->sum);
|
g_assert_cmpstr (g_checksum_get_string (checksum), ==, test->sum);
|
||||||
g_checksum_free (checksum);
|
g_checksum_free (checksum);
|
||||||
|
|
||||||
|
g_assert_cmpstr (g_checksum_get_string (checksum2), ==, test->sum);
|
||||||
|
g_checksum_free (checksum2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user