Lines Matching refs:kBlockSize
28 const int kBlockSize = BlockHash::kBlockSize; variable
82 CHECK(n < kBlockSize); in InitBlocksToDifferAtNthByte()
85 for (int index = n; index < kTimingTestSize; index += kBlockSize) { in InitBlocksToDifferAtNthByte()
115 char* padded_text = new char[(kBlockSize * length_without_spaces) + 1]; in MakeEachLetterABlock()
116 memset(padded_text, ' ', kBlockSize * length_without_spaces); in MakeEachLetterABlock()
117 char* padded_text_ptr = padded_text + (kBlockSize - 1); in MakeEachLetterABlock()
120 padded_text_ptr += kBlockSize; in MakeEachLetterABlock()
122 padded_text[kBlockSize * length_without_spaces] = '\0'; in MakeEachLetterABlock()
140 char* new_test_string_unaligned_e = new char[kBlockSize]; in SetUpTestCase()
141 memset(new_test_string_unaligned_e, ' ', kBlockSize); in SetUpTestCase()
142 new_test_string_unaligned_e[kBlockSize - 2] = 'e'; in SetUpTestCase()
144 char* new_test_string_all_Qs = new char[kBlockSize]; in SetUpTestCase()
145 memset(new_test_string_all_Qs, 'Q', kBlockSize); in SetUpTestCase()
147 hashed_y = RollingHash<kBlockSize>::Hash(test_string_y); in SetUpTestCase()
148 hashed_e = RollingHash<kBlockSize>::Hash(test_string_e); in SetUpTestCase()
150 RollingHash<kBlockSize>::Hash(&search_string[index_of_f_in_fearsome]); in SetUpTestCase()
151 hashed_unaligned_e = RollingHash<kBlockSize>::Hash(test_string_unaligned_e); in SetUpTestCase()
152 hashed_all_Qs = RollingHash<kBlockSize>::Hash(test_string_all_Qs); in SetUpTestCase()
187 static const int index_of_first_e = block_of_first_e * kBlockSize;
188 static const int index_of_fourth_e = block_of_fourth_e * kBlockSize;
189 static const int index_of_sixth_e = block_of_sixth_e * kBlockSize;
190 static const int index_of_y_in_only = block_of_y_in_only * kBlockSize;
191 static const int index_of_space_before_fear_is_fear = 25 * kBlockSize;
192 static const int index_of_longest_match_ear_is_fear = 27 * kBlockSize;
193 static const int index_of_i_in_fear_is_fear = 31 * kBlockSize;
194 static const int index_of_space_before_fear_itself = 33 * kBlockSize;
195 static const int index_of_space_before_itself = 38 * kBlockSize;
196 static const int index_of_ababc = 4 * kBlockSize;
199 static const int index_of_second_w_in_what_we = 5 * kBlockSize;
200 static const int index_of_second_e_in_what_we_hear = 9 * kBlockSize;
201 static const int index_of_f_in_fearsome = 16 * kBlockSize;
202 static const int index_of_space_in_eat_itself = 12 * kBlockSize;
203 static const int index_of_i_in_itself = 13 * kBlockSize;
204 static const int index_of_t_in_use_the = 4 * kBlockSize;
205 static const int index_of_o_in_online = 8 * kBlockSize;
324 &compare_buffer_1_[kTimingTestSize - kBlockSize]; in TestAndPrintTimesForCompareFunctions()
335 block1 += kBlockSize; in TestAndPrintTimesForCompareFunctions()
336 block2 += kBlockSize; in TestAndPrintTimesForCompareFunctions()
342 / ((kTimingTestSize / kBlockSize) * kTimingTestIterations); in TestAndPrintTimesForCompareFunctions()
353 block1 += kBlockSize; in TestAndPrintTimesForCompareFunctions()
354 block2 += kBlockSize; in TestAndPrintTimesForCompareFunctions()
360 / ((kTimingTestSize / kBlockSize) * kTimingTestIterations); in TestAndPrintTimesForCompareFunctions()
451 const int expected_length = kBlockSize * StringLengthAsInt("e hear is "); in TEST_F()
462 const int expected_length = kBlockSize * StringLengthAsInt("e hear is "); in TEST_F()
477 const int expected_length = (kBlockSize * StringLengthAsInt("fearsom")) in TEST_F()
478 + (kBlockSize - 1); // spacing between letters in TEST_F()
489 const int expected_length = (kBlockSize * StringLengthAsInt("fearsom")) in TEST_F()
490 + (kBlockSize - 1); // spacing between letters in TEST_F()
517 << (kTimingTestSize / kBlockSize) << " identical values:" in TEST_F()
525 << ((kTimingTestSize / kBlockSize) - 1) << " identical values" in TEST_F()
536 TimingTestForBlocksThatDifferAtByte(kBlockSize / 2); in TEST_F()
537 TimingTestForBlocksThatDifferAtByte(kBlockSize - 1); in TEST_F()
549 th_->AddOneIndexHash(i, RollingHash<kBlockSize>::Hash(&sample_text[i])); in TEST_F()
770 EXPECT_EQ((strlen("ear is fear") * kBlockSize) + (kBlockSize - 1), in TEST_F()
788 EXPECT_EQ((strlen("ear is fear") * kBlockSize) + (kBlockSize - 1), in TEST_F()
794 uint32_t hash_value = RollingHash<kBlockSize>::Hash( in TEST_F()
803 EXPECT_EQ(strlen(" itself") * kBlockSize, best_match_.size()); in TEST_F()
808 uint32_t hash_value = RollingHash<kBlockSize>::Hash( in TEST_F()
819 EXPECT_EQ((strlen("The onl") * kBlockSize) + (kBlockSize - 1), in TEST_F()
830 RollingHash<kBlockSize>::Hash(search_string_many_matches); in TEST_F()
850 CHECK_GE(kBlockSize, 4); in TEST_F()
851 fearsome_location[kBlockSize - 4] = 0x84; in TEST_F()
852 fearsome_location[kBlockSize - 3] = 0xF1; in TEST_F()
853 fearsome_location[kBlockSize - 2] = 0x51; in TEST_F()
854 fearsome_location[kBlockSize - 1] = 0x00; in TEST_F()
855 EXPECT_EQ(hashed_f, RollingHash<kBlockSize>::Hash(fearsome_location)); in TEST_F()
858 kBlockSize)); in TEST_F()
927 th_->AddOneIndexHash(i * kBlockSize, hashed_e); in TEST_F()