2#include <gtest/gtest.h>
27TEST(RomTable, TagCorrectness)
43 table_values.emplace_back(entry_1);
44 table_values.emplace_back(entry_2);
45 table_values.emplace_back(entry_3);
56 EXPECT_THROW(table[0] + table[2], std::runtime_error);
60TEST(RomTable, RomTableReadWriteConsistency)
65 const size_t table_size = 10;
66 for (
size_t i = 0; i < table_size; ++i) {
75 for (
size_t i = 0; i < 10; ++i) {
79 const auto before_n =
builder.num_gates;
80 const auto to_add = table[index];
81 const auto after_n =
builder.num_gates;
85 EXPECT_EQ(after_n - before_n, 1ULL);
89 const auto before_n =
builder.num_gates;
90 const auto to_add = table[i];
91 const auto after_n =
builder.num_gates;
93 EXPECT_EQ(after_n - before_n, 0ULL);
96 expected += table_values[i].get_value();
102 EXPECT_EQ(verified,
true);
static bool check(const Builder &circuit)
Check the witness satisifies the circuit.
bb::fr get_value() const
Given a := *this, compute its value given by a.v * a.mul + a.add.
void set_origin_tag(const OriginTag &new_tag) const
RNG & get_debug_randomness(bool reset, std::uint_fast64_t seed)
Entry point for Barretenberg command-line interface.
TEST(MegaCircuitBuilder, CopyConstructor)
UltraCircuitBuilder_< UltraExecutionTraceBlocks > UltraCircuitBuilder
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
This file contains part of the logic for the Origin Tag mechanism that tracks the use of in-circuit p...
#define STANDARD_TESTING_TAGS
stdlib::field_t< Builder > field_ct
stdlib::witness_t< Builder > witness_ct
static field random_element(numeric::RNG *engine=nullptr) noexcept