variableScope

This commit is contained in:
gtsoul-tech
2024-04-29 13:13:07 +03:00
parent 62e3450eae
commit 987cd17160
17 changed files with 45 additions and 55 deletions

View File

@@ -277,10 +277,9 @@ TEST_P(RepeatTest, FillRing) {
}
// We should be able to see matches for all of these (beyond the last top offset).
enum TriggerResult rv;
for (u64a i = offset + info.repeatMax;
i <= offset + info.repeatMax + info.repeatMin; i++) {
rv = processTugTrigger(&info, ctrl, state, i);
enum TriggerResult rv = processTugTrigger(&info, ctrl, state, i);
if (rv == TRIGGER_SUCCESS_CACHE) {
rv = TRIGGER_SUCCESS;
}
@@ -998,16 +997,14 @@ TEST_P(SparseOptimalTest, FillTops) {
repeatStore(info, ctrl, state, offset, 0);
ASSERT_EQ(offset, repeatLastTop(info, ctrl, state));
u64a offset2;
for (u32 i = min_period; i < patch_count * patch_size; i += min_period) {
offset2 = offset + i;
u64a offset2 = offset + i;
repeatStore(info, ctrl, state, offset2, 1);
ASSERT_EQ(offset2, repeatLastTop(info, ctrl, state));
}
u64a exit2;
for (u32 i = 0; i < patch_count * patch_size; i += min_period) {
exit2 = exit + i;
u64a exit2 = exit + i;
for (u32 j = exit2 + info->repeatMin;
j <= offset + info->repeatMax; j++) {
ASSERT_EQ(REPEAT_MATCH, repeatHasMatch(info, ctrl, state, j));

View File

@@ -87,12 +87,11 @@ static int initLegalValidMasks(u64a validMasks[]) {
*/
static int initLegalNegMasks(u64a negMasks[]) {
u64a data = 0;
u64a offset;
int num = 0;
while (data != ONES64) {
negMasks[num] = data;
num++;
offset = (data | (data +1)) ^ data;
u64a offset = (data | (data +1)) ^ data;
data += 0xfeULL * offset + 1;
}
negMasks[num] = data;

View File

@@ -194,10 +194,9 @@ TEST(ValidateMask32, testMask32_3) {
u32 valid_mask = ONES32 << (left + right) >> left;
for (int i = 0; i < test_len; i++) {
const auto &t = testBasic[i];
int bool_result;
for (int j = 0; j < 5000; j++) {
u32 neg_mask = neg_mask_rand.Generate(1u << 31);
bool_result = (neg_mask & valid_mask) ==
int bool_result = (neg_mask & valid_mask) ==
(t.neg_mask & valid_mask);
EXPECT_EQ(bool_result, validateMask32(t.data.a256,
valid_mask,