Skip to content

Commit

Permalink
Fix avm unit test with proving by passing the public_inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmon committed Jun 17, 2024
1 parent 024e85f commit 83c9d0b
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 114 deletions.
102 changes: 51 additions & 51 deletions barretenberg/cpp/src/barretenberg/vm/tests/avm_arithmetic.test.cpp

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions barretenberg/cpp/src/barretenberg/vm/tests/avm_bitwise.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ TEST_P(AvmBitwiseTestsNot, ParamTest)
FF ff_a = FF(uint256_t::from_uint128(a));
FF ff_output = FF(uint256_t::from_uint128(output));
common_validate_op_not(trace, ff_a, ff_output, FF(0), FF(1), mem_tag);
validate_trace(std::move(trace));
validate_trace(std::move(trace), public_inputs);
}

INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests,
Expand Down Expand Up @@ -514,7 +514,7 @@ TEST_P(AvmBitwiseTestsOr, AllOrTest)
auto trace = trace_builder.finalize();

common_validate_bit_op(trace, 1, a, b, output, FF(0), FF(1), FF(2), mem_tag);
validate_trace(std::move(trace));
validate_trace(std::move(trace), public_inputs);
}
INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests,
AvmBitwiseTestsOr,
Expand All @@ -531,7 +531,7 @@ TEST_P(AvmBitwiseTestsXor, AllXorTest)
auto trace = trace_builder.finalize();

common_validate_bit_op(trace, 2, a, b, output, FF(0), FF(1), FF(2), mem_tag);
validate_trace(std::move(trace));
validate_trace(std::move(trace), public_inputs);
}

INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests,
Expand All @@ -548,7 +548,7 @@ TEST_P(AvmBitwiseTestsShr, AllShrTest)
trace_builder.return_op(0, 2, 1);
auto trace = trace_builder.finalize();
common_validate_shift_op(trace, a, b, output, FF(0), FF(1), FF(2), mem_tag, true);
validate_trace(std::move(trace));
validate_trace(std::move(trace), public_inputs);
}

INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests,
Expand All @@ -566,7 +566,7 @@ TEST_P(AvmBitwiseTestsShl, AllShlTest)
auto trace = trace_builder.finalize();

common_validate_shift_op(trace, a, b, output, FF(0), FF(1), FF(2), mem_tag, false);
validate_trace(std::move(trace));
validate_trace(std::move(trace), public_inputs);
}

INSTANTIATE_TEST_SUITE_P(AvmBitwiseTests,
Expand Down
4 changes: 2 additions & 2 deletions barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class AvmCastTests : public ::testing::Test {
if (force_proof) {
validate_trace(std::move(trace), public_inputs, true);
} else {
validate_trace(std::move(trace));
validate_trace(std::move(trace), public_inputs);
}
}
};
Expand Down Expand Up @@ -248,7 +248,7 @@ TEST_F(AvmCastTests, indirectAddrWrongResolutionU64ToU8)
Field("alu_sel", &Row::avm_main_alu_sel, 0), // ALU trace not activated
Field("tag_err", &Row::avm_main_tag_err, 1))); // Error activated

validate_trace(std::move(trace));
validate_trace(std::move(trace), public_inputs);
}

TEST_F(AvmCastNegativeTests, nonTruncatedOutputMainIc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ TEST_P(AvmCmpTestsLT, ParamTest)
ASSERT_TRUE(alu_row != trace.end());
common_validate_cmp(*row, *alu_row, a, b, c, FF(0), FF(1), FF(2), mem_tag);

validate_trace(std::move(trace));
validate_trace(std::move(trace), public_inputs);
}
INSTANTIATE_TEST_SUITE_P(AvmCmpTests,
AvmCmpTestsLT,
Expand Down Expand Up @@ -159,7 +159,7 @@ TEST_P(AvmCmpTestsLTE, ParamTest)
ASSERT_TRUE(row != trace.end());
ASSERT_TRUE(alu_row != trace.end());
common_validate_cmp(*row, *alu_row, a, b, c, FF(0), FF(1), FF(2), mem_tag);
validate_trace(std::move(trace));
validate_trace(std::move(trace), public_inputs);
}
INSTANTIATE_TEST_SUITE_P(AvmCmpTests,
AvmCmpTestsLTE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ TEST_F(AvmControlFlowTests, simpleJump)
EXPECT_TRUE(halt_row != trace.end());
EXPECT_EQ(halt_row->avm_main_pc, FF(JUMP_PC));
}
validate_trace(std::move(trace));
validate_trace(std::move(trace), public_inputs);
}

TEST_F(AvmControlFlowTests, simpleCallAndReturn)
Expand Down Expand Up @@ -171,7 +171,7 @@ TEST_F(AvmControlFlowTests, simpleCallAndReturn)
EXPECT_EQ(halt_row->avm_main_pc, FF(RETURN_PC));
}

validate_trace(std::move(trace));
validate_trace(std::move(trace), public_inputs);
}

TEST_F(AvmControlFlowTests, multipleCallsAndReturns)
Expand Down Expand Up @@ -304,6 +304,6 @@ TEST_F(AvmControlFlowTests, multipleCallsAndReturns)
EXPECT_TRUE(halt_row != trace.end());
EXPECT_EQ(halt_row->avm_main_pc, FF(1));

validate_trace(std::move(trace));
validate_trace(std::move(trace), public_inputs);
}
} // namespace tests_avm
Loading

0 comments on commit 83c9d0b

Please sign in to comment.