unittests: add setup code to call param_init()

This commit is contained in:
Beat Küng
2017-02-17 10:12:08 +01:00
committed by Lorenz Meier
parent df8f0da70c
commit b4b5c987a6
2 changed files with 24 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
#include <systemlib/param/param.h>
#include "gtest/gtest.h"
class TestEnvironment: public ::testing::Environment {
public:
/**
* Testing setup: this is called before the actual tests are executed.
*/
virtual void SetUp()
{
param_init();
}
};
int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
// gtest takes ownership of the TestEnvironment ptr - we don't delete it.
::testing::AddGlobalTestEnvironment(new TestEnvironment);
return RUN_ALL_TESTS();
}