diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-08-24 00:25:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-24 00:25:31 +0100 |
commit | a326354ea6fccf76665a4212bf14daeba0f52ec8 (patch) | |
tree | 18cd2deb0c30b38d8ca7c5305735d2323259e020 /test/particlebodytest.cpp | |
parent | 0a49874288f92c120d7e165550eb6dbbe1ef7307 (diff) | |
parent | 5403490b941f7c031bf1aafdb91b1098f69edbf2 (diff) | |
download | YAGE-a326354ea6fccf76665a4212bf14daeba0f52ec8.tar.gz YAGE-a326354ea6fccf76665a4212bf14daeba0f52ec8.zip |
Merge pull request #3 from ymherklotz/developv0.1.0
Merge develop to master
Diffstat (limited to 'test/particlebodytest.cpp')
-rw-r--r-- | test/particlebodytest.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/particlebodytest.cpp b/test/particlebodytest.cpp index 5c915a9a..65c3885c 100644 --- a/test/particlebodytest.cpp +++ b/test/particlebodytest.cpp @@ -12,7 +12,8 @@ #include "Physics/particlebody.hpp" #include "gtest/gtest.h" -double gravityAcceleration(int iterations) { +double gravityAcceleration(int iterations) +{ yage::ParticleBody body; for (int i = 0; i < 60 * iterations; ++i) { body.update(); @@ -23,7 +24,8 @@ double gravityAcceleration(int iterations) { // Tests -TEST(ParticleBody, Gravity) { +TEST(ParticleBody, Gravity) +{ int randomItr = rand() % 10; double idealPosition = 0.5 * -9.81 * std::pow(randomItr, 2); @@ -31,7 +33,8 @@ TEST(ParticleBody, Gravity) { ASSERT_LE(idealPosition * 1.05, gravityAcceleration(randomItr)); } -int main(int argc, char** argv) { +int main(int argc, char **argv) +{ testing::InitGoogleTest(&argc, argv); srand(static_cast<unsigned>(time(nullptr))); return RUN_ALL_TESTS(); |