Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion exercises/concept/lasagna-master/lasagna_master_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
#include "test/catch.hpp"
#endif

#include <cmath>

using namespace lasagna_master;

// As long as we have catch2 v2 and v3 in parallel, we can't use either
// of their comparison marcors for floating point comparisons.
#define REQUIRE_VECTOR_APROX_EQUAL(vec1, vec2, margin) \
REQUIRE(vec1.size() == vec2.size()); \
for (size_t i = 0; i < vec1.size(); i++) { \
REQUIRE( vec1.at(i) - vec2.at(i) < margin); \
REQUIRE( std::abs(vec1.at(i) - vec2.at(i)) < margin); \
}

TEST_CASE("preparationTime: Preparation time for many layers with custom average time", "[task_1]") {
Expand Down