1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
|
#ifndef CHANNELACCESSIFTEST_HPP
#define CHANNELACCESSIFTEST_HPP
#include <pv/pvAccess.h>
#include "syncTestRequesters.h"
class ChannelAccessIFTest {
ChannelProvider::shared_pointer m_provider;
public:
int runAllTest();
virtual ~ChannelAccessIFTest() {}
protected:
static const std::string TEST_COUNTER_CHANNEL_NAME;
static const std::string TEST_SIMPLECOUNTER_CHANNEL_NAME;
static const std::string TEST_CHANNEL_NAME;
static const std::string TEST_VALUEONLY_CHANNEL_NAME;
static const std::string TEST_SUMRPC_CHANNEL_NAME;
static const std::string TEST_ARRAY_CHANNEL_NAME;
ChannelProvider::shared_pointer getChannelProvider() { return m_provider; }
long getTimeoutSec() {return 3;}
bool isLocal() {return false;}
Channel::shared_pointer createChannel(std::string channelName, bool debug = false );
Channel::shared_pointer syncCreateChannel(std::string channelName, bool debug = false );
SyncChannelGetRequesterImpl::shared_pointer syncCreateChannelGet(
Channel::shared_pointer const & channel, std::string const & request, bool debug = false );
SyncChannelPutRequesterImpl::shared_pointer syncCreateChannelPut(
Channel::shared_pointer const & channel, std::string const & request, bool debug = false );
SyncChannelPutGetRequesterImpl::shared_pointer syncCreateChannelPutGet(
Channel::shared_pointer const & channel, std::string const & request, bool debug = false );
SyncChannelRPCRequesterImpl::shared_pointer syncCreateChannelRPC(
Channel::shared_pointer const & channel, bool debug = false);
SyncMonitorRequesterImpl::shared_pointer syncCreateChannelMonitor(
Channel::shared_pointer const & channel, std::string const & request, bool debug = false);
SyncChannelArrayRequesterImpl::shared_pointer syncCreateChannelArray(
Channel::shared_pointer const & channel, PVStructure::shared_pointer pvRequest, bool debug = false);
private:
void test_implementation();
void test_providerName();
void test_createEmptyChannel();
void test_createChannelWithInvalidPriority();
void test_createChannel();
void test_recreateChannelOnDestroyedProvider();
void test_findEmptyChannel();
void test_findChannel();
void test_channel();
void test_channelGetWithInvalidChannelAndRequester();
void test_channelGetNoProcess();
void test_channelGetIntProcess();
void test_channelGetNotYetConnected();
void test_channelGetIntProcessInternal(Channel::shared_pointer channel, std::string const & testMethodName);
void test_channelGetTestNoConnection();
void test_channelPutWithInvalidChannelAndRequester();
void test_channelPutNoProcess();
void test_channelPutIntProcess();
void test_channelPutNotYetConnected();
void test_channelPutIntProcessInternal(Channel::shared_pointer channel, std::string const & testMethodName);
void test_channelPutTestNoConnection();
void test_channelGetFieldAll();
void test_channelGetFieldValue();
void test_channelGetFieldInvalid();
void test_channelProcess();
void test_channelProcesstWithInvalidRequesterAndRequest();
void test_channelProcessNoConnection();
void test_channelPutGetWithInvalidRequesterAndRequest();
void test_channelPutGetNoProcess_putGet();
void test_channelPutGetNoProcess_getPut();
void test_channelPutGetNoProcess_getGet();
void test_channelPutGetNoProcess_destroy();
void test_channelPutGetIntProcess();
void test_channelRPC();
void test_channelRPC_destroy();
void test_channelRPCWithInvalidRequesterAndRequest();
void test_channelMonitorWithInvalidRequesterAndRequest();
void test_channelMonitor(int queueSize);
void test_channelArray();
void test_channelArray_destroy();
void test_channelArrayTestNoConnection();
void test_stressPutAndGetLargeArray();
void test_stressConnectDisconnect();
void test_stressConnectGetDisconnect();
void test_stressMonitorAndProcess();
PVStructure::shared_pointer createSumArgumentStructure(int a, int b);
PVStructure::shared_pointer createArrayPvRequest();
};
#endif
|