Skip to content
Snippets Groups Projects
Commit eef8e448 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Added cross product test

parent 18405382
Branches
Tags
No related merge requests found
......@@ -67,9 +67,17 @@ TEST_CASE("TinyVector", "[algebra]") {
REQUIRE(l2Norm(TinyVector<2,double>(3,4)) == Approx(5).epsilon(1E-14));
SECTION("checking for cross product") {
const TinyVector<3,int> a(1,-2,4);
const TinyVector<3,int> b(3, 1,6);
REQUIRE(crossProduct(a, b) == TinyVector<3,int>(-16,6,7));
}
#ifndef NDEBUG
REQUIRE_THROWS_AS(x[4]=0, AssertError);
const TinyVector<3,int>& const_x = x;
REQUIRE_THROWS_AS(const_x[-1], AssertError);
SECTION("checking for bounds validation") {
REQUIRE_THROWS_AS(x[4]=0, AssertError);
const TinyVector<3,int>& const_x = x;
REQUIRE_THROWS_AS(const_x[-1], AssertError);
}
#endif // NDEBUG
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment