Lines Matching refs:i

48 static int signum(int i) {  in signum()  argument
49 if (i < 0) { in signum()
51 } else if (i > 0) { in signum()
229 for (size_t i = 1; i < ITER; ++i) { in InitLenArray() local
230 size_t l = static_cast<size_t>(exp(log(static_cast<double>(MAX_LEN)) * i / ITER)); in InitLenArray()
257 for (size_t i = 1; i < state.n; i++) { in TEST() local
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()
429 for (size_t i = 0; i < sizeof(str) - 1; i++) { in TEST() local
430 EXPECT_EQ(&str[i], strchr(str, 'a')); in TEST()
431 str[i] = 'b'; in TEST()
439 for (size_t i = 1; i < state.n; i++) { in TEST() local
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()
450 if (pos >= state.len[i] - 1) { in TEST()
452 expected = state.ptr1 + state.len[i] - 1; in TEST()
475 for (size_t i = 1; i < state.n; i++) { in TEST() local
479 state.ptr1[state.len[i] - 1] = '\0'; in TEST()
480 state.ptr2[state.len[i] - 1] = '\0'; in TEST()
485 if (pos >= state.len[i] - 1) { in TEST()
486 memcpy(state.ptr1, state.ptr2, state.len[i]); in TEST()
559 for (size_t i = 0; i < state.n; i++) { in TEST() local
561 memset(state.ptr2, '\2', state.MAX_LEN + state.len[i]); in TEST()
563 memcpy(state.ptr, state.ptr2, state.MAX_LEN + state.len[i]); in TEST()
568 if (pos < state.len[i]) { in TEST()
571 memcpy(state.ptr + state.MAX_LEN - 1, state.ptr1, state.len[i]); in TEST()
572 state.ptr[state.MAX_LEN + state.len[i] - 1] = '\0'; in TEST()
575 strlcat(state.ptr2, state.ptr1, state.MAX_LEN + state.len[i]); in TEST()
577 ASSERT_TRUE(memcmp(state.ptr, state.ptr2, state.MAX_LEN + state.len[i]) == 0); in TEST()
619 for (size_t i = 1; i < state.n; i++) { in TEST() local
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()
631 size_t actual = random() % state.len[i]; in TEST()
643 for (size_t i = 1; i < state.n; i++) { in TEST() local
647 state.ptr1[state.len[i] - 1] = '\0'; in TEST()
648 state.ptr2[state.len[i] - 1] = '\0'; in TEST()
653 if (pos >= state.len[i] - 1) { 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()
668 actual = strncmp(state.ptr1, state.ptr2, state.len[i]); in TEST()
751 for (size_t i = 1; i < state.n; i++) { in TEST() local
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()
762 if (pos >= state.len[i] - 1) { in TEST()
764 expected = state.ptr1 + state.len[i] - 1; in TEST()
781 for (size_t i = 0; i < state.n; i++) { in TEST() local
783 memset(state.ptr1, ~seek_char, state.len[i]); in TEST()
787 if (pos >= state.len[i]) { in TEST()
794 ASSERT_TRUE(memchr(state.ptr1, seek_char, state.len[i]) == expected); in TEST()
810 for (size_t i = 0; i < state.n; i++) { in TEST() local
812 memset(state.ptr1, ~seek_char, state.len[i]); in TEST()
816 if (pos >= state.len[i]) { in TEST()
823 ASSERT_TRUE(memrchr(state.ptr1, seek_char, state.len[i]) == expected); in TEST()
830 for (size_t i = 0; i < state.n; i++) { in TEST() local
837 int pos = (state.len[i] == 0) ? 0 : (random() % state.len[i]); in TEST()
851 for (size_t i = 0; i < state.n; i++) { in TEST() local
859 int pos = (state.len[i] == 0) ? 0 : (random() % state.len[i]); in TEST()
873 for (size_t i = 0; i < state.n - 1; i++) { in TEST() local
875 size_t pos = random() % (state.MAX_LEN - state.len[i]); 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()
880 memset(state.ptr2, rand, state.len[i]); in TEST()
881 memset(state.ptr2 + state.len[i], ~rand, state.MAX_LEN - state.len[i]); in TEST()
882 memset(state.ptr2 + pos, '\0', state.len[i]); in TEST()
884 ASSERT_FALSE(memcpy(state.ptr2 + pos, state.ptr1 + pos, state.len[i]) != state.ptr2 + pos); in TEST()
893 for (size_t i = 0; i < state.n - 1; i++) { in TEST() local
898 size_t pos = random () % (state.MAX_LEN - state.len[i]); in TEST()
899 for (size_t k = pos; k < pos + state.len[i]; k++) { in TEST()
903 ASSERT_TRUE(memset(state.ptr2 + pos, ch, state.len[i]) == state.ptr2 + pos); in TEST()
912 for (size_t i = 0; i < state.n - 1; i++) { in TEST() local
916 size_t pos = random() % (state.MAX_LEN - state.len[i]); in TEST()
918 memset(state.ptr1, 'R', state.len[i]); 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()
923 ASSERT_TRUE(memmove(state.ptr2 + pos, state.ptr2, state.len[i]) == state.ptr2 + pos); in TEST()
942 for (int i = 0; i < 5; i++) { in TEST() local
943 char* ptr2 = glob_ptr2 + alignments[i]; in TEST()
975 for (size_t i = 0; i < MEMMOVE_DATA_SIZE; i++) { in TEST() local
976 src_data[i] = (i + 1) % 255; in TEST()
981 for (size_t i = 0; i < 127; i++) { in TEST() local
982 char* dst = buffer + 256 + i; in TEST()
1010 for (size_t i = 0; i < state.n; i++) { in TEST() local
1016 size_t start = random() % (2 * state.MAX_LEN - state.len[i]); 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()
1076 for (size_t i = 0; i < len; i++) { in DoMemsetTest() local
1077 buf[i] = 0; in DoMemsetTest()
1081 for (size_t i = 0; i < len; i++) { in DoMemsetTest() local
1082 ASSERT_EQ(value, buf[i]); in DoMemsetTest()
1201 for (size_t i = 1; i <= STRCAT_DST_LEN;) { in DoStrcatTest() local
1202 memset(dst, value2, i-1); in DoStrcatTest()
1203 memset(dst+i-1, 0, len-i); in DoStrcatTest()
1204 src[len-i] = '\0'; in DoStrcatTest()
1207 ASSERT_TRUE(memcmp(dst, cmp_buf, i-1) == 0); in DoStrcatTest()
1208 ASSERT_TRUE(memcmp(src, dst+i-1, len-i+1) == 0); in DoStrcatTest()
1211 if (i < 16) { in DoStrcatTest()
1212 i++; in DoStrcatTest()
1214 i <<= 1; in DoStrcatTest()
1248 for (size_t i = 1; i <= STRCAT_DST_LEN;) { in DoStrlcatTest() local
1249 memset(dst, value2, i-1); in DoStrlcatTest()
1250 memset(dst+i-1, 0, len-i); in DoStrlcatTest()
1251 src[len-i] = '\0'; in DoStrlcatTest()
1254 ASSERT_TRUE(memcmp(dst, cmp_buf, i-1) == 0); in DoStrlcatTest()
1255 ASSERT_TRUE(memcmp(src, dst+i-1, len-i+1) == 0); in DoStrlcatTest()
1258 if (i < 16) { in DoStrlcatTest()
1259 i++; in DoStrlcatTest()
1261 i <<= 1; in DoStrlcatTest()
1523 for (size_t i = 0; i < MEDIUM; i++) { in TEST() local
1524 g_memcpy_same_buffer[i] = i; in TEST()