Skip to content

Commit

Permalink
circuit checker failure test
Browse files Browse the repository at this point in the history
  • Loading branch information
ledwards2225 committed Jun 21, 2024
1 parent 65ba681 commit 8c5fe0c
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp"
#include "barretenberg/circuit_checker/circuit_checker.hpp"
#include "barretenberg/crypto/pedersen_commitment/pedersen.hpp"
#include "barretenberg/stdlib_circuit_builders/mock_circuits.hpp"
#include "barretenberg/stdlib_circuit_builders/plookup_tables/fixed_base/fixed_base.hpp"

#include <gtest/gtest.h>
Expand Down Expand Up @@ -104,6 +105,22 @@ TEST(ultra_circuit_constructor, create_gates_from_plookup_accumulators)
EXPECT_EQ(result, true);
}

TEST(ultra_circuit_constructor, bad_lookup_failure)
{
UltraCircuitBuilder builder;
MockCircuits::add_lookup_gates(builder);

// Erroneously set a non-zero wire value to zero in one of the lookup gates
for (auto& wire_3_witness_idx : builder.blocks.lookup.w_o()) {
if (wire_3_witness_idx != builder.zero_idx) {
wire_3_witness_idx = builder.zero_idx;
break;
}
}

EXPECT_FALSE(CircuitChecker::check(builder));
}

TEST(ultra_circuit_constructor, base_case)
{
UltraCircuitBuilder circuit_constructor = UltraCircuitBuilder();
Expand Down

0 comments on commit 8c5fe0c

Please sign in to comment.