3 #include <gtest/gtest.h> 4 #include <ocl/CorbaDeploymentComponent.hpp> 19 depl(
"Deployer"), tc(0)
22 int system(
const std::string& command) {
23 return ::system(command.c_str());
28 char tmpdir_c[] =
"/tmp/kdl_typekitXXXXXX";
29 ASSERT_TRUE(mkdtemp(tmpdir_c) != NULL);
33 system(
"omniNames -start -logdir $(mktemp -d) -errlog /dev/null &" 34 "echo $! > " + tmpdir +
"/omniNames.pid &");
36 system(
"./setupcomponent.ops &" 37 "echo $! > " + tmpdir +
"/setupcomponent.pid &");
43 ASSERT_TRUE(depl.
import(
"kdl_typekit"));
47 tc = depl.
getPeer(
"testcomponent");
48 ASSERT_FALSE(tc == 0);
54 system(
"kill $(cat " + tmpdir +
"/setupcomponent.pid)");
55 system(
"kill $(cat " + tmpdir +
"/omniNames.pid)");
67 ASSERT_FALSE (prop == 0);
69 EXPECT_EQ(prop->
get(),v1) <<
"Failed to set remote KDL::Vector property";
74 EXPECT_EQ(v4,v1) <<
"Failed to call remote operation with KDL type";
91 EXPECT_EQ(v5,v2) <<
"Failed to read KDL Vector from port";
94 EXPECT_EQ(v6,v3) <<
"Failed to write KDL Vector to port";
98 testing::InitGoogleTest(&argc,argv);
99 return RUN_ALL_TESTS();
DataSourceType get() const
Property< T > * getPropertyType(const std::string &name) const
base::PortInterface * getPort(const std::string &name) const
TEST_F(KDLCORBAPluginTest, VectorTest)
Variable opBinary s not applicable to op
bool import(const std::string &package)
static RTT_CORBA_API bool InitOrb(int argc, char *argv[], Seconds orb_timeout=0)
virtual TaskContext * getPeer(const std::string &peer_name) const
base::PortInterface & addPort(const std::string &name, base::PortInterface &port)
virtual bool connectTo(PortInterface *other, ConnPolicy const &policy)
WriteStatus write(const T &sample)
int system(const std::string &command)
virtual bool connected() const
unsigned int sleep(unsigned int s)
PropertyBag * properties()
OperationInterfacePart * getOperation(std::string name)
bool loadComponent(const std::string &name, const std::string &type)
void shutdownDeployment()
static void ShutdownOrb(bool wait_for_completion=true)
int ORO_main(int argc, char **argv)
OCL::CorbaDeploymentComponent depl