Lines Matching refs:ptr1

212   Character *ptr, *ptr1, *ptr2;  member in StringTestState
240 ptr = ptr1 = ptr2 = nullptr; in ResetPointers()
243 ptr1 = glob_ptr1 + alignments[align1_index_]; in ResetPointers()
263 memset(state.ptr1, 'L', state.len[i]); in TEST()
264 state.ptr1[random() % state.len[i]] = '\0'; in TEST()
265 state.ptr1[state.len[i] - 1] = '\0'; in TEST()
267 strcpy(state.ptr + state.MAX_LEN - 1, state.ptr1); in TEST()
269 EXPECT_TRUE(strcat(state.ptr2, state.ptr1) == state.ptr2); in TEST()
442 memset(state.ptr1, ~seek_char, state.len[i]); in TEST()
444 memset(state.ptr1, '\1', state.len[i]); in TEST()
446 state.ptr1[state.len[i] - 1] = '\0'; in TEST()
452 expected = state.ptr1 + state.len[i] - 1; in TEST()
457 state.ptr1[pos] = seek_char; in TEST()
458 expected = state.ptr1 + pos; in TEST()
461 ASSERT_TRUE(strchr(state.ptr1, seek_char) == expected); in TEST()
477 memset(state.ptr1, 'v', state.MAX_LEN); in TEST()
479 state.ptr1[state.len[i] - 1] = '\0'; in TEST()
486 memcpy(state.ptr1, state.ptr2, state.len[i]); in TEST()
488 actual = strcmp(state.ptr1, state.ptr2); in TEST()
490 memcpy(state.ptr1, state.ptr2, pos); in TEST()
491 if (state.ptr1[pos] > state.ptr2[pos]) { in TEST()
493 } else if (state.ptr1[pos] == state.ptr2[pos]) { in TEST()
494 state.ptr1[pos + 1] = '\0'; in TEST()
500 actual = strcmp(state.ptr1, state.ptr2); in TEST()
513 memset(state.ptr1, '\2', pos); in TEST()
514 state.ptr1[pos] = '\0'; in TEST()
515 state.ptr1[state.MAX_LEN - 1] = '\0'; in TEST()
517 memcpy(state.ptr, state.ptr1, state.MAX_LEN); in TEST()
523 memcpy(state.ptr + state.MAX_LEN, state.ptr1, pos + 1); in TEST()
526 ASSERT_TRUE(stpcpy(state.ptr2, state.ptr1) == state.ptr2 + strlen(state.ptr1)); in TEST()
527 ASSERT_FALSE((memcmp(state.ptr1, state.ptr, state.MAX_LEN)) != 0 || in TEST()
537 memset(state.ptr1, '\2', pos); in TEST()
538 state.ptr1[pos] = '\0'; in TEST()
539 state.ptr1[state.MAX_LEN - 1] = '\0'; in TEST()
541 memcpy(state.ptr, state.ptr1, state.MAX_LEN); in TEST()
547 memcpy(state.ptr + state.MAX_LEN, state.ptr1, pos + 1); in TEST()
550 ASSERT_TRUE(strcpy(state.ptr2, state.ptr1) == state.ptr2); in TEST()
551 ASSERT_FALSE((memcmp(state.ptr1, state.ptr, state.MAX_LEN)) != 0 || in TEST()
566 memset(state.ptr1, '\3', pos); in TEST()
567 state.ptr1[pos] = '\0'; in TEST()
569 memcpy(state.ptr + state.MAX_LEN - 1, state.ptr1, pos + 1); in TEST()
571 memcpy(state.ptr + state.MAX_LEN - 1, state.ptr1, state.len[i]); in TEST()
575 strlcat(state.ptr2, state.ptr1, state.MAX_LEN + state.len[i]); in TEST()
590 memset(state.ptr1, rand, state.MAX_LEN); in TEST()
594 state.ptr1[pos] = '\0'; in TEST()
596 memcpy(state.ptr, state.ptr1, state.MAX_LEN); in TEST()
602 memcpy(state.ptr + state.MAX_LEN, state.ptr1, state.MAX_LEN); in TEST()
605 memcpy(state.ptr + state.MAX_LEN, state.ptr1, pos + 1); in TEST()
608 ASSERT_EQ(strlcpy(state.ptr2, state.ptr1, state.MAX_LEN), strlen(state.ptr1)); in TEST()
609 ASSERT_FALSE((memcmp(state.ptr1, state.ptr, state.MAX_LEN) != 0) || in TEST()
625 memset(state.ptr1, 'I', state.len[i]); in TEST()
626 state.ptr1[random() % state.len[i]] = '\0'; in TEST()
627 state.ptr1[state.len[i] - 1] = '\0'; in TEST()
629 size_t pos = strlen(state.ptr1); in TEST()
632 strncpy(state.ptr + state.MAX_LEN - 1, state.ptr1, std::min(actual, pos)); in TEST()
635 ASSERT_TRUE(strncat(state.ptr2, state.ptr1, actual) == state.ptr2); in TEST()
645 memset(state.ptr1, 'v', state.MAX_LEN); in TEST()
647 state.ptr1[state.len[i] - 1] = '\0'; in TEST()
654 memcpy(state.ptr1, state.ptr2, state.len[i]); in TEST()
656 actual = strncmp(state.ptr1, state.ptr2, state.len[i]); in TEST()
658 memcpy(state.ptr1, state.ptr2, pos); in TEST()
659 if (state.ptr1[pos] > state.ptr2[pos]) { in TEST()
661 } else if (state.ptr1[pos] == state.ptr2[pos]) { in TEST()
662 state.ptr1[pos + 1] = '\0'; in TEST()
668 actual = strncmp(state.ptr1, state.ptr2, state.len[i]); in TEST()
679 memset(state.ptr1, 'J', state.MAX_LEN); in TEST()
682 state.ptr1[ptr1_len] = '\0'; in TEST()
684 memcpy(state.ptr, state.ptr1, state.MAX_LEN); in TEST()
693 memcpy(state.ptr + state.MAX_LEN, state.ptr1, copy_len); in TEST()
702 ASSERT_EQ(state.ptr2 + expected_end, stpncpy(state.ptr2, state.ptr1, copy_len)); in TEST()
705 ASSERT_EQ(0, memcmp(state.ptr1, state.ptr, state.MAX_LEN)); in TEST()
716 memset(state.ptr1, 'K', state.MAX_LEN); in TEST()
719 state.ptr1[ptr1_len] = '\0'; in TEST()
721 memcpy(state.ptr, state.ptr1, state.MAX_LEN); in TEST()
730 memcpy(state.ptr + state.MAX_LEN, state.ptr1, copy_len); in TEST()
739 ASSERT_EQ(state.ptr2 + expected_end, stpncpy(state.ptr2, state.ptr1, copy_len)); in TEST()
742 ASSERT_EQ(0, memcmp(state.ptr1, state.ptr, state.MAX_LEN)); in TEST()
754 memset(state.ptr1, ~seek_char, state.len[i]); in TEST()
756 memset(state.ptr1, '\1', state.len[i]); in TEST()
758 state.ptr1[state.len[i] - 1] = '\0'; in TEST()
764 expected = state.ptr1 + state.len[i] - 1; in TEST()
769 state.ptr1[pos] = seek_char; in TEST()
770 expected = state.ptr1 + pos; in TEST()
773 ASSERT_TRUE(strrchr(state.ptr1, seek_char) == expected); in TEST()
783 memset(state.ptr1, ~seek_char, state.len[i]); in TEST()
790 state.ptr1[pos] = seek_char; in TEST()
791 expected = state.ptr1 + pos; in TEST()
794 ASSERT_TRUE(memchr(state.ptr1, seek_char, state.len[i]) == expected); in TEST()
812 memset(state.ptr1, ~seek_char, state.len[i]); in TEST()
819 state.ptr1[pos] = seek_char; in TEST()
820 expected = state.ptr1 + pos; in TEST()
823 ASSERT_TRUE(memrchr(state.ptr1, seek_char, state.len[i]) == expected); in TEST()
834 memset(state.ptr1, c1, state.MAX_LEN); in TEST()
841 int actual = memcmp(state.ptr1, state.ptr2, state.MAX_LEN); in TEST()
856 wmemset(state.ptr1, c1, state.MAX_LEN); in TEST()
863 int actual = wmemcmp(state.ptr1, state.ptr2, (size_t) state.MAX_LEN); in TEST()
877 memset(state.ptr1, rand, state.len[i]); in TEST()
878 memset(state.ptr1 + state.len[i], ~rand, state.MAX_LEN - state.len[i]); in TEST()
884 ASSERT_FALSE(memcpy(state.ptr2 + pos, state.ptr1 + pos, state.len[i]) != state.ptr2 + pos); in TEST()
885 ASSERT_EQ(0, memcmp(state.ptr1, state.ptr2, state.MAX_LEN)); in TEST()
895 memset(state.ptr1, ~ch, state.MAX_LEN); in TEST()
896 memcpy(state.ptr2, state.ptr1, state.MAX_LEN); in TEST()
900 state.ptr1[k] = ch; in TEST()
905 ASSERT_EQ(0, memcmp(state.ptr1, state.ptr2, state.MAX_LEN)); in TEST()
914 memset(state.ptr1, 'Q', 2 * state.MAX_LEN); in TEST()
918 memset(state.ptr1, 'R', state.len[i]); in TEST()
919 memcpy(state.ptr2, state.ptr1, 2 * state.MAX_LEN); in TEST()
920 memcpy(state.ptr, state.ptr1, state.len[i]); in TEST()
921 memcpy(state.ptr1 + pos, state.ptr, state.len[i]); in TEST()
924 ASSERT_EQ(0, memcmp(state.ptr2, state.ptr1, 2 * state.MAX_LEN)); in TEST()
934 char* ptr1 = reinterpret_cast<char*>(malloc(2 * sizeof(char) * len)); in TEST() local
939 ASSERT_TRUE(ptr1 != NULL); in TEST()
944 memset(ptr1, 'S', 2 * len); in TEST()
945 memset(ptr1, 'T', len); in TEST()
946 memcpy(ptr2, ptr1, 2 * len); in TEST()
947 memcpy(ptr, ptr1, len); in TEST()
948 memcpy(ptr1 + pos, ptr, len); in TEST()
951 ASSERT_EQ(0, memcmp(ptr2, ptr1, 2 * len)); in TEST()
954 free(ptr1); in TEST()
1012 memset(state.ptr1, '4', state.MAX_LEN); in TEST()
1013 memset(state.ptr1 + state.MAX_LEN, 'a', state.MAX_LEN); in TEST()
1014 memcpy(state.ptr2, state.ptr1, 2 * state.MAX_LEN); in TEST()
1017 memcpy(state.ptr2 + start, state.ptr1, state.len[i]); in TEST()
1019 bcopy(state.ptr1, state.ptr1 + start, state.len[i]); in TEST()
1020 ASSERT_EQ(0, memcmp(state.ptr1, state.ptr2, 2 * state.MAX_LEN)); in TEST()
1028 memset(state.ptr1, 'R', state.MAX_LEN); in TEST()
1033 memcpy(state.ptr2, state.ptr1, start); in TEST()
1035 memcpy(state.ptr2 + end, state.ptr1 + end, state.MAX_LEN - end); in TEST()
1037 bzero(state.ptr1 + start, end - start); in TEST()
1039 ASSERT_EQ(0, memcmp(state.ptr1, state.ptr2, state.MAX_LEN)); in TEST()