summaryrefslogtreecommitdiff
path: root/test.cpp
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-04-11 10:07:48 +0800
committerKeuin <[email protected]>2022-04-11 10:07:48 +0800
commit00bfec66319e3e53a3b51d1d1ffbc899633f29a2 (patch)
tree6f2d2a6bf962a9b6d376847b03387d81723e7675 /test.cpp
Basic 3d vector operations. Testing with GoogleTest.
Diffstat (limited to 'test.cpp')
-rw-r--r--test.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test.cpp b/test.cpp
new file mode 100644
index 0000000..b1e5199
--- /dev/null
+++ b/test.cpp
@@ -0,0 +1,15 @@
+//
+// Created by Keuin on 2022/4/11.
+//
+
+#include <gtest/gtest.h>
+
+#include "vec.h"
+
+TEST(Vec, VecAdd) {
+ vec3i a{1, 1, 1}, b{2, 2, 2}, c{3, 3, 3};
+ ASSERT_EQ(a + b, c);
+
+ vec3d d{1.1, 2.2, 3.3}, e{4.4, 5.5, 6.6}, f{5.5, 7.7, 9.9};
+ ASSERT_EQ(d + e, f);
+} \ No newline at end of file