Get up to date with epics-base
This commit is contained in:
@@ -247,9 +247,9 @@ struct SpamProvider : public pva::ChannelProvider,
|
||||
virtual pva::ChannelFind::shared_pointer channelFind(std::string const & name,
|
||||
pva::ChannelFindRequester::shared_pointer const & requester) OVERRIDE FINAL
|
||||
{
|
||||
std::cerr<<"XXX "<<name<<"\n";
|
||||
std::cerr<<"XXX '"<<name<<"'\n";
|
||||
pva::ChannelFind::shared_pointer ret;
|
||||
if(name==this->channelName) {
|
||||
if(name.size()>=this->channelName.size() && strncmp(name.c_str(), this->channelName.c_str(), this->channelName.size())==0) {
|
||||
ret = shared_from_this();
|
||||
}
|
||||
std::cout<<__FUNCTION__<<" "<<name<<" found="<<!!ret<<"\n";
|
||||
@@ -264,7 +264,7 @@ struct SpamProvider : public pva::ChannelProvider,
|
||||
short priority, std::string const & address) OVERRIDE FINAL
|
||||
{
|
||||
std::tr1::shared_ptr<SpamChannel> ret;
|
||||
if(name==channelName) {
|
||||
if(name.size()>=this->channelName.size() && strncmp(name.c_str(), this->channelName.c_str(), this->channelName.size())==0) {
|
||||
ret.reset(new SpamChannel(shared_from_this(), channelName, requester));
|
||||
}
|
||||
std::cout<<__FUNCTION__<<" "<<name<<" connect "<<ret.get()<<"\n";
|
||||
|
||||
@@ -580,7 +580,7 @@ int main (int argc, char *argv[])
|
||||
{
|
||||
const ServerEntry& entry = iter->second;
|
||||
|
||||
cout << "GUID 0x" << entry.guid << ", version " << (int)entry.version << ": "
|
||||
cout << "GUID 0x" << entry.guid << " version " << (int)entry.version << ": "
|
||||
<< entry.protocol << "@[";
|
||||
|
||||
size_t count = entry.addresses.size();
|
||||
|
||||
@@ -259,19 +259,39 @@ struct Get2PutProxy : public ChannelGet
|
||||
ChannelPut::shared_pointer op; // the put we wrap
|
||||
std::tr1::shared_ptr<Get2PutProxy::Req> op_request; // keep our Req alive
|
||||
|
||||
ChannelPut::shared_pointer OP() {
|
||||
epicsGuard<epicsMutex> G(op_request->mutex);
|
||||
return op;
|
||||
}
|
||||
|
||||
Get2PutProxy() {}
|
||||
virtual ~Get2PutProxy() {}
|
||||
|
||||
virtual void destroy() OVERRIDE FINAL
|
||||
{ op->destroy(); }
|
||||
{
|
||||
ChannelPut::shared_pointer O(OP());
|
||||
if(O) O->destroy();
|
||||
}
|
||||
virtual std::tr1::shared_ptr<Channel> getChannel() OVERRIDE FINAL
|
||||
{ return op->getChannel(); }
|
||||
{
|
||||
ChannelPut::shared_pointer O(OP());
|
||||
return O ? O->getChannel() : std::tr1::shared_ptr<Channel>();
|
||||
}
|
||||
virtual void cancel() OVERRIDE FINAL
|
||||
{ op->cancel(); }
|
||||
{
|
||||
ChannelPut::shared_pointer O(OP());
|
||||
if(O) O->cancel();
|
||||
}
|
||||
virtual void lastRequest() OVERRIDE FINAL
|
||||
{ op->lastRequest(); }
|
||||
{
|
||||
ChannelPut::shared_pointer O(OP());
|
||||
if(O) O->lastRequest();
|
||||
}
|
||||
virtual void get() OVERRIDE FINAL
|
||||
{ op->get(); }
|
||||
{
|
||||
ChannelPut::shared_pointer O(OP());
|
||||
if(O) O->get();
|
||||
}
|
||||
};
|
||||
}// namespace
|
||||
|
||||
|
||||
@@ -15,18 +15,22 @@ PROD_LIBS += pvAccess pvData Com
|
||||
include $(PVACCESS_TEST)/utils/Makefile
|
||||
include $(PVACCESS_TEST)/remote/Makefile
|
||||
|
||||
# The testHarness runs all the test programs in a known working order.
|
||||
# pvAccessAllTests runs all the test programs in a known working order.
|
||||
testHarness_SRCS += pvAccessAllTests.c
|
||||
|
||||
PROD_vxWorks = vxTestHarness
|
||||
vxTestHarness_SRCS += $(testHarness_SRCS)
|
||||
TESTSPEC_vxWorks = vxTestHarness.$(MUNCH_SUFFIX); pvAccessAllTests
|
||||
# Name the application pvaTestHarness
|
||||
pvaTestHarness_SRCS = $(testHarness_SRCS)
|
||||
|
||||
PROD_RTEMS += rtemsTestHarness
|
||||
rtemsTestHarness_SRCS += rtemsTestHarness.c rtemsConfig.c
|
||||
rtemsTestHarness_SRCS += $(testHarness_SRCS)
|
||||
TESTSPEC_RTEMS = rtemsTestHarness.$(MUNCH_SUFFIX); pvAccessAllTests
|
||||
# Build for vxWorks
|
||||
PROD_vxWorks = pvaTestHarness
|
||||
TESTSPEC_vxWorks = pvaTestHarness.$(MUNCH_SUFFIX); pvAccessAllTests
|
||||
|
||||
# Build for RTEMS, with harness code & configuration
|
||||
PROD_RTEMS += pvaTestHarness
|
||||
pvaTestHarness_SRCS_RTEMS += rtemsTestHarness.c rtemsConfig.c
|
||||
TESTSPEC_RTEMS = pvaTestHarness.$(MUNCH_SUFFIX); pvAccessAllTests
|
||||
|
||||
# Build test scripts for hosts
|
||||
TESTSCRIPTS_HOST += $(TESTS:%=%.t)
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <stdio.h>
|
||||
#include <epicsThread.h>
|
||||
#include <epicsUnitTest.h>
|
||||
#include <epicsExit.h>
|
||||
|
||||
/* utils */
|
||||
int testAtomicBoolean(void);
|
||||
@@ -31,5 +32,5 @@ void pvAccessAllTests(void)
|
||||
runTest(testCodec);
|
||||
runTest(testChannelAccess);
|
||||
|
||||
epicsExit(0); /* Trigger test harness */
|
||||
}
|
||||
|
||||
|
||||
@@ -1,37 +1,12 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <rtems/rtems_bsdnet.h>
|
||||
#include <rtems/error.h>
|
||||
/*
|
||||
* Copyright information and license terms for this software can be
|
||||
* found in the file LICENSE that is included with the distribution
|
||||
*/
|
||||
|
||||
#include "rtemsNetworking.h"
|
||||
extern void pvAccessAllTests(void);
|
||||
|
||||
#include <epicsExit.h>
|
||||
#include <osdTime.h>
|
||||
|
||||
rtems_task
|
||||
Init (rtems_task_argument ignored)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
rtems_bsdnet_initialize_network ();
|
||||
//rtems_bsdnet_show_if_stats ();
|
||||
|
||||
rtems_time_of_day timeOfDay;
|
||||
if (rtems_clock_get(RTEMS_CLOCK_GET_TOD,&timeOfDay) != RTEMS_SUCCESSFUL) {
|
||||
timeOfDay.year = 2014;
|
||||
timeOfDay.month = 1;
|
||||
timeOfDay.day = 1;
|
||||
timeOfDay.hour = 0;
|
||||
timeOfDay.minute = 0;
|
||||
timeOfDay.second = 0;
|
||||
timeOfDay.ticks = 0;
|
||||
|
||||
rtems_status_code ret = rtems_clock_set(&timeOfDay);
|
||||
if (ret != RTEMS_SUCCESSFUL) {
|
||||
printf("**** Can't set time %s\n", rtems_status_text(ret));
|
||||
}
|
||||
}
|
||||
osdTimeRegister();
|
||||
|
||||
extern void pvAccessAllTests(void);
|
||||
pvAccessAllTests();
|
||||
epicsExit(0);
|
||||
pvAccessAllTests(); /* calls epicsExit(0) */
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user