10 #include "gtest/gtest.h"
12 #include "boost/smart_ptr.hpp"
13 #include "boost/tuple/tuple.hpp"
14 #include "boost/variant/get.hpp"
15 #include "boost/variant/variant.hpp"
21 class PythonExprTest :
public ::testing::Test {
28 virtual ~PythonExprTest() {
35 virtual void SetUp() {
40 virtual void TearDown() {
47 TEST_F(PythonExprTest, EvaluatePythonExpr) {
50 double expected = 1.0;
56 funcs.insert(std::pair<std::string, client::function::type>
59 std::string testexpr =
"python(\"resources/test.py\", 1.0)";
60 boost::scoped_ptr<Expression>
e(
new Expression(testexpr, funcs));
63 result =
e->evaluate(vars);
66 ASSERT_EQ(expected, boost::get<0>(result));
67 ASSERT_TRUE(boost::get<1>(result));
72 int main(
int argc,
char **argv) {
73 ::testing::InitGoogleTest(&argc, argv);
74 return RUN_ALL_TESTS();
constexpr double e
The value of .
Expression to be evaluated in the framework.
boost::tuple< double, bool > Result_t
int main(int argc, char *argv[])
boost::function< boost::tuple< double, bool >arguments_t)> type
std::map< std::string, double > variableDictionary_t
std::map< std::string, client::function::type > functionDictionary_t