aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-08-12 13:59:54 +0100
committerYann Herklotz <ymherklotz@gmail.com>2017-08-12 13:59:54 +0100
commitb3d29409c0ec90a32a91243675a3f55617cf63e1 (patch)
tree562ed4ac0c9e3651c3a907f145f220ed738518db /test
parent3ce4865390924d13c525938c5c60c73650564a50 (diff)
downloadYAGE-b3d29409c0ec90a32a91243675a3f55617cf63e1.tar.gz
YAGE-b3d29409c0ec90a32a91243675a3f55617cf63e1.zip
More tests and improving header adding
Diffstat (limited to 'test')
-rw-r--r--test/particlebodytest.cpp8
-rw-r--r--test/windowtest.cpp20
-rw-r--r--test/yagetest.cpp20
3 files changed, 44 insertions, 4 deletions
diff --git a/test/particlebodytest.cpp b/test/particlebodytest.cpp
index c8e493a0..5c915a9a 100644
--- a/test/particlebodytest.cpp
+++ b/test/particlebodytest.cpp
@@ -24,11 +24,11 @@ double gravityAcceleration(int iterations) {
// Tests
TEST(ParticleBody, Gravity) {
- int random_itr = rand() % 25;
- double idealPosition = 0.5 * -9.81 * std::pow(random_itr, 2);
+ int randomItr = rand() % 10;
+ double idealPosition = 0.5 * -9.81 * std::pow(randomItr, 2);
- ASSERT_GE(idealPosition * 0.95, gravityAcceleration(random_itr));
- ASSERT_LE(idealPosition * 1.05, gravityAcceleration(random_itr));
+ ASSERT_GE(idealPosition * 0.95, gravityAcceleration(randomItr));
+ ASSERT_LE(idealPosition * 1.05, gravityAcceleration(randomItr));
}
int main(int argc, char** argv) {
diff --git a/test/windowtest.cpp b/test/windowtest.cpp
new file mode 100644
index 00000000..d252f28f
--- /dev/null
+++ b/test/windowtest.cpp
@@ -0,0 +1,20 @@
+/* ----------------------------------------------------------------------------
+ * windowtest.cpp
+ *
+ * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
+ * See file LICENSE for more details
+ * ----------------------------------------------------------------------------
+ */
+
+#include "gtest/gtest.h"
+
+#include "yage.hpp"
+
+TEST(Window, Open) {
+ ASSERT_TRUE(true);
+}
+
+int main(int argc, char** argv) {
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/test/yagetest.cpp b/test/yagetest.cpp
new file mode 100644
index 00000000..8ca6c83e
--- /dev/null
+++ b/test/yagetest.cpp
@@ -0,0 +1,20 @@
+/* ----------------------------------------------------------------------------
+ * yagetest.cpp
+ *
+ * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
+ * See file LICENSE for more details
+ * ----------------------------------------------------------------------------
+ */
+
+#include "gtest/gtest.h"
+
+#include "yage.hpp"
+
+TEST(YAGE, InitQuit) {
+ ASSERT_TRUE(true);
+}
+
+int main(int argc, char** argv) {
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}