-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
5466: First unit test and various bugs fixing and improvements
- Loading branch information
Showing
6 changed files
with
119 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
barretenberg/cpp/src/barretenberg/vm/tests/avm_cast.test.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "avm_common.test.hpp" | ||
#include "barretenberg/vm/avm_trace/avm_common.hpp" | ||
#include "barretenberg/vm/tests/helpers.test.hpp" | ||
#include <gmock/gmock.h> | ||
#include <gtest/gtest.h> | ||
|
||
namespace tests_avm { | ||
using namespace bb::avm_trace; | ||
using namespace testing; | ||
|
||
class AvmCastTests : public ::testing::Test { | ||
public: | ||
AvmTraceBuilder trace_builder; | ||
|
||
protected: | ||
std::vector<Row> trace; | ||
|
||
// TODO(640): The Standard Honk on Grumpkin test suite fails unless the SRS is initialised for every test. | ||
void SetUp() override { srs::init_crs_factory("../srs_db/ignition"); }; | ||
}; | ||
|
||
TEST_F(AvmCastTests, basicU8ToU16) | ||
{ | ||
trace_builder.op_set(0, 237, 0, AvmMemoryTag::U8); | ||
trace_builder.op_cast(0, 0, 1, AvmMemoryTag::U16); | ||
trace_builder.return_op(0, 0, 0); | ||
auto trace = trace_builder.finalize(); | ||
|
||
validate_trace_check_circuit(std::move(trace)); | ||
} | ||
|
||
} // namespace tests_avm |