+ _dbus_assert (_dbus_string_get_length (&str) == i);
+ _dbus_assert (_dbus_string_get_length (&other) == a + 6);
+ _dbus_assert (_dbus_string_equal_c_str (&other,
+ "Foo Hello String"));
+
+ if (!_dbus_string_replace_len (&str, 5, 6,
+ &other,
+ _dbus_string_get_length (&other),
+ 0))
+ _dbus_assert_not_reached ("could not replace at the end");
+
+ _dbus_assert (_dbus_string_get_length (&str) == i);
+ _dbus_assert (_dbus_string_get_length (&other) == a + 6 + 6);
+ _dbus_assert (_dbus_string_equal_c_str (&other,
+ "Foo Hello String World"));
+
+ if (!_dbus_string_replace_len (&str, 0, 5,
+ &other,
+ _dbus_string_get_length (&other) - 5,
+ 5))
+ _dbus_assert_not_reached ("could not replace same length");
+
+ _dbus_assert (_dbus_string_get_length (&str) == i);
+ _dbus_assert (_dbus_string_get_length (&other) == a + 6 + 6);
+ _dbus_assert (_dbus_string_equal_c_str (&other,
+ "Foo Hello String Hello"));
+
+ if (!_dbus_string_replace_len (&str, 6, 5,
+ &other, 4, 12))
+ _dbus_assert_not_reached ("could not replace with shorter string");
+
+ _dbus_assert (_dbus_string_get_length (&str) == i);
+ _dbus_assert (_dbus_string_get_length (&other) == a + 5);
+ _dbus_assert (_dbus_string_equal_c_str (&other,
+ "Foo World Hello"));