diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2018-06-12 14:05:02 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2018-06-12 14:06:25 +0100 |
commit | 25012bf96c3ec6ae54dd2f31f1de4cadb671c9fd (patch) | |
tree | e8a9a9a6c0a53b79546117215d93295397da2d6b /glib/tests | |
parent | b606ce30a2aadd7f393777634b5fd3cdd6258f3d (diff) | |
download | glib-refcount-box.tar.gz |
Add length accessor for GRefStringrefcount-box
Since we store the size of the allocation in the underlying ArcBox, we
can get a constant time getter for the length of the string.
Diffstat (limited to 'glib/tests')
-rw-r--r-- | glib/tests/refstring.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/glib/tests/refstring.c b/glib/tests/refstring.c index 0181be945..67b3ca302 100644 --- a/glib/tests/refstring.c +++ b/glib/tests/refstring.c @@ -28,6 +28,7 @@ test_refstring_base (void) g_test_message ("s = '%s' (%p)", s, s); g_assert_cmpint (strcmp (s, "hello, world"), ==, 0); g_assert_cmpint (strlen (s), ==, strlen ("hello, world")); + g_assert_cmpuint (g_ref_string_length (s), ==, strlen ("hello, world")); g_ref_string_release (s); } |