From 41ea2d8f94043d49fc26aaaa8030a73dcfdc2da9 Mon Sep 17 00:00:00 2001 From: Julian T Date: Sun, 24 Jan 2021 18:13:44 +0100 Subject: Create rust project --- test/vector.cpp | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 test/vector.cpp (limited to 'test/vector.cpp') diff --git a/test/vector.cpp b/test/vector.cpp deleted file mode 100644 index 61648c6..0000000 --- a/test/vector.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include -#include - -TEST_CASE( "Vector length", "[vector]" ) { - auto vec = Vec3d(2, 4, 4); - REQUIRE(vec.length() == 6); - vec.set(0, 0, 0); - REQUIRE(vec.length() == 0); - vec.set(0, 3.5, 0); - REQUIRE(vec.length() == 3.5); -} - -TEST_CASE("Vector_normal", "[vector]") { - auto vec = Vec3d(4, 5, 4545); - REQUIRE(vec.length() != 1.0); - vec.normalize(); - REQUIRE(vec.length() - 1.0 < ZERO_APPROX); - vec.set(0, 0, 0); - REQUIRE_THROWS(vec.normalize()); -} - -TEST_CASE("Vector dot", "[vector]") { - auto a = Vec3d(4, 5, 6); - auto b = Vec3d(1, 2, 3); - REQUIRE(a.dot(b) == 32); - a.set(0, 0, 0); - REQUIRE(a.dot(b) == 0); - a.set(0, 5, 0); - REQUIRE(a.dot(b) == 10); -} -- cgit v1.2.3