30 #include "gtest/gtest.h"
32 #include "boost/smart_ptr.hpp"
33 #include "boost/tuple/tuple.hpp"
34 #include "boost/variant/get.hpp"
35 #include "boost/variant/variant.hpp"
41 class PythonExprTest :
public ::testing::Test {
48 virtual ~PythonExprTest() {
55 virtual void SetUp() {
60 virtual void TearDown() {
67 TEST_F(PythonExprTest, EvaluatePythonExpr) {
70 double expected = 1.0;
76 funcs.insert(std::pair<std::string, client::function::type>
79 std::string testexpr =
"python(\"resources/test.py\", 1.0)";
80 boost::scoped_ptr<Expression>
e(
new Expression(testexpr, funcs));
83 result =
e->evaluate(vars);
86 ASSERT_EQ(expected, boost::get<0>(result));
87 ASSERT_TRUE(boost::get<1>(result));
92 int main(
int argc,
char **argv) {
93 ::testing::InitGoogleTest(&argc, argv);
94 return RUN_ALL_TESTS();
std::map< std::string, client::function::type > functionDictionary_t
std::map< std::string, double > variableDictionary_t
int main(int argc, char **argv)
boost::tuple< double, bool > Result_t
constexpr double e
The value of.
boost::function< boost::tuple< double, bool >arguments_t)> type