diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/particlebodytest.cpp | 8 | ||||
-rw-r--r-- | test/windowtest.cpp | 20 | ||||
-rw-r--r-- | test/yagetest.cpp | 20 |
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(); +} |