• Home
  • Raw
  • Download

Lines Matching refs:str

61   ap = real_a->str + (real_a->len - c_str_len);  in _dbus_string_ends_with_c_str()
63 a_end = real_a->str + real_a->len; in _dbus_string_ends_with_c_str()
90 _dbus_string_find_byte_backward (const DBusString *str, in _dbus_string_find_byte_backward() argument
96 DBUS_CONST_STRING_PREAMBLE (str); in _dbus_string_find_byte_backward()
104 if (real->str[i] == byte) in _dbus_string_find_byte_backward()
123 test_max_len (DBusString *str, in test_max_len() argument
128 if (!_dbus_string_set_length (str, max_len - 1)) in test_max_len()
132 if (!_dbus_string_set_length (str, max_len)) in test_max_len()
135 if (_dbus_string_set_length (str, max_len + 1)) in test_max_len()
138 if (!_dbus_string_set_length (str, 0)) in test_max_len()
243 set_max_length (DBusString *str, in set_max_length() argument
248 real = (DBusRealString*) str; in set_max_length()
267 DBusString str; in _dbus_string_test() local
279 if (!_dbus_string_init (&str)) in _dbus_string_test()
282 set_max_length (&str, lens[i]); in _dbus_string_test()
284 test_max_len (&str, lens[i]); in _dbus_string_test()
285 _dbus_string_free (&str); in _dbus_string_test()
296 if (!_dbus_string_init (&str)) in _dbus_string_test()
299 set_max_length (&str, lens[i]); in _dbus_string_test()
301 if (!_dbus_string_set_length (&str, lens[i])) in _dbus_string_test()
307 _dbus_assert (_dbus_string_get_length (&str) == j); in _dbus_string_test()
310 _dbus_string_shorten (&str, 1); in _dbus_string_test()
311 _dbus_assert (_dbus_string_get_length (&str) == (j - 1)); in _dbus_string_test()
316 _dbus_string_free (&str); in _dbus_string_test()
322 if (!_dbus_string_init (&str)) in _dbus_string_test()
325 if (!_dbus_string_append (&str, "Hello World")) in _dbus_string_test()
329 _dbus_assert (_dbus_string_equal_substring (&str, 0, 1, &other, 0)); in _dbus_string_test()
330 _dbus_assert (_dbus_string_equal_substring (&str, 1, 0, &other, 1)); in _dbus_string_test()
332 _dbus_assert (_dbus_string_equal_substring (&str, 0, 5, &other, 0)); in _dbus_string_test()
333 _dbus_assert (_dbus_string_equal_substring (&str, 1, 4, &other, 1)); in _dbus_string_test()
334 _dbus_assert (_dbus_string_equal_substring (&str, 2, 3, &other, 2)); in _dbus_string_test()
335 _dbus_assert (_dbus_string_equal_substring (&str, 3, 2, &other, 3)); in _dbus_string_test()
336 _dbus_assert (_dbus_string_equal_substring (&str, 4, 1, &other, 4)); in _dbus_string_test()
337 _dbus_assert (_dbus_string_equal_substring (&str, 5, 0, &other, 5)); in _dbus_string_test()
339 _dbus_assert (_dbus_string_equal_substring (&other, 0, 5, &str, 0)); in _dbus_string_test()
340 _dbus_assert (_dbus_string_equal_substring (&other, 1, 4, &str, 1)); in _dbus_string_test()
341 _dbus_assert (_dbus_string_equal_substring (&other, 2, 3, &str, 2)); in _dbus_string_test()
342 _dbus_assert (_dbus_string_equal_substring (&other, 3, 2, &str, 3)); in _dbus_string_test()
343 _dbus_assert (_dbus_string_equal_substring (&other, 4, 1, &str, 4)); in _dbus_string_test()
344 _dbus_assert (_dbus_string_equal_substring (&other, 5, 0, &str, 5)); in _dbus_string_test()
348 _dbus_assert (_dbus_string_equal_substring (&str, 6, 5, &other, 0)); in _dbus_string_test()
349 _dbus_assert (_dbus_string_equal_substring (&str, 7, 4, &other, 1)); in _dbus_string_test()
350 _dbus_assert (_dbus_string_equal_substring (&str, 8, 3, &other, 2)); in _dbus_string_test()
351 _dbus_assert (_dbus_string_equal_substring (&str, 9, 2, &other, 3)); in _dbus_string_test()
352 _dbus_assert (_dbus_string_equal_substring (&str, 10, 1, &other, 4)); in _dbus_string_test()
353 _dbus_assert (_dbus_string_equal_substring (&str, 11, 0, &other, 5)); in _dbus_string_test()
355 _dbus_assert (_dbus_string_equal_substring (&other, 0, 5, &str, 6)); in _dbus_string_test()
356 _dbus_assert (_dbus_string_equal_substring (&other, 1, 4, &str, 7)); in _dbus_string_test()
357 _dbus_assert (_dbus_string_equal_substring (&other, 2, 3, &str, 8)); in _dbus_string_test()
358 _dbus_assert (_dbus_string_equal_substring (&other, 3, 2, &str, 9)); in _dbus_string_test()
359 _dbus_assert (_dbus_string_equal_substring (&other, 4, 1, &str, 10)); in _dbus_string_test()
360 _dbus_assert (_dbus_string_equal_substring (&other, 5, 0, &str, 11)); in _dbus_string_test()
362 _dbus_string_free (&str); in _dbus_string_test()
365 if (!_dbus_string_init (&str)) in _dbus_string_test()
371 if (!_dbus_string_append (&str, "a")) in _dbus_string_test()
374 _dbus_assert (_dbus_string_get_length (&str) == i * 2 + 1); in _dbus_string_test()
376 if (!_dbus_string_append_byte (&str, 'b')) in _dbus_string_test()
379 _dbus_assert (_dbus_string_get_length (&str) == i * 2 + 2); in _dbus_string_test()
384 _dbus_string_free (&str); in _dbus_string_test()
388 if (!_dbus_string_init (&str)) in _dbus_string_test()
391 if (!_dbus_string_append (&str, "Hello World")) in _dbus_string_test()
394 i = _dbus_string_get_length (&str); in _dbus_string_test()
396 if (!_dbus_string_steal_data (&str, &s)) in _dbus_string_test()
399 _dbus_assert (_dbus_string_get_length (&str) == 0); in _dbus_string_test()
406 if (!_dbus_string_append (&str, "Hello World")) in _dbus_string_test()
409 i = _dbus_string_get_length (&str); in _dbus_string_test()
414 if (!_dbus_string_move (&str, 0, &other, 0)) in _dbus_string_test()
417 _dbus_assert (_dbus_string_get_length (&str) == 0); in _dbus_string_test()
420 if (!_dbus_string_append (&str, "Hello World")) in _dbus_string_test()
423 if (!_dbus_string_move (&str, 0, &other, _dbus_string_get_length (&other))) in _dbus_string_test()
426 _dbus_assert (_dbus_string_get_length (&str) == 0); in _dbus_string_test()
429 if (!_dbus_string_append (&str, "Hello World")) in _dbus_string_test()
432 if (!_dbus_string_move (&str, 0, &other, _dbus_string_get_length (&other) / 2)) in _dbus_string_test()
435 _dbus_assert (_dbus_string_get_length (&str) == 0); in _dbus_string_test()
442 if (!_dbus_string_append (&str, "Hello World")) in _dbus_string_test()
445 i = _dbus_string_get_length (&str); in _dbus_string_test()
450 if (!_dbus_string_copy (&str, 0, &other, 0)) in _dbus_string_test()
453 _dbus_assert (_dbus_string_get_length (&str) == i); in _dbus_string_test()
456 if (!_dbus_string_copy (&str, 0, &other, _dbus_string_get_length (&other))) in _dbus_string_test()
459 _dbus_assert (_dbus_string_get_length (&str) == i); in _dbus_string_test()
464 if (!_dbus_string_copy (&str, 0, &other, _dbus_string_get_length (&other) / 2)) in _dbus_string_test()
467 _dbus_assert (_dbus_string_get_length (&str) == i); in _dbus_string_test()
472 _dbus_string_free (&str); in _dbus_string_test()
477 if (!_dbus_string_init (&str)) in _dbus_string_test()
480 if (!_dbus_string_append (&str, "Hello World")) in _dbus_string_test()
483 i = _dbus_string_get_length (&str); in _dbus_string_test()
488 if (!_dbus_string_replace_len (&str, 0, _dbus_string_get_length (&str), in _dbus_string_test()
492 _dbus_assert (_dbus_string_get_length (&str) == i); in _dbus_string_test()
496 if (!_dbus_string_replace_len (&str, 0, _dbus_string_get_length (&str), in _dbus_string_test()
500 _dbus_assert (_dbus_string_get_length (&str) == i); in _dbus_string_test()
506 if (!_dbus_string_replace_len (&str, 1, 1, in _dbus_string_test()
512 _dbus_assert (_dbus_string_get_length (&str) == i); in _dbus_string_test()
517 _dbus_string_free (&str); in _dbus_string_test()
522 if (!_dbus_string_init (&str)) in _dbus_string_test()
526 if (!_dbus_string_append_unichar (&str, 0xfffc)) in _dbus_string_test()
529 _dbus_string_get_unichar (&str, 0, &ch, &i); in _dbus_string_test()
532 _dbus_assert (i == _dbus_string_get_length (&str)); in _dbus_string_test()
534 _dbus_string_free (&str); in _dbus_string_test()
538 if (!_dbus_string_init (&str)) in _dbus_string_test()
541 if (!_dbus_string_append (&str, "Hello")) in _dbus_string_test()
544 _dbus_assert (_dbus_string_get_byte (&str, 0) == 'H'); in _dbus_string_test()
545 _dbus_assert (_dbus_string_get_byte (&str, 1) == 'e'); in _dbus_string_test()
546 _dbus_assert (_dbus_string_get_byte (&str, 2) == 'l'); in _dbus_string_test()
547 _dbus_assert (_dbus_string_get_byte (&str, 3) == 'l'); in _dbus_string_test()
548 _dbus_assert (_dbus_string_get_byte (&str, 4) == 'o'); in _dbus_string_test()
550 _dbus_string_set_byte (&str, 1, 'q'); in _dbus_string_test()
551 _dbus_assert (_dbus_string_get_byte (&str, 1) == 'q'); in _dbus_string_test()
553 if (!_dbus_string_insert_bytes (&str, 0, 1, 255)) in _dbus_string_test()
556 if (!_dbus_string_insert_bytes (&str, 2, 4, 'Z')) in _dbus_string_test()
559 if (!_dbus_string_insert_bytes (&str, _dbus_string_get_length (&str), 1, 'W')) in _dbus_string_test()
562 _dbus_assert (_dbus_string_get_byte (&str, 0) == 255); in _dbus_string_test()
563 _dbus_assert (_dbus_string_get_byte (&str, 1) == 'H'); in _dbus_string_test()
564 _dbus_assert (_dbus_string_get_byte (&str, 2) == 'Z'); in _dbus_string_test()
565 _dbus_assert (_dbus_string_get_byte (&str, 3) == 'Z'); in _dbus_string_test()
566 _dbus_assert (_dbus_string_get_byte (&str, 4) == 'Z'); in _dbus_string_test()
567 _dbus_assert (_dbus_string_get_byte (&str, 5) == 'Z'); in _dbus_string_test()
568 _dbus_assert (_dbus_string_get_byte (&str, 6) == 'q'); in _dbus_string_test()
569 _dbus_assert (_dbus_string_get_byte (&str, 7) == 'l'); in _dbus_string_test()
570 _dbus_assert (_dbus_string_get_byte (&str, 8) == 'l'); in _dbus_string_test()
571 _dbus_assert (_dbus_string_get_byte (&str, 9) == 'o'); in _dbus_string_test()
572 _dbus_assert (_dbus_string_get_byte (&str, 10) == 'W'); in _dbus_string_test()
574 _dbus_string_free (&str); in _dbus_string_test()
578 if (!_dbus_string_init (&str)) in _dbus_string_test()
581 if (!_dbus_string_append_int (&str, 27)) in _dbus_string_test()
584 i = _dbus_string_get_length (&str); in _dbus_string_test()
586 if (!_dbus_string_parse_int (&str, 0, &v, &end)) in _dbus_string_test()
592 _dbus_string_free (&str); in _dbus_string_test()
594 if (!_dbus_string_init (&str)) in _dbus_string_test()
597 if (!_dbus_string_append_double (&str, 50.3)) in _dbus_string_test()
600 i = _dbus_string_get_length (&str); in _dbus_string_test()
602 if (!_dbus_string_parse_double (&str, 0, &d, &end)) in _dbus_string_test()
608 _dbus_string_free (&str); in _dbus_string_test()
611 if (!_dbus_string_init (&str)) in _dbus_string_test()
614 if (!_dbus_string_append (&str, "Hello")) in _dbus_string_test()
617 if (!_dbus_string_find (&str, 0, "He", &i)) in _dbus_string_test()
621 if (!_dbus_string_find (&str, 0, "Hello", &i)) in _dbus_string_test()
625 if (!_dbus_string_find (&str, 0, "ello", &i)) in _dbus_string_test()
629 if (!_dbus_string_find (&str, 0, "lo", &i)) in _dbus_string_test()
633 if (!_dbus_string_find (&str, 2, "lo", &i)) in _dbus_string_test()
637 if (_dbus_string_find (&str, 4, "lo", &i)) in _dbus_string_test()
640 if (!_dbus_string_find (&str, 0, "l", &i)) in _dbus_string_test()
644 if (!_dbus_string_find (&str, 0, "H", &i)) in _dbus_string_test()
648 if (!_dbus_string_find (&str, 0, "", &i)) in _dbus_string_test()
652 if (_dbus_string_find (&str, 0, "Hello!", NULL)) in _dbus_string_test()
655 if (_dbus_string_find (&str, 0, "Oh, Hello", NULL)) in _dbus_string_test()
658 if (_dbus_string_find (&str, 0, "ill", NULL)) in _dbus_string_test()
661 if (_dbus_string_find (&str, 0, "q", NULL)) in _dbus_string_test()
664 if (!_dbus_string_find_to (&str, 0, 2, "He", NULL)) in _dbus_string_test()
667 if (_dbus_string_find_to (&str, 0, 2, "Hello", NULL)) in _dbus_string_test()
670 if (!_dbus_string_find_byte_backward (&str, _dbus_string_get_length (&str), 'H', &i)) in _dbus_string_test()
674 if (!_dbus_string_find_byte_backward (&str, _dbus_string_get_length (&str), 'o', &i)) in _dbus_string_test()
676 _dbus_assert (i == _dbus_string_get_length (&str) - 1); in _dbus_string_test()
678 if (_dbus_string_find_byte_backward (&str, _dbus_string_get_length (&str) - 1, 'o', &i)) in _dbus_string_test()
682 if (_dbus_string_find_byte_backward (&str, 1, 'e', &i)) in _dbus_string_test()
686 if (!_dbus_string_find_byte_backward (&str, 2, 'e', &i)) in _dbus_string_test()
690 _dbus_string_free (&str); in _dbus_string_test()
693 _dbus_string_init_const (&str, "cafebabe, this is a bogus hex string"); in _dbus_string_test()
697 if (!_dbus_string_hex_decode (&str, 0, &end, &other, 0)) in _dbus_string_test()
706 _dbus_string_free (&str); in _dbus_string_test()
711 _dbus_string_init_const (&str, "012\r\n567\n90"); in _dbus_string_test()
713 if (!_dbus_string_find_eol (&str, 0, &found, &found_len) || found != 3 || found_len != 2) in _dbus_string_test()
718 if (!_dbus_string_find_eol (&str, 5, &found, &found_len)) in _dbus_string_test()
723 if (_dbus_string_find_eol (&str, 9, &found, &found_len)) in _dbus_string_test()
730 _dbus_string_init_const (&str, ""); in _dbus_string_test()
731 if (_dbus_string_find_eol (&str, 0, &found, &found_len)) in _dbus_string_test()
738 _dbus_string_init_const (&str, "foobar"); in _dbus_string_test()
739 if (_dbus_string_find_eol (&str, 0, &found, &found_len)) in _dbus_string_test()
746 _dbus_string_init_const (&str, "foobar\n"); in _dbus_string_test()
747 if (!_dbus_string_find_eol (&str, 0, &found, &found_len)) in _dbus_string_test()
762 if (!_dbus_string_init (&str)) in _dbus_string_test()
765 if (!_dbus_string_append (&str, FIRST_LINE "\n" SECOND_LINE "\r\n" THIRD_LINE "\n" FOURTH_LINE)) in _dbus_string_test()
771 if (!_dbus_string_pop_line (&str, &line)) in _dbus_string_test()
776 if (!_dbus_string_pop_line (&str, &line)) in _dbus_string_test()
781 if (!_dbus_string_pop_line (&str, &line)) in _dbus_string_test()
786 if (!_dbus_string_pop_line (&str, &line)) in _dbus_string_test()
791 _dbus_string_free (&str); in _dbus_string_test()
796 if (!_dbus_string_init (&str)) in _dbus_string_test()
800 if (!_dbus_string_append (&str, "abcdefghijklmnopqrstuvwxyz")) in _dbus_string_test()
803 if (!_dbus_string_set_length (&str, 10)) in _dbus_string_test()
807 if (!_dbus_string_compact (&str, 2048)) in _dbus_string_test()
811 if (((DBusRealString *)&str)->allocated > 30) in _dbus_string_test()
814 if (!_dbus_string_equal_c_str (&str, "abcdefghij")) in _dbus_string_test()
818 if (!_dbus_string_compact (&str, 2048)) in _dbus_string_test()
821 if (!_dbus_string_equal_c_str (&str, "abcdefghij")) in _dbus_string_test()
825 if (!_dbus_string_append (&str, "123456")) in _dbus_string_test()
828 if (!_dbus_string_equal_c_str (&str, "abcdefghij123456")) in _dbus_string_test()
832 if (!_dbus_string_compact (&str, 20000)) in _dbus_string_test()
836 if (!_dbus_string_compact (&str, 0)) in _dbus_string_test()
839 if (!_dbus_string_equal_c_str (&str, "abcdefghij123456")) in _dbus_string_test()
842 if (!_dbus_string_append (&str, "!@#$%")) in _dbus_string_test()
845 if (!_dbus_string_equal_c_str (&str, "abcdefghij123456!@#$%")) in _dbus_string_test()
848 _dbus_string_free (&str); in _dbus_string_test()
854 if (!_dbus_string_init (&str)) in _dbus_string_test()
860 if (!_dbus_string_append (&str, two_strings)) in _dbus_string_test()
863 if (!_dbus_string_split_on_byte (&str, '\t', &other)) in _dbus_string_test()
866 if (strcmp (_dbus_string_get_data (&str), "one") != 0) in _dbus_string_test()
872 _dbus_string_free (&str); in _dbus_string_test()
881 if (!_dbus_string_init (&str)) in _dbus_string_test()
884 if (!_dbus_string_append (&str, upper_string)) in _dbus_string_test()
887 _dbus_string_tolower_ascii (&str, 0, _dbus_string_get_length(&str)); in _dbus_string_test()
889 if (!_dbus_string_equal_c_str (&str, lower_string)) in _dbus_string_test()
892 _dbus_string_free (&str); in _dbus_string_test()
894 if (!_dbus_string_init (&str)) in _dbus_string_test()
897 if (!_dbus_string_append (&str, upper_string)) in _dbus_string_test()
900 _dbus_string_tolower_ascii (&str, 0, 7); in _dbus_string_test()
902 if (!_dbus_string_equal_c_str (&str, lower2_string)) in _dbus_string_test()
905 _dbus_string_free (&str); in _dbus_string_test()
913 if (!_dbus_string_init (&str)) in _dbus_string_test()
916 if (!_dbus_string_append (&str, lower_string)) in _dbus_string_test()
919 _dbus_string_toupper_ascii (&str, 0, _dbus_string_get_length(&str)); in _dbus_string_test()
921 if (!_dbus_string_equal_c_str (&str, upper_string)) in _dbus_string_test()
924 _dbus_string_free (&str); in _dbus_string_test()
926 if (!_dbus_string_init (&str)) in _dbus_string_test()
929 if (!_dbus_string_append (&str, lower_string)) in _dbus_string_test()
932 _dbus_string_toupper_ascii (&str, 0, 7); in _dbus_string_test()
934 if (!_dbus_string_equal_c_str (&str, upper2_string)) in _dbus_string_test()
937 _dbus_string_free (&str); in _dbus_string_test()