/* * testChannelAccess.cpp */ #ifdef _WIN32 #define NOMINMAX #endif #define TESTSERVERNOMAIN #include #include #include #include #include #include "channelAccessIFTest.h" #include "testServer.cpp" class ServerContextAction : public Runnable { public: ServerContextAction(): m_serverThread(){} virtual void run() { testServer(0); } void stop() { testServerShutdown(); } void start() { m_serverThread.reset(new epics::pvData::Thread("pvAccess", highPriority, this)); } private: auto_ptr m_serverThread; }; class ChannelAccessIFRemoteTest: public ChannelAccessIFTest { public: ChannelAccessIFRemoteTest(): m_serverContextAction() { m_serverContextAction.start(); ClientFactory::start(); } virtual ChannelProvider::shared_pointer getChannelProvider() { return getChannelAccess()->getProvider( "pva"); } virtual long getTimeoutSec() { return 3; } virtual bool isLocal() { return false;} ~ChannelAccessIFRemoteTest() { m_serverContextAction.stop(); ClientFactory::stop(); // shutdown SIGSEG problems epicsThreadSleep(2.0); } private: ServerContextAction m_serverContextAction; }; MAIN(testChannelProvider) { SET_LOG_LEVEL(logLevelError); ChannelAccessIFRemoteTest caRemoteTest; return caRemoteTest.runAllTest(); }