Skip to content

Commit

Permalink
Fix tests memory issues with different include
Browse files Browse the repository at this point in the history
  • Loading branch information
x-mass committed May 24, 2024
1 parent a3d40d8 commit a3ff2e5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ option(BUILD_BENCH_TESTS "Build performance benchmark tests" FALSE)
option(BUILD_EXAMPLES "Build examples" FALSE)

# Blurprint components are using point {0, 0} as a point in infinity, while the stadard is {0, 1}
# for most curves. We will use compatibility mode with blueprint as default. Setting this flag to
# for most curves. We will use compatibility mode with blueprint as default. Setting this flag to
# TRUE will change the value of inf point for all curves to the standard value.
option(STANDARD_EC_INF_POINTS "Use standard zero points for Eliptic Curves" FALSE)

Expand Down
1 change: 0 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,3 @@ endforeach()
if(BUILD_BENCH_TESTS)
cm_add_test_subdirectory(bench_test)
endif()

7 changes: 3 additions & 4 deletions test/curves.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <chrono>
#include <type_traits>

#include <boost/test/included/unit_test.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>

Expand Down Expand Up @@ -72,10 +72,9 @@ namespace boost {
} // namespace test_tools
} // namespace boost

// if target == check-algebra just data/curves.json
std::string test_data = std::string(TEST_DATA_DIR) + R"(curves.json)";

boost::property_tree::ptree string_data(std::string test_name) {
// if target == check-algebra just data/curves.json
static std::string test_data = std::string(TEST_DATA_DIR) + R"(curves.json)";
boost::property_tree::ptree string_data;
boost::property_tree::read_json(test_data, string_data);

Expand Down
4 changes: 2 additions & 2 deletions test/fields_static.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <cstdint>
#include <string>

#include <boost/test/included/unit_test.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>

Expand Down Expand Up @@ -103,7 +103,7 @@ constexpr bool check_field_operations_static(const ElementsRange &elements, cons
static_assert(elements[e1] * elements[e2] == elements[e1_mul_e2], "mul error");
static_assert(elements[e1].doubled() == elements[e1_dbl], "dbl error");
static_assert(elements[e2].inversed() == elements[e2_inv], "inv error");

static_assert(elements[e1].pow(constants[C1]) == elements[e1_pow_C1], "pow error");
static_assert(elements[e2].squared() == elements[e2_pow_2], "sqr error");
static_assert((elements[e2].squared()).sqrt() == elements[e2_pow_2_sqrt], "sqrt error");
Expand Down

0 comments on commit a3ff2e5

Please sign in to comment.