Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1c8303870 | ||
|
|
a3ef984f4f | ||
|
|
ca86a63180 | ||
|
|
07b79693af | ||
|
|
4ef9e18ac6 | ||
|
|
320cc3c60b | ||
|
|
45d0d76a7f | ||
|
|
b2b42d5f8c | ||
|
|
90b1f2f6da | ||
|
|
2e775ef2fb | ||
|
|
f17d2bbca1 | ||
|
|
79b02254c4 | ||
|
|
19245ce805 | ||
|
|
0fa927afa7 | ||
|
|
d9b3f98e35 | ||
|
|
81e7968230 | ||
|
|
06f3b96992 | ||
| 1038182a16 | |||
| 60091bfe56 | |||
| f4de6dd9b1 | |||
|
|
3d93a80cce | ||
|
|
94eff54fa9 | ||
|
|
e9dde4d2f8 | ||
|
|
0a5e22e5b0 | ||
|
|
3a5cfba4e1 | ||
|
|
07b75e4543 | ||
|
|
e4f150b34f | ||
|
|
ca2ae0d0e7 |
94
.appveyor.yml
Normal file
94
.appveyor.yml
Normal file
@@ -0,0 +1,94 @@
|
||||
# .appveyor.yml for use with EPICS Base ci-scripts
|
||||
# (see: https://github.com/epics-base/ci-scripts)
|
||||
|
||||
cache:
|
||||
- C:\Users\appveyor\.tools
|
||||
|
||||
#---------------------------------#
|
||||
# additional packages #
|
||||
#---------------------------------#
|
||||
|
||||
install:
|
||||
# for the sequencer
|
||||
- cinst re2c
|
||||
- cmd: git submodule update --init --recursive
|
||||
|
||||
#---------------------------------#
|
||||
# repository cloning #
|
||||
#---------------------------------#
|
||||
|
||||
init:
|
||||
# Set autocrlf to make batch files work
|
||||
- git config --global core.autocrlf true
|
||||
|
||||
clone_depth: 50
|
||||
|
||||
# Skipping commits affecting only specific files
|
||||
skip_commits:
|
||||
files:
|
||||
- 'documentation/*'
|
||||
- '**/*.md'
|
||||
|
||||
# Build Configurations: dll/static, regular/debug
|
||||
configuration:
|
||||
- dynamic
|
||||
- static
|
||||
- dynamic-debug
|
||||
- static-debug
|
||||
|
||||
# Environment variables: compiler toolchain, base version, setup file, ...
|
||||
environment:
|
||||
# common / default variables for all jobs
|
||||
SETUP_PATH: .ci-local
|
||||
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
CMP: vs2019
|
||||
BASE: 7.0
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
CMP: gcc
|
||||
BASE: 7.0
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
CMP: vs2017
|
||||
BASE: 7.0
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
CMP: vs2019
|
||||
BASE: 3.15
|
||||
|
||||
# Platform: processor architecture
|
||||
platform:
|
||||
- x64
|
||||
|
||||
#---------------------------------#
|
||||
# building & testing #
|
||||
#---------------------------------#
|
||||
|
||||
build_script:
|
||||
- cmd: python .ci/cue.py prepare
|
||||
- cmd: python .ci/cue.py build
|
||||
|
||||
test_script:
|
||||
- cmd: python .ci/cue.py test
|
||||
|
||||
on_finish:
|
||||
- ps: Get-ChildItem *.tap -Recurse -Force | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
|
||||
- cmd: python .ci/cue.py build test-results -s
|
||||
|
||||
#---------------------------------#
|
||||
# debugging #
|
||||
#---------------------------------#
|
||||
|
||||
## if you want to connect by remote desktop to a failed build, uncomment these lines
|
||||
## note that you will need to connect within the usual build timeout limit (60 minutes)
|
||||
## so you may want to adjust the build matrix above to just build the one of interest
|
||||
|
||||
#on_failure:
|
||||
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
|
||||
#---------------------------------#
|
||||
# notifications #
|
||||
#---------------------------------#
|
||||
|
||||
notifications:
|
||||
- provider: GitHubPullRequest
|
||||
1
.ci
Submodule
1
.ci
Submodule
Submodule .ci added at ad8dd4a136
6
.ci-local/defaults.set
Normal file
6
.ci-local/defaults.set
Normal file
@@ -0,0 +1,6 @@
|
||||
# EPICS Base
|
||||
BASE_DIRNAME=base
|
||||
BASE_REPONAME=epics-base
|
||||
BASE_REPOOWNER=epics-base
|
||||
BASE_VARNAME=EPICS_BASE
|
||||
BASE_RECURSIVE=NO
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e -x
|
||||
|
||||
make -j2
|
||||
|
||||
if [ "$TEST" != "NO" ]
|
||||
then
|
||||
make -j2 tapfiles
|
||||
make -j2 -s test-results
|
||||
fi
|
||||
@@ -1,83 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e -x
|
||||
|
||||
cat << EOF > configure/RELEASE.local
|
||||
EPICS_BASE=$HOME/.source/epics-base
|
||||
EOF
|
||||
|
||||
install -d "$HOME/.source"
|
||||
cd "$HOME/.source"
|
||||
|
||||
git clone --quiet --depth 5 --branch "$BRBASE" https://github.com/${REPOBASE:-epics-base}/epics-base.git epics-base
|
||||
(cd epics-base && git log -n1 )
|
||||
|
||||
EPICS_HOST_ARCH=`sh epics-base/startup/EpicsHostArch`
|
||||
|
||||
# requires wine and g++-mingw-w64-i686
|
||||
if [ "$WINE" = "32" ]
|
||||
then
|
||||
echo "Cross mingw32"
|
||||
sed -i -e '/CMPLR_PREFIX/d' epics-base/configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw
|
||||
cat << EOF >> epics-base/configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw
|
||||
CMPLR_PREFIX=i686-w64-mingw32-
|
||||
EOF
|
||||
cat << EOF >> epics-base/configure/CONFIG_SITE
|
||||
CROSS_COMPILER_TARGET_ARCHS+=win32-x86-mingw
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [ "$STATIC" = "YES" ]
|
||||
then
|
||||
echo "Build static libraries/executables"
|
||||
cat << EOF >> epics-base/configure/CONFIG_SITE
|
||||
SHARED_LIBRARIES=NO
|
||||
STATIC_BUILD=YES
|
||||
EOF
|
||||
fi
|
||||
|
||||
case "$CMPLR" in
|
||||
clang)
|
||||
echo "Host compiler is clang"
|
||||
cat << EOF >> epics-base/configure/os/CONFIG_SITE.Common.$EPICS_HOST_ARCH
|
||||
GNU = NO
|
||||
CMPLR_CLASS = clang
|
||||
CC = clang
|
||||
CCC = clang++
|
||||
EOF
|
||||
|
||||
# hack
|
||||
sed -i -e 's/CMPLR_CLASS = gcc/CMPLR_CLASS = clang/' epics-base/configure/CONFIG.gnuCommon
|
||||
|
||||
clang --version
|
||||
;;
|
||||
*)
|
||||
echo "Host compiler is default"
|
||||
gcc --version
|
||||
;;
|
||||
esac
|
||||
|
||||
cat <<EOF >> epics-base/configure/CONFIG_SITE
|
||||
USR_CPPFLAGS += $USR_CPPFLAGS
|
||||
USR_CFLAGS += $USR_CFLAGS
|
||||
USR_CXXFLAGS += $USR_CXXFLAGS
|
||||
EOF
|
||||
|
||||
# set RTEMS to eg. "4.9" or "4.10"
|
||||
# requires qemu, bison, flex, texinfo, install-info
|
||||
if [ -n "$RTEMS" ]
|
||||
then
|
||||
echo "Cross RTEMS${RTEMS} for pc386"
|
||||
curl -L "https://github.com/mdavidsaver/rsb/releases/download/20171203-${RTEMS}/i386-rtems${RTEMS}-trusty-20171203-${RTEMS}.tar.bz2" \
|
||||
| tar -C / -xmj
|
||||
|
||||
sed -i -e '/^RTEMS_VERSION/d' -e '/^RTEMS_BASE/d' epics-base/configure/os/CONFIG_SITE.Common.RTEMS
|
||||
cat << EOF >> epics-base/configure/os/CONFIG_SITE.Common.RTEMS
|
||||
RTEMS_VERSION=$RTEMS
|
||||
RTEMS_BASE=$HOME/.rtems
|
||||
EOF
|
||||
cat << EOF >> epics-base/configure/CONFIG_SITE
|
||||
CROSS_COMPILER_TARGET_ARCHS += RTEMS-pc386-qemu
|
||||
EOF
|
||||
fi
|
||||
|
||||
make -j2 -C epics-base $EXTRA
|
||||
153
.github/workflows/ci-scripts-build.yml
vendored
Normal file
153
.github/workflows/ci-scripts-build.yml
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
# .github/workflows/ci-scripts-build.yml for use with EPICS Base ci-scripts
|
||||
# (see: https://github.com/epics-base/ci-scripts)
|
||||
|
||||
# This is YAML - indentation levels are crucial
|
||||
|
||||
# Set the 'name:' properties to values that work for you (pvxs)
|
||||
|
||||
name: pvData
|
||||
|
||||
# Trigger on pushes and PRs to any branch
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- .appveyor.yml
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
SETUP_PATH: .ci-local:.ci
|
||||
EPICS_TEST_IMPRECISE_TIMING: YES
|
||||
|
||||
jobs:
|
||||
build-base:
|
||||
name: ${{ matrix.base }}/${{ matrix.os }}/${{ matrix.cmp }}/${{ matrix.configuration }}/${{ matrix.wine }}${{ matrix.rtems }}/${{ matrix.extra }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
# Set environment variables from matrix parameters
|
||||
env:
|
||||
BASE: ${{ matrix.base }}
|
||||
CMP: ${{ matrix.cmp }}
|
||||
BCFG: ${{ matrix.configuration }}
|
||||
WINE: ${{ matrix.wine }}
|
||||
RTEMS: ${{ matrix.rtems }}
|
||||
EXTRA: ${{ matrix.extra }}
|
||||
TEST: ${{ matrix.test }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-20.04
|
||||
cmp: gcc
|
||||
configuration: default
|
||||
base: "7.0"
|
||||
wine: "64"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
cmp: gcc
|
||||
configuration: static
|
||||
base: "7.0"
|
||||
wine: "64"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
cmp: gcc
|
||||
configuration: default
|
||||
base: "3.15"
|
||||
wine: "64"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
cmp: gcc
|
||||
configuration: static
|
||||
base: "7.0"
|
||||
extra: "CMD_CXXFLAGS=-std=c++11"
|
||||
|
||||
- os: ubuntu-16.04
|
||||
cmp: clang
|
||||
configuration: default
|
||||
base: "7.0"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
cmp: clang
|
||||
configuration: default
|
||||
base: "7.0"
|
||||
extra: "CMD_CXXFLAGS=-std=c++11"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
cmp: gcc
|
||||
configuration: default
|
||||
base: "7.0"
|
||||
rtems: "4.10"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
cmp: gcc
|
||||
configuration: default
|
||||
base: "7.0"
|
||||
rtems: "4.9"
|
||||
|
||||
- os: ubuntu-16.04
|
||||
cmp: gcc-4.8
|
||||
utoolchain: true
|
||||
configuration: default
|
||||
base: "7.0"
|
||||
|
||||
- os: ubuntu-16.04
|
||||
cmp: gcc-4.9
|
||||
utoolchain: true
|
||||
configuration: default
|
||||
base: "7.0"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
cmp: gcc-8
|
||||
utoolchain: true
|
||||
configuration: default
|
||||
base: "7.0"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
cmp: clang
|
||||
configuration: default
|
||||
base: "7.0"
|
||||
|
||||
- os: macos-latest
|
||||
cmp: clang
|
||||
configuration: default
|
||||
base: "7.0"
|
||||
|
||||
- os: windows-2019
|
||||
cmp: vs2019
|
||||
configuration: default
|
||||
base: "7.0"
|
||||
|
||||
- os: windows-2019
|
||||
cmp: vs2019
|
||||
configuration: static
|
||||
base: "7.0"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- name: Cache Dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache
|
||||
key: ${{ matrix.base }}/${{ matrix.os }}/${{ matrix.cmp }}/${{ matrix.configuration }}/${{ matrix.wine }}${{ matrix.rtems }}/${{ matrix.extra }}
|
||||
- name: Automatic core dump analysis
|
||||
uses: mdavidsaver/ci-core-dumper@master
|
||||
- name: "apt-get install"
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install qemu-system-x86 g++-mingw-w64-x86-64 gdb
|
||||
if: runner.os == 'Linux'
|
||||
- name: "apt-get install ${{ matrix.cmp }}"
|
||||
run: |
|
||||
sudo apt-get -y install software-properties-common
|
||||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install ${{ matrix.cmp }}
|
||||
if: matrix.utoolchain
|
||||
- name: Prepare and compile dependencies
|
||||
run: python .ci/cue.py prepare
|
||||
- name: Build main module
|
||||
run: python .ci/cue.py build
|
||||
- name: Run main module tests
|
||||
run: python .ci/cue.py test
|
||||
- name: Collect and show test results
|
||||
run: python .ci/cue.py test-results
|
||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule ".ci"]
|
||||
path = .ci
|
||||
url = https://github.com/epics-base/ci-scripts
|
||||
43
.travis.yml
43
.travis.yml
@@ -1,43 +0,0 @@
|
||||
language: c++
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libreadline6-dev
|
||||
- libncurses5-dev
|
||||
- perl
|
||||
- clang
|
||||
- g++-mingw-w64-i686
|
||||
- qemu-system-x86
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- dist: bionic
|
||||
env: BRBASE=7.0 CMPLR=gcc
|
||||
- dist: trusty
|
||||
env: BRBASE=7.0 CMPLR=gcc
|
||||
- dist: bionic
|
||||
env: BRBASE=7.0 CMPLR=clang
|
||||
- dist: trusty
|
||||
env: BRBASE=7.0 CMPLR=clang
|
||||
- dist: trusty
|
||||
env: BRBASE=7.0 USR_CXXFLAGS=-std=c++11
|
||||
- dist: trusty
|
||||
env: BRBASE=7.0 CMPLR=clang USR_CXXFLAGS=-std=c++11
|
||||
- dist: trusty
|
||||
env: BRBASE=7.0 WINE=32 TEST=NO STATIC=YES
|
||||
- dist: trusty
|
||||
env: BRBASE=7.0 WINE=32 TEST=NO STATIC=NO
|
||||
- dist: trusty
|
||||
env: BRBASE=7.0 RTEMS=4.10 TEST=NO
|
||||
- dist: trusty
|
||||
env: BRBASE=7.0 RTEMS=4.9 TEST=NO
|
||||
- dist: trusty
|
||||
env: BRBASE=3.16
|
||||
- dist: trusty
|
||||
env: BRBASE=3.15
|
||||
|
||||
install:
|
||||
- ./.ci/travis-prepare.sh
|
||||
script:
|
||||
- ./.ci/travis-build.sh
|
||||
2
Doxyfile
2
Doxyfile
@@ -38,7 +38,7 @@ PROJECT_NAME = "PVData C++"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 8.0.1-dev
|
||||
PROJECT_NUMBER = 8.0.4
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
EPICS_PVD_MAJOR_VERSION = 8
|
||||
EPICS_PVD_MINOR_VERSION = 0
|
||||
EPICS_PVD_MAINTENANCE_VERSION = 1
|
||||
EPICS_PVD_MAINTENANCE_VERSION = 4
|
||||
|
||||
# Development flag, set to zero for release versions
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ PROJECT_NAME = "PVData C++"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 8.0.0
|
||||
PROJECT_NUMBER = 8.0.4
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
||||
@@ -2,6 +2,30 @@
|
||||
|
||||
@page release_notes Release Notes
|
||||
|
||||
Release 8.1.0 (Feb 2021)
|
||||
========================
|
||||
|
||||
- Incompatible changes
|
||||
- Remove ByteBuffer::align()
|
||||
- Compatible changes
|
||||
- Deprecate SerializableControl::alignBuffer() and DeserializableControl::alignData()
|
||||
- shared_vector_convert<>() fix convert of empty, untyped, array
|
||||
|
||||
Release 8.0.3 (July 2020)
|
||||
=========================
|
||||
|
||||
- Incompatible changes
|
||||
- Removed THROW_BASE_EXCEPTION_CAUSE() macro which has long ignored its cause.
|
||||
Any external users should switch to the functionally identical THROW_BASE_EXCEPTION_CAUSE()
|
||||
- Various printing of functions now conditionally escape strings
|
||||
including quote '\"' and similar charactors.
|
||||
|
||||
Release 8.0.2 (May 2020)
|
||||
========================
|
||||
|
||||
- Changes to documentation and unittests.
|
||||
No functional changes to library.
|
||||
|
||||
Release 8.0.1 (Nov 2019)
|
||||
==========================
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ static FieldCreatePtr fieldCreate = getFieldCreate();
|
||||
|
||||
struct CreateRequestImpl {
|
||||
|
||||
struct Node
|
||||
struct Node
|
||||
{
|
||||
string name;
|
||||
vector<Node> nodes;
|
||||
@@ -55,7 +55,7 @@ struct CreateRequestImpl {
|
||||
|
||||
|
||||
CreateRequestImpl() {}
|
||||
|
||||
|
||||
|
||||
void removeBlanks(string& str)
|
||||
{
|
||||
@@ -129,7 +129,7 @@ struct CreateRequestImpl {
|
||||
if(pos==string::npos) break;
|
||||
numValues++;
|
||||
index = pos +1;
|
||||
}
|
||||
}
|
||||
vector<string> valueList(numValues,"");
|
||||
index=0;
|
||||
for(size_t i=0; i<numValues; i++) {
|
||||
@@ -483,4 +483,3 @@ PVStructure::shared_pointer createRequest(std::string const & request)
|
||||
|
||||
|
||||
}} // namespace
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ bool compare(const Structure& a, const Structure& b)
|
||||
if(&a==&b)
|
||||
return true;
|
||||
if (a.getID()!=b.getID())
|
||||
return false;
|
||||
return false;
|
||||
size_t nflds=a.getNumberFields();
|
||||
if (b.getNumberFields()!=nflds)
|
||||
return false;
|
||||
@@ -111,7 +111,7 @@ bool compare(const Union& a, const Union& b)
|
||||
if(&a==&b)
|
||||
return true;
|
||||
if (a.getID()!=b.getID())
|
||||
return false;
|
||||
return false;
|
||||
size_t nflds=a.getNumberFields();
|
||||
if (b.getNumberFields()!=nflds)
|
||||
return false;
|
||||
@@ -268,7 +268,7 @@ bool compareField(const PVUnion* left, const PVUnion* right)
|
||||
|
||||
if(*ls!=*right->getUnion())
|
||||
return false;
|
||||
|
||||
|
||||
if (ls->isVariant())
|
||||
{
|
||||
const PVField::const_shared_pointer& lval = left->get();
|
||||
|
||||
@@ -24,7 +24,7 @@ using std::tr1::static_pointer_cast;
|
||||
using std::size_t;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
|
||||
static std::vector<string> split(string commaSeparatedList) {
|
||||
@@ -60,7 +60,7 @@ void Convert::getString(string *buf,PVField const *pvField,int /*indentLevel*/)
|
||||
size_t Convert::fromString(PVStructurePtr const &pvStructure, StringArray const & from, size_t fromStartIndex)
|
||||
{
|
||||
size_t processed = 0;
|
||||
|
||||
|
||||
PVFieldPtrArray const & fieldsData = pvStructure->getPVFields();
|
||||
if (fieldsData.size() != 0) {
|
||||
size_t length = pvStructure->getStructure()->getNumberFields();
|
||||
@@ -93,7 +93,7 @@ size_t Convert::fromString(PVStructurePtr const &pvStructure, StringArray const
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return processed;
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ std::tr1::shared_ptr<PVField> Field::build() const
|
||||
|
||||
std::ostream& operator<<(std::ostream& o, const Field& f)
|
||||
{
|
||||
return f.dump(o);
|
||||
return f.dump(o);
|
||||
};
|
||||
|
||||
Scalar::Scalar(ScalarType scalarType)
|
||||
@@ -136,18 +136,18 @@ std::ostream& Scalar::dump(std::ostream& o) const
|
||||
string Scalar::getID() const
|
||||
{
|
||||
static const string idScalarLUT[] = {
|
||||
"boolean", // pvBoolean
|
||||
"byte", // pvByte
|
||||
"short", // pvShort
|
||||
"int", // pvInt
|
||||
"long", // pvLong
|
||||
"ubyte", // pvUByte
|
||||
"ushort", // pvUShort
|
||||
"uint", // pvUInt
|
||||
"ulong", // pvULong
|
||||
"float", // pvFloat
|
||||
"double", // pvDouble
|
||||
"string" // pvString
|
||||
"boolean", // pvBoolean
|
||||
"byte", // pvByte
|
||||
"short", // pvShort
|
||||
"int", // pvInt
|
||||
"long", // pvLong
|
||||
"ubyte", // pvUByte
|
||||
"ushort", // pvUShort
|
||||
"uint", // pvUInt
|
||||
"ulong", // pvULong
|
||||
"float", // pvFloat
|
||||
"double", // pvDouble
|
||||
"string" // pvString
|
||||
};
|
||||
return idScalarLUT[scalarType];
|
||||
}
|
||||
@@ -227,7 +227,7 @@ static void serializeStructureField(const Structure* structure, ByteBuffer* buff
|
||||
// to optimize default (non-empty) IDs optimization
|
||||
// empty IDs are not allowed
|
||||
string id = structure->getID();
|
||||
if (id == Structure::DEFAULT_ID) // TODO slow comparison
|
||||
if (id == Structure::DEFAULT_ID) // TODO slow comparison
|
||||
SerializeHelper::serializeString(string(), buffer, control);
|
||||
else
|
||||
SerializeHelper::serializeString(id, buffer, control);
|
||||
@@ -263,13 +263,13 @@ static StructureConstPtr deserializeStructureField(const FieldCreate* fieldCreat
|
||||
|
||||
static void serializeUnionField(const Union* punion, ByteBuffer* buffer, SerializableControl* control)
|
||||
{
|
||||
// to optimize default (non-empty) IDs optimization
|
||||
// empty IDs are not allowed
|
||||
string id = punion->getID();
|
||||
if (id == Union::DEFAULT_ID) // TODO slow comparison
|
||||
// to optimize default (non-empty) IDs optimization
|
||||
// empty IDs are not allowed
|
||||
string id = punion->getID();
|
||||
if (id == Union::DEFAULT_ID) // TODO slow comparison
|
||||
SerializeHelper::serializeString(string(), buffer, control);
|
||||
else
|
||||
SerializeHelper::serializeString(id, buffer, control);
|
||||
else
|
||||
SerializeHelper::serializeString(id, buffer, control);
|
||||
|
||||
FieldConstPtrArray const & fields = punion->getFields();
|
||||
StringArray const & fieldNames = punion->getFieldNames();
|
||||
@@ -297,7 +297,7 @@ static UnionConstPtr deserializeUnionField(const FieldCreate* fieldCreate, ByteB
|
||||
if (id.empty())
|
||||
return fieldCreate->createUnion(fieldNames, fields);
|
||||
else
|
||||
return fieldCreate->createUnion(id, fieldNames, fields);
|
||||
return fieldCreate->createUnion(id, fieldNames, fields);
|
||||
}
|
||||
|
||||
Array::Array(Type type)
|
||||
@@ -323,18 +323,18 @@ ScalarArray::~ScalarArray()
|
||||
const string ScalarArray::getIDScalarArrayLUT() const
|
||||
{
|
||||
static const string idScalarArrayLUT[] = {
|
||||
"boolean[]", // pvBoolean
|
||||
"byte[]", // pvByte
|
||||
"short[]", // pvShort
|
||||
"int[]", // pvInt
|
||||
"long[]", // pvLong
|
||||
"ubyte[]", // pvUByte
|
||||
"ushort[]", // pvUShort
|
||||
"uint[]", // pvUInt
|
||||
"ulong[]", // pvULong
|
||||
"float[]", // pvFloat
|
||||
"double[]", // pvDouble
|
||||
"string[]" // pvString
|
||||
"boolean[]", // pvBoolean
|
||||
"byte[]", // pvByte
|
||||
"short[]", // pvShort
|
||||
"int[]", // pvInt
|
||||
"long[]", // pvLong
|
||||
"ubyte[]", // pvUByte
|
||||
"ushort[]", // pvUShort
|
||||
"uint[]", // pvUInt
|
||||
"ulong[]", // pvULong
|
||||
"float[]", // pvFloat
|
||||
"double[]", // pvDouble
|
||||
"string[]" // pvString
|
||||
};
|
||||
return idScalarArrayLUT[elementType];
|
||||
}
|
||||
@@ -427,7 +427,7 @@ StructureArray::~StructureArray()
|
||||
|
||||
string StructureArray::getID() const
|
||||
{
|
||||
return pstructure->getID() + "[]";
|
||||
return pstructure->getID() + "[]";
|
||||
}
|
||||
|
||||
std::ostream& StructureArray::dump(std::ostream& o) const
|
||||
@@ -467,7 +467,7 @@ UnionArray::~UnionArray()
|
||||
|
||||
string UnionArray::getID() const
|
||||
{
|
||||
return punion->getID() + "[]";
|
||||
return punion->getID() + "[]";
|
||||
}
|
||||
|
||||
std::ostream& UnionArray::dump(std::ostream& o) const
|
||||
@@ -555,7 +555,7 @@ Structure::~Structure()
|
||||
|
||||
string Structure::getID() const
|
||||
{
|
||||
return id;
|
||||
return id;
|
||||
}
|
||||
|
||||
FieldConstPtr Structure::getField(string const & fieldName) const {
|
||||
@@ -771,7 +771,7 @@ int32 Union::guess(Type t, ScalarType s) const
|
||||
|
||||
string Union::getID() const
|
||||
{
|
||||
return id;
|
||||
return id;
|
||||
}
|
||||
|
||||
FieldConstPtr Union::getField(string const & fieldName) const {
|
||||
@@ -966,7 +966,7 @@ FieldBuilder::FieldBuilder(const FieldBuilderPtr & _parentBuilder,
|
||||
{}
|
||||
|
||||
FieldBuilder::FieldBuilder(FieldBuilderPtr const & _parentBuilder,
|
||||
string const & _nestedName,
|
||||
string const & _nestedName,
|
||||
Type _nestedClassToBuild, bool _nestedArray)
|
||||
:fieldCreate(_parentBuilder->fieldCreate)
|
||||
,idSet(false)
|
||||
@@ -979,10 +979,10 @@ FieldBuilder::FieldBuilder(FieldBuilderPtr const & _parentBuilder,
|
||||
|
||||
void FieldBuilder::reset()
|
||||
{
|
||||
id.erase();
|
||||
id.erase();
|
||||
idSet = false;
|
||||
fieldNames.clear();
|
||||
fields.clear();
|
||||
fieldNames.clear();
|
||||
fields.clear();
|
||||
}
|
||||
|
||||
FieldBuilderPtr FieldBuilder::begin()
|
||||
@@ -1001,7 +1001,7 @@ FieldBuilderPtr FieldBuilder::begin(StructureConstPtr S)
|
||||
FieldBuilderPtr FieldBuilder::setId(string const & id)
|
||||
{
|
||||
this->id = id;
|
||||
idSet = true;
|
||||
idSet = true;
|
||||
return shared_from_this();
|
||||
}
|
||||
|
||||
@@ -1023,7 +1023,7 @@ FieldBuilderPtr FieldBuilder::add(string const & name, FieldConstPtr const & fie
|
||||
} else if(*cur!=*field) {
|
||||
THROW_EXCEPTION2(std::runtime_error, "duplicate field name w/ different type : "+name);
|
||||
} // else exact duplicate is silently ignored
|
||||
return shared_from_this();
|
||||
return shared_from_this();
|
||||
}
|
||||
|
||||
FieldBuilderPtr FieldBuilder::addArray(string const & name, ScalarType scalarType)
|
||||
@@ -1065,7 +1065,7 @@ FieldBuilderPtr FieldBuilder::addArray(string const & name, FieldConstPtr const
|
||||
msg << element->getType();
|
||||
THROW_EXCEPTION2(std::invalid_argument, msg.str());
|
||||
}
|
||||
|
||||
|
||||
return add(name, fld);
|
||||
}
|
||||
|
||||
@@ -1100,7 +1100,7 @@ StructureConstPtr FieldBuilder::createStructure()
|
||||
{
|
||||
if (parentBuilder.get())
|
||||
THROW_EXCEPTION2(std::runtime_error, "createStructure() called in nested FieldBuilder");
|
||||
|
||||
|
||||
StructureConstPtr field(static_pointer_cast<const Structure>(createFieldInternal(structure)));
|
||||
reset();
|
||||
return field;
|
||||
@@ -1110,7 +1110,7 @@ UnionConstPtr FieldBuilder::createUnion()
|
||||
{
|
||||
if (parentBuilder.get())
|
||||
THROW_EXCEPTION2(std::runtime_error, "createUnion() called in nested FieldBuilder");
|
||||
|
||||
|
||||
UnionConstPtr field(static_pointer_cast<const Union>(createFieldInternal(union_)));
|
||||
reset();
|
||||
return field;
|
||||
@@ -1178,7 +1178,7 @@ FieldBuilderPtr FieldBuilder::endNested()
|
||||
{
|
||||
if (!parentBuilder)
|
||||
THROW_EXCEPTION2(std::runtime_error, "FieldBuilder::endNested() can only be called to create nested fields");
|
||||
|
||||
|
||||
FieldConstPtr nestedField = createFieldInternal(nestedClassToBuild);
|
||||
|
||||
if(createNested) {
|
||||
@@ -1246,7 +1246,7 @@ ScalarArrayConstPtr FieldCreate::createScalarArray(ScalarType elementType) const
|
||||
strm << elementType;
|
||||
THROW_EXCEPTION2(std::invalid_argument, strm.str());
|
||||
}
|
||||
|
||||
|
||||
return scalarArrays[elementType];
|
||||
}
|
||||
|
||||
@@ -1448,7 +1448,7 @@ static int decodeScalar(int8 code)
|
||||
pvUInt, // unsigned 32-bits
|
||||
pvULong // unsigned 64-bits
|
||||
};
|
||||
|
||||
|
||||
static const int floatLUT[] =
|
||||
{
|
||||
-1, // reserved
|
||||
@@ -1655,4 +1655,3 @@ namespace std{
|
||||
return o << "nullptr";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ PVArray::PVArray(FieldConstPtr const & field)
|
||||
{
|
||||
capacityMutable = false;
|
||||
PVField::setImmutable();
|
||||
}
|
||||
}
|
||||
|
||||
bool PVArray::isCapacityMutable() const
|
||||
{
|
||||
@@ -49,7 +49,7 @@ PVArray::PVArray(FieldConstPtr const & field)
|
||||
|
||||
std::ostream& operator<<(format::array_at_internal const& manip, const PVArray& array)
|
||||
{
|
||||
return array.dumpValue(manip.stream, manip.index);
|
||||
return array.dumpValue(manip.stream, manip.index);
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
@@ -144,8 +144,7 @@ PVString::PVString(ScalarConstPtr const & scalar)
|
||||
|
||||
std::ostream& PVString::dumpValue(std::ostream& o) const
|
||||
{
|
||||
// we escape, but do not quote, for scalar string
|
||||
o<<escape(get());
|
||||
o<<maybeQuote(get());
|
||||
return o;
|
||||
}
|
||||
|
||||
@@ -160,17 +159,17 @@ void PVString::serialize(ByteBuffer *pbuffer,
|
||||
void PVString::serialize(ByteBuffer *pbuffer,
|
||||
SerializableControl *pflusher, size_t offset, size_t count) const
|
||||
{
|
||||
// check bounds
|
||||
// check bounds
|
||||
const size_t length = storage.value.length();
|
||||
/*if (offset < 0) offset = 0;
|
||||
else*/ if (offset > length) offset = length;
|
||||
//if (count < 0) count = length;
|
||||
/*if (offset < 0) offset = 0;
|
||||
else*/ if (offset > length) offset = length;
|
||||
//if (count < 0) count = length;
|
||||
|
||||
const size_t maxCount = length - offset;
|
||||
if (count > maxCount)
|
||||
count = maxCount;
|
||||
|
||||
// write
|
||||
const size_t maxCount = length - offset;
|
||||
if (count > maxCount)
|
||||
count = maxCount;
|
||||
|
||||
// write
|
||||
SerializeHelper::serializeSubstring(storage.value, offset, count, pbuffer, pflusher);
|
||||
}
|
||||
|
||||
@@ -191,7 +190,7 @@ template<typename T>
|
||||
PVValueArray<T>::PVValueArray(ScalarArrayConstPtr const & scalarArray)
|
||||
:base_t(scalarArray)
|
||||
,value()
|
||||
|
||||
|
||||
{}
|
||||
|
||||
PVValueArray<PVStructurePtr>::PVValueArray(StructureArrayConstPtr const & structureArray)
|
||||
@@ -233,7 +232,7 @@ std::ostream& PVValueArray<T>::dumpValue(std::ostream& o) const
|
||||
template<>
|
||||
std::ostream& PVValueArray<std::string>::dumpValue(std::ostream& o, size_t index) const
|
||||
{
|
||||
return o << '"' << escape(this->view().at(index)) << '"';
|
||||
return o << maybeQuote(this->view().at(index));
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -244,9 +243,9 @@ std::ostream& PVValueArray<std::string>::dumpValue(std::ostream& o) const
|
||||
end(v.end());
|
||||
o << '[';
|
||||
if(it!=end) {
|
||||
o << '"' << escape(*it++) << '"';
|
||||
o << maybeQuote(*it++);
|
||||
for(; it!=end; ++it)
|
||||
o << ", \"" << escape(*it) << '"';
|
||||
o << ", " << maybeQuote(*it);
|
||||
|
||||
}
|
||||
return o << ']';
|
||||
@@ -627,7 +626,7 @@ PVScalarArrayPtr PVDataCreate::createPVScalarArray(
|
||||
return PVScalarArrayPtr(new PVStringArray(scalarArray));
|
||||
}
|
||||
throw std::logic_error("PVDataCreate::createPVScalarArray should never get here");
|
||||
|
||||
|
||||
}
|
||||
|
||||
PVScalarArrayPtr PVDataCreate::createPVScalarArray(
|
||||
@@ -780,4 +779,3 @@ namespace std{
|
||||
return o << "nullptr";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ size_t PVField::getNumberFields() const
|
||||
|
||||
void PVField::setImmutable() {immutable = true;}
|
||||
|
||||
void PVField::postPut()
|
||||
void PVField::postPut()
|
||||
{
|
||||
if(postHandler) postHandler->postPut();
|
||||
}
|
||||
@@ -91,7 +91,7 @@ bool PVField::equals(PVField &pv)
|
||||
|
||||
std::ostream& operator<<(std::ostream& o, const PVField& f)
|
||||
{
|
||||
return f.dumpValue(o);
|
||||
return f.dumpValue(o);
|
||||
};
|
||||
|
||||
string PVField::getFullName() const
|
||||
|
||||
@@ -38,7 +38,7 @@ PVStructure::PVStructure(StructureConstPtr const & structurePtr)
|
||||
pvFields.push_back(pvDataCreate->createPVField(fields[i]));
|
||||
}
|
||||
for(size_t i=0; i<numberFields; i++) {
|
||||
pvFields[i]->setParentAndName(this,fieldNames[i]);
|
||||
pvFields[i]->setParentAndName(this,fieldNames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ PVFieldPtr PVStructure::getSubFieldImpl(const char *name, bool throws) const
|
||||
std::stringstream ss;
|
||||
ss << "Failed to get field: " << fullName << " ("
|
||||
<< std::string(fullName, sep) << " not found)";
|
||||
throw std::runtime_error(ss.str());
|
||||
throw std::runtime_error(ss.str());
|
||||
}
|
||||
else
|
||||
return PVFieldPtr();
|
||||
@@ -184,7 +184,7 @@ PVFieldPtr PVStructure::getSubFieldImpl(const char *name, bool throws) const
|
||||
std::stringstream ss;
|
||||
ss << "Failed to get field: " << fullName
|
||||
<< " (" << std::string(fullName, sep)
|
||||
<< " is not a structure)";
|
||||
<< " is not a structure)";
|
||||
throw std::runtime_error(ss.str());
|
||||
}
|
||||
else
|
||||
@@ -307,22 +307,22 @@ std::ostream& PVStructure::dumpValue(std::ostream& o) const
|
||||
o << format::indent() << getStructure()->getID() << ' ' << getFieldName();
|
||||
o << std::endl;
|
||||
{
|
||||
format::indent_scope s(o);
|
||||
format::indent_scope s(o);
|
||||
|
||||
PVFieldPtrArray const & fieldsData = getPVFields();
|
||||
if (fieldsData.size() != 0) {
|
||||
size_t length = getStructure()->getNumberFields();
|
||||
for(size_t i=0; i<length; i++) {
|
||||
PVFieldPtr fieldField = fieldsData[i];
|
||||
Type type = fieldField->getField()->getType();
|
||||
if (type == scalar || type == scalarArray)
|
||||
o << format::indent() << fieldField->getField()->getID() << ' ' << fieldField->getFieldName() << ' ' << *(fieldField.get()) << std::endl;
|
||||
else
|
||||
o << *(fieldField.get());
|
||||
}
|
||||
}
|
||||
PVFieldPtrArray const & fieldsData = getPVFields();
|
||||
if (fieldsData.size() != 0) {
|
||||
size_t length = getStructure()->getNumberFields();
|
||||
for(size_t i=0; i<length; i++) {
|
||||
PVFieldPtr fieldField = fieldsData[i];
|
||||
Type type = fieldField->getField()->getType();
|
||||
if (type == scalar || type == scalarArray)
|
||||
o << format::indent() << fieldField->getField()->getID() << ' ' << fieldField->getFieldName() << ' ' << *(fieldField.get()) << std::endl;
|
||||
else
|
||||
o << *(fieldField.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
return o;
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -218,10 +218,10 @@ std::ostream& PVStructureArray::dumpValue(std::ostream& o) const
|
||||
size_t length = getLength();
|
||||
if (length > 0)
|
||||
{
|
||||
format::indent_scope s(o);
|
||||
format::indent_scope s(o);
|
||||
|
||||
for (size_t i = 0; i < length; i++)
|
||||
dumpValue(o, i);
|
||||
dumpValue(o, i);
|
||||
}
|
||||
|
||||
return o;
|
||||
|
||||
@@ -23,7 +23,7 @@ using std::size_t;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
|
||||
#define PVUNION_UNDEFINED_INDEX -1
|
||||
const int32 PVUnion::UNDEFINED_INDEX = PVUNION_UNDEFINED_INDEX;
|
||||
|
||||
@@ -75,13 +75,13 @@ PVFieldPtr PVUnion::select(int32 index)
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
PVFieldPtr PVUnion::select(string const & fieldName)
|
||||
{
|
||||
int32 index = variant ? -1 : static_cast<int32>(unionPtr->getFieldIndex(fieldName));
|
||||
if (index == -1)
|
||||
if (index == -1)
|
||||
throw std::invalid_argument("no such fieldName");
|
||||
return select(index);
|
||||
return select(index);
|
||||
}
|
||||
|
||||
void PVUnion::set(int32 index, PVFieldPtr const & value)
|
||||
@@ -94,14 +94,14 @@ void PVUnion::set(int32 index, PVFieldPtr const & value)
|
||||
{
|
||||
// for undefined index we accept only null values
|
||||
if (value)
|
||||
throw std::invalid_argument("non-null value for index == UNDEFINED_INDEX");
|
||||
throw std::invalid_argument("non-null value for index == UNDEFINED_INDEX");
|
||||
}
|
||||
else if (index < 0 || size_t(index) >= unionPtr->getFields().size())
|
||||
throw std::invalid_argument("index out of bounds");
|
||||
else if (!value)
|
||||
throw std::invalid_argument("Can't set defined index w/ NULL");
|
||||
else if (value->getField() != unionPtr->getField(index))
|
||||
throw std::invalid_argument("selected field and its introspection data do not match");
|
||||
throw std::invalid_argument("selected field and its introspection data do not match");
|
||||
}
|
||||
|
||||
selector = index;
|
||||
@@ -136,7 +136,7 @@ void PVUnion::serialize(ByteBuffer *pbuffer, SerializableControl *pflusher) cons
|
||||
// write selector value
|
||||
SerializeHelper::writeSize(selector, pbuffer, pflusher);
|
||||
// write value, no value for UNDEFINED_INDEX
|
||||
if (selector != UNDEFINED_INDEX)
|
||||
if (selector != UNDEFINED_INDEX)
|
||||
value->serialize(pbuffer, pflusher);
|
||||
}
|
||||
}
|
||||
@@ -180,20 +180,20 @@ std::ostream& PVUnion::dumpValue(std::ostream& o) const
|
||||
{
|
||||
o << format::indent() << getUnion()->getID() << ' ' << getFieldName() << std::endl;
|
||||
{
|
||||
format::indent_scope s(o);
|
||||
format::indent_scope s(o);
|
||||
const PVField::const_shared_pointer& fieldField = get();
|
||||
if (fieldField.get() == NULL)
|
||||
o << format::indent() << "(none)" << std::endl;
|
||||
else
|
||||
{
|
||||
Type type = fieldField->getField()->getType();
|
||||
if (type == scalar || type == scalarArray)
|
||||
o << format::indent() << fieldField->getField()->getID() << ' ' << fieldField->getFieldName() << ' ' << *(fieldField.get()) << std::endl;
|
||||
else
|
||||
o << *(fieldField.get());
|
||||
}
|
||||
if (fieldField.get() == NULL)
|
||||
o << format::indent() << "(none)" << std::endl;
|
||||
else
|
||||
{
|
||||
Type type = fieldField->getField()->getType();
|
||||
if (type == scalar || type == scalarArray)
|
||||
o << format::indent() << fieldField->getField()->getID() << ' ' << fieldField->getFieldName() << ' ' << *(fieldField.get()) << std::endl;
|
||||
else
|
||||
o << *(fieldField.get());
|
||||
}
|
||||
}
|
||||
return o;
|
||||
return o;
|
||||
}
|
||||
|
||||
void PVUnion::copy(const PVUnion& from)
|
||||
|
||||
@@ -217,10 +217,10 @@ std::ostream& PVUnionArray::dumpValue(std::ostream& o) const
|
||||
size_t length = getLength();
|
||||
if (length > 0)
|
||||
{
|
||||
format::indent_scope s(o);
|
||||
format::indent_scope s(o);
|
||||
|
||||
for (size_t i = 0; i < length; i++)
|
||||
dumpValue(o, i);
|
||||
dumpValue(o, i);
|
||||
}
|
||||
|
||||
return o;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
static
|
||||
StructureConstPtr buildValueAlarm(ScalarType vtype)
|
||||
@@ -123,8 +123,8 @@ StructureConstPtr StandardField::createProperties(string id,FieldConstPtr field,
|
||||
while(gotValueAlarm) {
|
||||
if(type==epics::pvData::scalar || type==epics::pvData::scalarArray) {
|
||||
ScalarType scalarType = (type==epics::pvData::scalar) ?
|
||||
static_pointer_cast<const Scalar>(field)->getScalarType() :
|
||||
static_pointer_cast<const ScalarArray>(field)->getElementType();
|
||||
static_pointer_cast<const Scalar>(field)->getScalarType() :
|
||||
static_pointer_cast<const ScalarArray>(field)->getElementType();
|
||||
switch(scalarType) {
|
||||
case pvBoolean: valueAlarm = booleanAlarmField; break;
|
||||
case pvByte: valueAlarm = byteAlarmField; break;
|
||||
@@ -157,7 +157,7 @@ StructureConstPtr StandardField::createProperties(string id,FieldConstPtr field,
|
||||
if(first->getType()==epics::pvData::scalar
|
||||
&& second->getType()==epics::pvData::scalarArray) {
|
||||
ScalarConstPtr scalarFirst = static_pointer_cast<const Scalar>(first);
|
||||
ScalarArrayConstPtr scalarArraySecond =
|
||||
ScalarArrayConstPtr scalarArraySecond =
|
||||
static_pointer_cast<const ScalarArray>(second);
|
||||
if(scalarFirst->getScalarType()==pvInt
|
||||
&& scalarArraySecond->getElementType()==pvString) {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
StandardPVField::StandardPVField()
|
||||
: standardField(getStandardField()),
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace ScalarTypeFunc {
|
||||
if(type>=pvBoolean && type<=pvDouble) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static const char* names[] = {
|
||||
"boolean",
|
||||
"byte", "short", "int", "long",
|
||||
|
||||
@@ -171,7 +171,7 @@ bool printEnumT(std::ostream& strm, const PVStructure& top, bool fromtop)
|
||||
if(I>=ch.size()) {
|
||||
strm<<" <undefined>";
|
||||
} else {
|
||||
strm<<' '<<escape(ch[I]);
|
||||
strm<<' '<<maybeQuote(ch[I]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -180,7 +180,7 @@ void csvEscape(std::string& S)
|
||||
{
|
||||
// concise, not particularly efficient...
|
||||
std::string temp(escape(S).style(escape::CSV).str());
|
||||
if(S.find_first_of(" ,\\")!=S.npos) {// only quote if necessary (stupid Excel)
|
||||
if(S.find_first_of("\" ,\\")!=S.npos) {// only quote if necessary (stupid Excel)
|
||||
std::string temp2;
|
||||
temp2.reserve(temp.size()+2);
|
||||
temp2.push_back('\"');
|
||||
@@ -188,7 +188,7 @@ void csvEscape(std::string& S)
|
||||
temp2.push_back('\"');
|
||||
temp2.swap(temp);
|
||||
}
|
||||
S = temp;
|
||||
S.swap(temp);
|
||||
}
|
||||
|
||||
bool printTable(std::ostream& strm, const PVStructure& top)
|
||||
@@ -514,4 +514,38 @@ std::ostream& operator<<(std::ostream& strm, const escape& Q)
|
||||
return strm;
|
||||
}
|
||||
|
||||
|
||||
std::ostream& operator<<(std::ostream& strm, const maybeQuote& q)
|
||||
{
|
||||
bool esc = false;
|
||||
for(size_t i=0, N=q.s.size(); i<N && !esc; i++) {
|
||||
switch(q.s[i]) {
|
||||
case '\a':
|
||||
case '\b':
|
||||
case '\f':
|
||||
case '\n':
|
||||
case '\r':
|
||||
case '\t':
|
||||
case ' ':
|
||||
case '\v':
|
||||
case '\\':
|
||||
case '\'':
|
||||
case '\"':
|
||||
esc = true;
|
||||
break;
|
||||
default:
|
||||
if(!isprint(q.s[i])) {
|
||||
esc = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(esc) {
|
||||
strm<<'"'<<escape(q.s)<<'"';
|
||||
} else {
|
||||
strm<<q.s;
|
||||
}
|
||||
return strm;
|
||||
}
|
||||
|
||||
}} //epics::pvData
|
||||
|
||||
@@ -17,7 +17,7 @@ using std::cout;
|
||||
using std::endl;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
template<typename T>
|
||||
void copy(
|
||||
@@ -272,4 +272,3 @@ void copy(
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
|
||||
@@ -42,12 +42,12 @@
|
||||
#define CHECK_POST() assert(words.empty() || words.back()!=0)
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
|
||||
BitSet::shared_pointer BitSet::create(uint32 nbits)
|
||||
{
|
||||
return BitSet::shared_pointer(new BitSet(nbits));
|
||||
}
|
||||
|
||||
|
||||
BitSet::BitSet() {}
|
||||
|
||||
BitSet::BitSet(uint32 nbits)
|
||||
@@ -327,7 +327,7 @@ namespace epics { namespace pvData {
|
||||
SerializeHelper::writeSize(len, buffer, flusher);
|
||||
flusher->ensureBuffer(len);
|
||||
|
||||
n = len / 8;
|
||||
n = len / 8;
|
||||
for (uint32 i = 0; i < n; i++)
|
||||
buffer->putLong(words[i]);
|
||||
|
||||
@@ -338,7 +338,7 @@ namespace epics { namespace pvData {
|
||||
|
||||
void BitSet::deserialize(ByteBuffer* buffer, DeserializableControl* control) {
|
||||
|
||||
uint32 bytes = static_cast<uint32>(SerializeHelper::readSize(buffer, control)); // in bytes
|
||||
uint32 bytes = static_cast<uint32>(SerializeHelper::readSize(buffer, control)); // in bytes
|
||||
|
||||
size_t wordsInUse = (bytes + 7) / BYTES_PER_WORD;
|
||||
words.resize(wordsInUse);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
|
||||
Event::~Event() {
|
||||
|
||||
@@ -494,23 +494,6 @@ public:
|
||||
{
|
||||
return sizeof(T)>1 && _reverseEndianess;
|
||||
}
|
||||
/**
|
||||
* Adjust position to the next multiple of 'size.
|
||||
* @param size The alignment requirement, must be a power of 2. (unchecked)
|
||||
* @param fill value to use for padding bytes (default '\0').
|
||||
*
|
||||
* @note This alignment is absolute, not necessarily with respect to _buffer.
|
||||
*/
|
||||
inline void align(std::size_t size, char fill='\0')
|
||||
{
|
||||
const std::size_t k = size - 1, bufidx = (std::size_t)_position;
|
||||
if(bufidx&k) {
|
||||
std::size_t npad = size-(bufidx&k);
|
||||
assert(npad<=getRemaining());
|
||||
std::fill(_position, _position+npad, fill);
|
||||
_position += npad;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Put a boolean value into the byte buffer.
|
||||
*
|
||||
|
||||
@@ -229,7 +229,6 @@ private:
|
||||
#endif
|
||||
|
||||
#define THROW_BASE_EXCEPTION(msg) THROW_EXCEPTION2(::epics::pvData::BaseException, msg)
|
||||
#define THROW_BASE_EXCEPTION_CAUSE(msg, cause) THROW_EXCEPTION2(::epics::pvData::BaseException, msg)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,14 @@
|
||||
|
||||
#include <shareLib.h>
|
||||
|
||||
#if defined(PVD_INTERNAL)
|
||||
# define PVD_DEPRECATED(msg)
|
||||
#elif __GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 5
|
||||
# define PVD_DEPRECATED(msg) __attribute__((deprecated(msg)))
|
||||
#else
|
||||
# define PVD_DEPRECATED(msg) EPICS_DEPRECATED
|
||||
#endif
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
class SerializableControl;
|
||||
@@ -47,11 +55,7 @@ namespace epics { namespace pvData {
|
||||
* @param size The number of bytes.
|
||||
*/
|
||||
virtual void ensureBuffer(std::size_t size) =0;
|
||||
/**
|
||||
* Add pad bytes to buffer.
|
||||
* @param alignment alignment required.
|
||||
*/
|
||||
virtual void alignBuffer(std::size_t alignment) =0;
|
||||
virtual void alignBuffer(std::size_t alignment) PVD_DEPRECATED("Deprecated for lack of use") {}
|
||||
/**
|
||||
* Method for serializing primitive array data.
|
||||
* Hook for supplying custom serialization implementation.
|
||||
@@ -98,14 +102,8 @@ namespace epics { namespace pvData {
|
||||
* @param size The number of bytes.
|
||||
*/
|
||||
virtual void ensureData(std::size_t size) =0;
|
||||
/**
|
||||
* Align buffer.
|
||||
* Note that this takes care only current buffer alignment.
|
||||
* If streaming protocol is used,
|
||||
* care must be taken that entire stream is aligned.
|
||||
* @param alignment size in bytes, must be power of two.
|
||||
*/
|
||||
virtual void alignData(std::size_t alignment) =0;
|
||||
// Deprecated for lack of use
|
||||
virtual void alignData(std::size_t alignment) PVD_DEPRECATED("Deprecated for lack of use") {};
|
||||
/**
|
||||
* Method for deserializing array data.
|
||||
* Hook for supplying custom deserialization implementation.
|
||||
@@ -150,7 +148,7 @@ namespace epics { namespace pvData {
|
||||
*/
|
||||
virtual void serialize(ByteBuffer *buffer,
|
||||
SerializableControl *flusher) const = 0;
|
||||
/**
|
||||
/**
|
||||
* Deserialize buffer.
|
||||
* @param buffer serialization buffer.
|
||||
* @param flusher deserialization control.
|
||||
@@ -213,7 +211,7 @@ namespace epics { namespace pvData {
|
||||
*/
|
||||
virtual void serialize(ByteBuffer *buffer,
|
||||
SerializableControl *flusher,BitSet *bitSet) const = 0;
|
||||
/**
|
||||
/**
|
||||
* Deserialize buffer.
|
||||
* @param buffer serialization buffer.
|
||||
* @param flusher deserialization control.
|
||||
|
||||
@@ -544,11 +544,11 @@ private:
|
||||
/* Hack alert.
|
||||
* For reasons of simplicity and efficiency, we want to use raw pointers for iteration.
|
||||
* However, shared_ptr::get() isn't defined when !m_sdata, although practically it gives NULL.
|
||||
* Unfortunately, many of the MSVC (<= VS 2010) STL methods assert() that iterators are never NULL.
|
||||
* Unfortunately, many of the MSVC (<= VS 2013) STL methods assert() that iterators are never NULL.
|
||||
* So we fudge here by abusing 'this' so that our iterators are always !NULL.
|
||||
*/
|
||||
inline E* base_ptr() const {
|
||||
#if defined(_MSC_VER) && _MSC_VER<=1600
|
||||
#if defined(_MSC_VER) && _MSC_VER<=1800
|
||||
return this->m_count ? this->m_sdata.get() : (E*)(this-1);
|
||||
#else
|
||||
return this->m_sdata.get();
|
||||
@@ -837,9 +837,13 @@ namespace detail {
|
||||
typedef typename meta::strip_const<TO>::type to_t;
|
||||
ScalarType stype = src.original_type(),
|
||||
dtype = (ScalarType)ScalarTypeID<TO>::value;
|
||||
if(stype==dtype) {
|
||||
if(src.empty()) {
|
||||
return shared_vector<TO>();
|
||||
|
||||
} else if(stype==dtype) {
|
||||
// no convert needed
|
||||
return shared_vector<TO>(src, detail::_shared_vector_cast_tag());
|
||||
|
||||
} else {
|
||||
// alloc and convert
|
||||
shared_vector<to_t> ret(src.size()/ScalarTypeFunc::elementSize(stype));
|
||||
|
||||
@@ -28,10 +28,10 @@ namespace epics { namespace pvData {
|
||||
class epicsShareClass Status : public epics::pvData::Serializable {
|
||||
public:
|
||||
POINTER_DEFINITIONS(Status);
|
||||
/**
|
||||
* Status type enum.
|
||||
*/
|
||||
enum StatusType {
|
||||
/**
|
||||
* Status type enum.
|
||||
*/
|
||||
enum StatusType {
|
||||
/** Operation completed successfully. */
|
||||
STATUSTYPE_OK,
|
||||
/** Operation completed successfully, but there is a warning message. */
|
||||
@@ -40,11 +40,11 @@ namespace epics { namespace pvData {
|
||||
STATUSTYPE_ERROR,
|
||||
/** Operation failed due to an unexpected error. */
|
||||
STATUSTYPE_FATAL
|
||||
};
|
||||
|
||||
static const char* StatusTypeName[];
|
||||
|
||||
static Status Ok;
|
||||
};
|
||||
|
||||
static const char* StatusTypeName[];
|
||||
|
||||
static Status Ok;
|
||||
|
||||
static inline Status warn(const std::string& m) { return Status(STATUSTYPE_WARNING, m); }
|
||||
static inline Status error(const std::string& m) { return Status(STATUSTYPE_ERROR, m); }
|
||||
@@ -54,10 +54,10 @@ namespace epics { namespace pvData {
|
||||
* Creates OK status; STATUSTYPE_OK, empty message and stackDump.
|
||||
*/
|
||||
Status() :m_statusType(STATUSTYPE_OK) {}
|
||||
|
||||
/**
|
||||
* Create non-OK status.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create non-OK status.
|
||||
*/
|
||||
Status(StatusType type, std::string const & message);
|
||||
|
||||
/**
|
||||
|
||||
@@ -237,6 +237,14 @@ public:
|
||||
std::ostream& operator<<(std::ostream& strm, const escape& Q);
|
||||
};
|
||||
|
||||
struct maybeQuote {
|
||||
const std::string& s;
|
||||
maybeQuote(const std::string& s) :s(s) {}
|
||||
};
|
||||
|
||||
epicsShareExtern
|
||||
std::ostream& operator<<(std::ostream& strm, const maybeQuote& q);
|
||||
|
||||
}} // end namespace
|
||||
|
||||
#endif // PVTYPECAST_H
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace epics {
|
||||
}
|
||||
|
||||
void SerializeHelper::writeSize(std::size_t s, ByteBuffer* buffer) {
|
||||
if(s==(std::size_t)-1) // null // TODO remove
|
||||
if(s==(std::size_t)-1) // null not a size, but used in PVUnion::serialize()
|
||||
buffer->putByte(-1);
|
||||
else if(s<254)
|
||||
buffer->putByte(static_cast<int8>(s));
|
||||
@@ -103,7 +103,7 @@ namespace epics {
|
||||
DeserializableControl* control) {
|
||||
|
||||
std::size_t size = SerializeHelper::readSize(buffer, control);
|
||||
if(size!=(size_t)-1) // TODO null strings check, to be removed in the future
|
||||
if(size!=(size_t)-1) // TODO null strings check, to be removed in the future
|
||||
{
|
||||
if (buffer->getRemaining()>=size)
|
||||
{
|
||||
@@ -174,14 +174,6 @@ struct ToString : public epics::pvData::SerializableControl
|
||||
assert(bufwrap.getRemaining()>0);
|
||||
}
|
||||
|
||||
virtual void alignBuffer(std::size_t alignment)
|
||||
{
|
||||
if(bufwrap.getRemaining()<alignment)
|
||||
flushSerializeBuffer();
|
||||
assert(bufwrap.getRemaining()>=alignment);
|
||||
bufwrap.align(alignment);
|
||||
}
|
||||
|
||||
virtual bool directSerialize(
|
||||
ByteBuffer *existingBuffer,
|
||||
const char* toSerialize,
|
||||
@@ -232,16 +224,6 @@ struct FromString : public epics::pvData::DeserializableControl
|
||||
throw std::logic_error("Incomplete buffer");
|
||||
}
|
||||
|
||||
virtual void alignData(std::size_t alignment)
|
||||
{
|
||||
size_t pos = buf.getPosition(), k = alignment-1;
|
||||
if(pos&k) {
|
||||
std::size_t npad = alignment-(pos&k);
|
||||
ensureData(npad);
|
||||
buf.align(alignment);
|
||||
}
|
||||
}
|
||||
|
||||
virtual bool directDeserialize(
|
||||
ByteBuffer *existingBuffer,
|
||||
char* deserializeTo,
|
||||
|
||||
@@ -32,7 +32,7 @@ Status::Status(StatusType type, string const & message, string const & stackDump
|
||||
if (type == STATUSTYPE_OK)
|
||||
throw std::invalid_argument("type == STATUSTYPE_OK");
|
||||
}
|
||||
|
||||
|
||||
void Status::maximize(const Status& o)
|
||||
{
|
||||
if(m_statusType < o.m_statusType) {
|
||||
@@ -44,40 +44,40 @@ void Status::maximize(const Status& o)
|
||||
|
||||
void Status::serialize(ByteBuffer *buffer, SerializableControl *flusher) const
|
||||
{
|
||||
flusher->ensureBuffer(1);
|
||||
if (m_statusType == STATUSTYPE_OK)
|
||||
{
|
||||
// special code for okStatus (optimization)
|
||||
buffer->putByte((int8)-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer->putByte((int8)m_statusType);
|
||||
SerializeHelper::serializeString(m_message, buffer, flusher);
|
||||
SerializeHelper::serializeString(m_stackDump, buffer, flusher);
|
||||
}
|
||||
flusher->ensureBuffer(1);
|
||||
if (m_statusType == STATUSTYPE_OK)
|
||||
{
|
||||
// special code for okStatus (optimization)
|
||||
buffer->putByte((int8)-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer->putByte((int8)m_statusType);
|
||||
SerializeHelper::serializeString(m_message, buffer, flusher);
|
||||
SerializeHelper::serializeString(m_stackDump, buffer, flusher);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Status::deserialize(ByteBuffer *buffer, DeserializableControl *flusher)
|
||||
{
|
||||
flusher->ensureData(1);
|
||||
int8 typeCode = buffer->getByte();
|
||||
if (typeCode == (int8)-1)
|
||||
{
|
||||
// in most of the cases status will be OK, we statistically optimize
|
||||
if (m_statusType != STATUSTYPE_OK)
|
||||
{
|
||||
m_statusType = STATUSTYPE_OK;
|
||||
flusher->ensureData(1);
|
||||
int8 typeCode = buffer->getByte();
|
||||
if (typeCode == (int8)-1)
|
||||
{
|
||||
// in most of the cases status will be OK, we statistically optimize
|
||||
if (m_statusType != STATUSTYPE_OK)
|
||||
{
|
||||
m_statusType = STATUSTYPE_OK;
|
||||
m_message.clear();
|
||||
m_stackDump.clear();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_statusType = (StatusType)typeCode;
|
||||
m_message = SerializeHelper::deserializeString(buffer, flusher);
|
||||
m_stackDump = SerializeHelper::deserializeString(buffer, flusher);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_statusType = (StatusType)typeCode;
|
||||
m_message = SerializeHelper::deserializeString(buffer, flusher);
|
||||
m_stackDump = SerializeHelper::deserializeString(buffer, flusher);
|
||||
}
|
||||
}
|
||||
|
||||
void Status::dump(std::ostream& o) const
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
TimerCallback::TimerCallback()
|
||||
: period(0.0),
|
||||
|
||||
@@ -30,9 +30,9 @@ static void castVTyped(size_t count, void *draw, const void *sraw)
|
||||
{
|
||||
TO *dest=(TO*)draw;
|
||||
const FROM *src=(FROM*)sraw;
|
||||
|
||||
|
||||
//std::transform(src, src+count, dest, castUnsafe<TO,FROM>);
|
||||
|
||||
|
||||
try {
|
||||
for(size_t i=0; i<count; i++) {
|
||||
dest[i] = castUnsafe<TO,FROM>(src[i]);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
AlarmSeverity AlarmSeverityFunc::getSeverity(int value)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
string PVAlarm::noAlarmFound("No alarm structure found");
|
||||
string PVAlarm::notAttached("Not attached to an alarm structure");
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <pv/pvData.h>
|
||||
#include <pv/pvControl.h>
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::string;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
string PVDisplay::noDisplayFound("No display structure found");
|
||||
string PVDisplay::notAttached("Not attached to an display structure");
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
string PVEnumerated::notFound("No enumerated structure found");
|
||||
string PVEnumerated::notAttached("Not attached to an enumerated structure");
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using std::tr1::static_pointer_cast;
|
||||
using std::string;
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
string PVTimeStamp::noTimeStamp("No timeStamp structure found");
|
||||
string PVTimeStamp::notAttached("Not attached to a timeStamp structure");
|
||||
@@ -93,5 +93,5 @@ bool PVTimeStamp::set(TimeStamp const & timeStamp)
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
}}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <pv/pvType.h>
|
||||
#include <pv/timeStamp.h>
|
||||
|
||||
namespace epics { namespace pvData {
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
const int32 milliSecPerSec = 1000;
|
||||
const int32 microSecPerSec = 1000000;
|
||||
|
||||
@@ -948,11 +948,11 @@ public:
|
||||
typedef PVUnion & reference;
|
||||
typedef const PVUnion & const_reference;
|
||||
|
||||
/**
|
||||
* Undefined index.
|
||||
* Default value upon PVUnion construction. Can be set by the user.
|
||||
* Corresponds to @c null value.
|
||||
*/
|
||||
/**
|
||||
* Undefined index.
|
||||
* Default value upon PVUnion construction. Can be set by the user.
|
||||
* Corresponds to @c null value.
|
||||
*/
|
||||
static const int32 UNDEFINED_INDEX;
|
||||
|
||||
/**
|
||||
@@ -1081,9 +1081,9 @@ private:
|
||||
friend class PVDataCreate;
|
||||
UnionConstPtr unionPtr; // same as PVField::getField()
|
||||
|
||||
int32 selector;
|
||||
PVFieldPtr value;
|
||||
bool variant;
|
||||
int32 selector;
|
||||
PVFieldPtr value;
|
||||
bool variant;
|
||||
EPICS_NOT_COPYABLE(PVUnion)
|
||||
};
|
||||
|
||||
|
||||
@@ -24,14 +24,6 @@
|
||||
#include <pv/pvdVersion.h>
|
||||
|
||||
#include <shareLib.h>
|
||||
|
||||
#if defined(PVD_INTERNAL)
|
||||
# define PVD_DEPRECATED(msg)
|
||||
#elif __GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 5
|
||||
# define PVD_DEPRECATED(msg) __attribute__((deprecated(msg)))
|
||||
#else
|
||||
# define PVD_DEPRECATED(msg) EPICS_DEPRECATED
|
||||
#endif
|
||||
#define PVD_DEPRECATED_52 PVD_DEPRECATED("See https://github.com/epics-base/pvDataCPP/issues/52")
|
||||
|
||||
/* C++11 keywords
|
||||
@@ -1079,12 +1071,12 @@ public:
|
||||
//! Create a new instance of in-line @c Field builder pre-initialized with and existing Structure
|
||||
static FieldBuilderPtr begin(StructureConstPtr S);
|
||||
|
||||
/**
|
||||
* Set ID of an object to be created.
|
||||
* @param id id to be set.
|
||||
/**
|
||||
* Set ID of an object to be created.
|
||||
* @param id id to be set.
|
||||
* @return this instance of a @c FieldBuilder.
|
||||
*/
|
||||
FieldBuilderPtr setId(std::string const & id);
|
||||
*/
|
||||
FieldBuilderPtr setId(std::string const & id);
|
||||
|
||||
/**
|
||||
* Add a @c Scalar.
|
||||
@@ -1214,20 +1206,20 @@ private:
|
||||
FieldBuilder(const FieldBuilderPtr & _parentBuilder, const std::string& name, const Union*);
|
||||
FieldBuilder(const FieldBuilderPtr & _parentBuilder, const std::string& name, const UnionArray*);
|
||||
FieldBuilder(FieldBuilderPtr const & parentBuilder,
|
||||
std::string const & nestedName,
|
||||
Type nestedClassToBuild, bool nestedArray);
|
||||
std::string const & nestedName,
|
||||
Type nestedClassToBuild, bool nestedArray);
|
||||
|
||||
const Field *findField(const std::string& name, Type ftype);
|
||||
|
||||
void reset();
|
||||
FieldConstPtr createFieldInternal(Type type);
|
||||
|
||||
void reset();
|
||||
FieldConstPtr createFieldInternal(Type type);
|
||||
|
||||
friend class FieldCreate;
|
||||
|
||||
const FieldCreatePtr fieldCreate;
|
||||
|
||||
std::string id;
|
||||
bool idSet;
|
||||
std::string id;
|
||||
bool idSet;
|
||||
|
||||
StringArray fieldNames;
|
||||
FieldConstPtrArray fields;
|
||||
@@ -1251,11 +1243,11 @@ class epicsShareClass FieldCreate {
|
||||
friend struct detail::field_factory;
|
||||
public:
|
||||
static const FieldCreatePtr &getFieldCreate();
|
||||
/**
|
||||
* Create a new instance of in-line @c Field builder.
|
||||
* @return a new instance of a @c FieldBuilder.
|
||||
*/
|
||||
FieldBuilderPtr createFieldBuilder() const;
|
||||
/**
|
||||
* Create a new instance of in-line @c Field builder.
|
||||
* @return a new instance of a @c FieldBuilder.
|
||||
*/
|
||||
FieldBuilderPtr createFieldBuilder() const;
|
||||
/**
|
||||
* Create a new instance of in-line @c Field builder pre-initialized with and existing Structure
|
||||
* @return a new instance of a @c FieldBuilder.
|
||||
@@ -1323,7 +1315,7 @@ public:
|
||||
* @return a @c Structure interface for the newly created object.
|
||||
*/
|
||||
StructureConstPtr createStructure (
|
||||
std::string const & id,
|
||||
std::string const & id,
|
||||
StringArray const & fieldNames,
|
||||
FieldConstPtrArray const & fields) const;
|
||||
/**
|
||||
@@ -1359,7 +1351,7 @@ public:
|
||||
* @return a @c Union interface for the newly created object.
|
||||
*/
|
||||
UnionConstPtr createUnion (
|
||||
std::string const & id,
|
||||
std::string const & id,
|
||||
StringArray const & fieldNames,
|
||||
FieldConstPtrArray const & fields) const;
|
||||
/**
|
||||
|
||||
@@ -72,7 +72,7 @@ static bool checkBitSetPVField(
|
||||
|
||||
bool BitSetUtil::compress(BitSetPtr const &bitSet,PVStructurePtr const &pvStructure)
|
||||
{
|
||||
return checkBitSetPVField(pvStructure,bitSet,0);
|
||||
return checkBitSetPVField(pvStructure,bitSet,0);
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
@@ -12,6 +12,8 @@ include $(PVDATA_TEST)/pv/Makefile
|
||||
include $(PVDATA_TEST)/property/Makefile
|
||||
include $(PVDATA_TEST)/copy/Makefile
|
||||
|
||||
PROD_SRCS_RTEMS += rtemsTestData.c
|
||||
|
||||
# pvDataAllTests runs all the test programs in a known working order.
|
||||
testHarness_SRCS += pvDataAllTests.c
|
||||
|
||||
@@ -30,6 +32,11 @@ TESTSPEC_RTEMS = pvdTestHarness.$(MUNCH_SUFFIX); pvDataAllTests
|
||||
# Build test scripts for hosts
|
||||
TESTSCRIPTS_HOST += $(TESTS:%=%.t)
|
||||
|
||||
ifneq ($(filter $(T_A),$(CROSS_COMPILER_RUNTEST_ARCHS)),)
|
||||
TESTPROD = $(TESTPROD_HOST)
|
||||
TESTSCRIPTS += $(TESTS:%=%.t)
|
||||
endif
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
|
||||
|
||||
|
||||
@@ -203,8 +203,8 @@ static void testCreateRequestInternal() {
|
||||
|
||||
request = string("record[process=true,xxx=yyy]")
|
||||
+ "putField(power.value)"
|
||||
+ "getField(alarm,timeStamp,power{value,alarm},"
|
||||
+ "current{value,alarm},voltage{value,alarm})";
|
||||
+ "getField(alarm,timeStamp,power{value,alarm},"
|
||||
+ "current{value,alarm},voltage{value,alarm})";
|
||||
|
||||
pvRequest = createRequest->createRequest(request);
|
||||
if(!pvRequest) { cout<< createRequest->getMessage() << endl;}
|
||||
@@ -241,10 +241,10 @@ static void testCreateRequestInternal() {
|
||||
testPass("request %s",request.c_str());
|
||||
|
||||
request = string("record[process=true,xxx=yyy]")
|
||||
+ "putField(power.value)"
|
||||
+ "getField(alarm,timeStamp,power{value,alarm},"
|
||||
+ "current{value,alarm},voltage{value,alarm},"
|
||||
+ "ps0{alarm,timeStamp,power{value,alarm},current{value,alarm},voltage{value,alarm}},"
|
||||
+ "putField(power.value)"
|
||||
+ "getField(alarm,timeStamp,power{value,alarm},"
|
||||
+ "current{value,alarm},voltage{value,alarm},"
|
||||
+ "ps0{alarm,timeStamp,power{value,alarm},current{value,alarm},voltage{value,alarm}},"
|
||||
+ "ps1{alarm,timeStamp,power{value,alarm},current{value,alarm},voltage{value,alarm}}"
|
||||
+ ")";
|
||||
|
||||
@@ -730,5 +730,3 @@ MAIN(testCreateRequest)
|
||||
testMaskErr();
|
||||
return testDone();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,16 +31,6 @@ void Unroller::unroll<0>(double /*d*/) {
|
||||
THROW_BASE_EXCEPTION("the root cause");
|
||||
}
|
||||
|
||||
void internalTestBaseException(int /*unused*/ = 0)
|
||||
{
|
||||
try {
|
||||
// NOTE: 5, 4, 3, 2, 1 calls will be optimized and not shown
|
||||
Unroller().unroll<5>(42.0);
|
||||
} catch (BaseException& be3) {
|
||||
THROW_BASE_EXCEPTION_CAUSE("exception 1", be3);
|
||||
}
|
||||
}
|
||||
|
||||
void testBaseExceptionTest() {
|
||||
printf("testBaseException... ");
|
||||
|
||||
@@ -50,16 +40,6 @@ void testBaseExceptionTest() {
|
||||
printf("\n\n%s\n\n", be.what());
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
internalTestBaseException();
|
||||
} catch (BaseException& be2) {
|
||||
THROW_BASE_EXCEPTION_CAUSE("exception 2", be2);
|
||||
}
|
||||
} catch (BaseException& be) {
|
||||
printf("\n\n%s\n\n", be.what());
|
||||
}
|
||||
|
||||
testPass("testBaseException");
|
||||
}
|
||||
|
||||
@@ -88,4 +68,3 @@ MAIN(testBaseException)
|
||||
testBaseExceptionTest();
|
||||
return testDone();
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ static void testOperators()
|
||||
b2.set(256);
|
||||
b1 ^= b2;
|
||||
testOk1((b1.cardinality() == 2 && b1.get(1) == true && b1.get(256) == true));
|
||||
|
||||
|
||||
|
||||
testDiag("assign");
|
||||
testOk1(b1 != b2);
|
||||
|
||||
@@ -217,38 +217,6 @@ void testUnaligned()
|
||||
{
|
||||
testDiag("test correctness of unaligned access");
|
||||
|
||||
ByteBuffer buf(32, EPICS_ENDIAN_BIG);
|
||||
|
||||
// malloc() should give us a buffer aligned to at least native integer size
|
||||
buf.align(sizeof(int));
|
||||
testOk1(buf.getPosition()==0);
|
||||
|
||||
buf.clear();
|
||||
buf.put<uint8>(0x42);
|
||||
buf.put<uint16>(0x1020);
|
||||
buf.align(2, '\x41');
|
||||
testOk1(buf.getPosition()==4);
|
||||
|
||||
testOk1(memcmp(buf.getBuffer(), "\x42\x10\x20\x41", 4)==0);
|
||||
|
||||
buf.clear();
|
||||
buf.put<uint8>(0x42);
|
||||
buf.put<uint32>(0x12345678);
|
||||
buf.align(4, '\x41');
|
||||
testOk1(buf.getPosition()==8);
|
||||
|
||||
testOk1(memcmp(buf.getBuffer(), "\x42\x12\x34\x56\x78\x41\x41\x41", 8)==0);
|
||||
|
||||
buf.clear();
|
||||
buf.put<uint8>(0x42);
|
||||
uint64 val = 0x12345678;
|
||||
val<<=32;
|
||||
val |= 0x90abcdef;
|
||||
buf.put<uint64>(val);
|
||||
buf.align(8, '\x41');
|
||||
testOk1(buf.getPosition()==16);
|
||||
|
||||
testOk1(memcmp(buf.getBuffer(), "\x42\x12\x34\x56\x78\x90\xab\xcd\xef\x41\x41\x41", 8)==0);
|
||||
}
|
||||
|
||||
static
|
||||
@@ -305,7 +273,7 @@ void testArrayBE()
|
||||
|
||||
MAIN(testByteBuffer)
|
||||
{
|
||||
testPlan(104);
|
||||
testPlan(97);
|
||||
testDiag("Tests byteBuffer");
|
||||
testBasicOperations();
|
||||
testInverseEndianness(EPICS_ENDIAN_BIG, expect_be);
|
||||
|
||||
@@ -12,4 +12,3 @@ printf("EPICS_BYTE_ORDER: %s\n", (EPICS_BYTE_ORDER == EPICS_ENDIAN_LITTLE) ? "li
|
||||
printf("EPICS_FLOAT_WORD_ORDER: %s\n", (EPICS_FLOAT_WORD_ORDER == EPICS_ENDIAN_LITTLE) ? "little" : "big");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,4 +47,3 @@ MAIN(testEvent)
|
||||
testBasicEvent();
|
||||
return testDone();
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ void test()
|
||||
testOk1(userOverrunBitSet->get(secondsOffset));
|
||||
testOk1(userOverrunBitSet->get(nanosecondsOffset));
|
||||
testOk1(userOverrunBitSet->get(userTagOffset));
|
||||
|
||||
|
||||
BitSetUtil::compress(userChangeBitSet,pvStructure);
|
||||
BitSetUtil::compress(userOverrunBitSet,pvStructure);
|
||||
testOk1(userChangeBitSet->cardinality()==4);
|
||||
@@ -138,4 +138,3 @@ MAIN(testOverrunBitSet)
|
||||
test();
|
||||
return testDone();
|
||||
}
|
||||
|
||||
|
||||
@@ -67,10 +67,6 @@ public:
|
||||
virtual void ensureBuffer(std::size_t /*size*/) {
|
||||
}
|
||||
|
||||
virtual void alignBuffer(std::size_t alignment) {
|
||||
buffer->align(alignment);
|
||||
}
|
||||
|
||||
virtual bool directSerialize(ByteBuffer* /*existingBuffer*/, const char* /*toSerialize*/,
|
||||
std::size_t /*elementCount*/, std::size_t /*elementSize*/)
|
||||
{
|
||||
@@ -95,10 +91,6 @@ public:
|
||||
virtual void ensureData(size_t /*size*/) {
|
||||
}
|
||||
|
||||
virtual void alignData(size_t alignment) {
|
||||
buffer->align(alignment);
|
||||
}
|
||||
|
||||
virtual bool directDeserialize(ByteBuffer* /*existingBuffer*/, char* /*deserializeTo*/,
|
||||
std::size_t /*elementCount*/, std::size_t /*elementSize*/)
|
||||
{
|
||||
@@ -146,48 +138,48 @@ void testEquals() {
|
||||
PVDataCreatePtr factory = getPVDataCreate();
|
||||
testOk1(factory.get()!=NULL);
|
||||
|
||||
// be sure all is covered
|
||||
for (int i = pvBoolean; i < pvString; i++)
|
||||
{
|
||||
ScalarType scalarType = static_cast<ScalarType>(i);
|
||||
// be sure all is covered
|
||||
for (int i = pvBoolean; i < pvString; i++)
|
||||
{
|
||||
ScalarType scalarType = static_cast<ScalarType>(i);
|
||||
|
||||
PVScalarPtr scalar1 = factory->createPVScalar(scalarType);
|
||||
PVScalarPtr scalar2 = factory->createPVScalar(scalarType);
|
||||
testOk1((*scalar1)==(*scalar2));
|
||||
PVScalarPtr scalar1 = factory->createPVScalar(scalarType);
|
||||
PVScalarPtr scalar2 = factory->createPVScalar(scalarType);
|
||||
testOk1((*scalar1)==(*scalar2));
|
||||
|
||||
PVScalarArrayPtr array1 = factory->createPVScalarArray(scalarType);
|
||||
PVScalarArrayPtr array2 = factory->createPVScalarArray(scalarType);
|
||||
testOk1((*array1)==(*array2));
|
||||
}
|
||||
PVScalarArrayPtr array1 = factory->createPVScalarArray(scalarType);
|
||||
PVScalarArrayPtr array2 = factory->createPVScalarArray(scalarType);
|
||||
testOk1((*array1)==(*array2));
|
||||
}
|
||||
|
||||
// and a structure
|
||||
// and a structure
|
||||
PVStructurePtr structure1 = factory->createPVStructure(getStandardField()->timeStamp());
|
||||
PVStructurePtr structure2 = factory->createPVStructure(getStandardField()->timeStamp());
|
||||
testOk1((*structure1)==(*structure2));
|
||||
testOk1((*structure1)==(*structure2));
|
||||
|
||||
// and a structure array
|
||||
PVStructureArrayPtr structureArray1 = factory->createPVStructureArray(getFieldCreate()->createStructureArray(structure1->getStructure()));
|
||||
PVStructureArrayPtr structureArray2 = factory->createPVStructureArray(getFieldCreate()->createStructureArray(structure2->getStructure()));
|
||||
testOk1((*structureArray1)==(*structureArray2));
|
||||
|
||||
// variant union
|
||||
PVUnionPtr variantUnion1 = factory->createPVVariantUnion();
|
||||
PVUnionPtr variantUnion2 = factory->createPVVariantUnion();
|
||||
testOk1((*variantUnion1)==(*variantUnion2));
|
||||
|
||||
variantUnion1->set(structure1);
|
||||
variantUnion2->set(structure1);
|
||||
testOk1((*variantUnion1)==(*variantUnion2));
|
||||
testOk1((*structureArray1)==(*structureArray2));
|
||||
|
||||
variantUnion2->set(structureArray1);
|
||||
testOk1((*variantUnion1)!=(*variantUnion2));
|
||||
|
||||
// variant union array
|
||||
PVUnionArrayPtr variantUnionArray1 = factory->createPVVariantUnionArray();
|
||||
PVUnionArrayPtr variantUnionArray2 = factory->createPVVariantUnionArray();
|
||||
testOk1((*variantUnionArray1)==(*variantUnionArray2));
|
||||
// variant union
|
||||
PVUnionPtr variantUnion1 = factory->createPVVariantUnion();
|
||||
PVUnionPtr variantUnion2 = factory->createPVVariantUnion();
|
||||
testOk1((*variantUnion1)==(*variantUnion2));
|
||||
|
||||
// union
|
||||
variantUnion1->set(structure1);
|
||||
variantUnion2->set(structure1);
|
||||
testOk1((*variantUnion1)==(*variantUnion2));
|
||||
|
||||
variantUnion2->set(structureArray1);
|
||||
testOk1((*variantUnion1)!=(*variantUnion2));
|
||||
|
||||
// variant union array
|
||||
PVUnionArrayPtr variantUnionArray1 = factory->createPVVariantUnionArray();
|
||||
PVUnionArrayPtr variantUnionArray2 = factory->createPVVariantUnionArray();
|
||||
testOk1((*variantUnionArray1)==(*variantUnionArray2));
|
||||
|
||||
// union
|
||||
UnionConstPtr punion = getFieldCreate()->createFieldBuilder()->
|
||||
add("double", pvDouble)->
|
||||
add("double2", pvDouble)->
|
||||
@@ -198,30 +190,30 @@ void testEquals() {
|
||||
endNested()->
|
||||
addArray("intArray", pvInt)->
|
||||
createUnion();
|
||||
PVUnionPtr union1 = factory->createPVUnion(punion);
|
||||
PVUnionPtr union2 = factory->createPVUnion(punion);
|
||||
testOk1((*union1)==(*union2));
|
||||
|
||||
union1->select<PVDouble>("double")->put(1.2);
|
||||
union2->select<PVDouble>("double")->put(1.2);
|
||||
testOk1((*union1)==(*union2));
|
||||
|
||||
union2->select<PVDouble>("double")->put(2.2);
|
||||
testOk1((*union1)!=(*union2));
|
||||
PVUnionPtr union1 = factory->createPVUnion(punion);
|
||||
PVUnionPtr union2 = factory->createPVUnion(punion);
|
||||
testOk1((*union1)==(*union2));
|
||||
|
||||
union2->select<PVDouble>("double2")->put(1.2);
|
||||
testOk1((*union1)!=(*union2));
|
||||
union1->select<PVDouble>("double")->put(1.2);
|
||||
union2->select<PVDouble>("double")->put(1.2);
|
||||
testOk1((*union1)==(*union2));
|
||||
|
||||
union2->select("nested");
|
||||
testOk1((*union1)!=(*union2));
|
||||
union2->select<PVDouble>("double")->put(2.2);
|
||||
testOk1((*union1)!=(*union2));
|
||||
|
||||
testOk1((*union1)!=(*variantUnion2));
|
||||
|
||||
PVUnionArrayPtr unionArray1 = factory->createPVUnionArray(getFieldCreate()->createUnionArray(punion));
|
||||
PVUnionArrayPtr unionArray2 = factory->createPVUnionArray(getFieldCreate()->createUnionArray(punion));
|
||||
testOk1((*unionArray1)==(*unionArray2));
|
||||
union2->select<PVDouble>("double2")->put(1.2);
|
||||
testOk1((*union1)!=(*union2));
|
||||
|
||||
testOk1((*variantUnionArray1)!=(*unionArray2));
|
||||
union2->select("nested");
|
||||
testOk1((*union1)!=(*union2));
|
||||
|
||||
testOk1((*union1)!=(*variantUnion2));
|
||||
|
||||
PVUnionArrayPtr unionArray1 = factory->createPVUnionArray(getFieldCreate()->createUnionArray(punion));
|
||||
PVUnionArrayPtr unionArray2 = factory->createPVUnionArray(getFieldCreate()->createUnionArray(punion));
|
||||
testOk1((*unionArray1)==(*unionArray2));
|
||||
|
||||
testOk1((*variantUnionArray1)!=(*unionArray2));
|
||||
}
|
||||
|
||||
template<typename PVT>
|
||||
@@ -264,7 +256,7 @@ void testScalar() {
|
||||
|
||||
testDiag("type %s", ScalarTypeFunc::name(pvBoolean));
|
||||
PVBooleanPtr pvBoolean =
|
||||
std::tr1::static_pointer_cast<PVBoolean>(factory->createPVScalar(epics::pvData::pvBoolean));
|
||||
std::tr1::static_pointer_cast<PVBoolean>(factory->createPVScalar(epics::pvData::pvBoolean));
|
||||
pvBoolean->put(false);
|
||||
serializationTest(pvBoolean);
|
||||
pvBoolean->put(true);
|
||||
@@ -284,7 +276,7 @@ void testScalar() {
|
||||
|
||||
testDiag("type %s", ScalarTypeFunc::name(pvString));
|
||||
PVStringPtr pvString =
|
||||
std::tr1::static_pointer_cast<PVString>(factory->createPVScalar(epics::pvData::pvString));
|
||||
std::tr1::static_pointer_cast<PVString>(factory->createPVScalar(epics::pvData::pvString));
|
||||
pvString->put("");
|
||||
serializationTest(pvString);
|
||||
pvString->put("s");
|
||||
@@ -382,7 +374,7 @@ void testStructure() {
|
||||
testOk1(factory.get()!=NULL);
|
||||
|
||||
testDiag("\tSimple structure serialization");
|
||||
PVStructurePtr pvStructure = factory->createPVStructure(getStandardField()->timeStamp());
|
||||
PVStructurePtr pvStructure = factory->createPVStructure(getStandardField()->timeStamp());
|
||||
pvStructure->getSubField<PVLong>("secondsPastEpoch")->put(123);
|
||||
pvStructure->getSubField<PVInt>("nanoseconds")->put(456);
|
||||
pvStructure->getSubField<PVInt>("userTag")->put(789);
|
||||
@@ -390,11 +382,11 @@ void testStructure() {
|
||||
serializationTest(pvStructure);
|
||||
|
||||
testDiag("\tComplex structure serialization");
|
||||
pvStructure = factory->createPVStructure(
|
||||
getStandardField()->structureArray(
|
||||
getStandardField()->timeStamp(), "alarm,control,display,timeStamp")
|
||||
);
|
||||
// TODO fill with data
|
||||
pvStructure = factory->createPVStructure(
|
||||
getStandardField()->structureArray(
|
||||
getStandardField()->timeStamp(), "alarm,control,display,timeStamp")
|
||||
);
|
||||
// TODO fill with data
|
||||
serializationTest(pvStructure);
|
||||
}
|
||||
|
||||
@@ -439,17 +431,17 @@ void testUnion() {
|
||||
|
||||
PVUnionArrayPtr variantArray = factory->createPVVariantUnionArray();
|
||||
testOk1(variantArray.get()!=NULL);
|
||||
|
||||
|
||||
variantArray->setLength(6);
|
||||
PVUnionArray::svector data;
|
||||
|
||||
PVUnionPtr u = factory->createPVVariantUnion();
|
||||
data.push_back(u);
|
||||
|
||||
|
||||
u = factory->createPVVariantUnion();
|
||||
u->set(factory->createPVStructure(getStandardField()->timeStamp()));
|
||||
data.push_back(u);
|
||||
|
||||
|
||||
u = factory->createPVVariantUnion();
|
||||
u->set(factory->createPVStructure(getStandardField()->control()));
|
||||
data.push_back(u);
|
||||
@@ -458,18 +450,18 @@ void testUnion() {
|
||||
|
||||
variantArray->replace(freeze(data));
|
||||
serializationTest(variantArray);
|
||||
|
||||
|
||||
testDiag("\tVariant union test");
|
||||
|
||||
|
||||
UnionConstPtr punion = getFieldCreate()->createFieldBuilder()->
|
||||
add("doubleValue", pvDouble)->
|
||||
add("intValue", pvInt)->
|
||||
createUnion();
|
||||
|
||||
u = factory->createPVUnion(punion);
|
||||
testOk1(NULL!=u.get());
|
||||
|
||||
// null union test
|
||||
u = factory->createPVUnion(punion);
|
||||
testOk1(NULL!=u.get());
|
||||
|
||||
// null union test
|
||||
testOk1(NULL==u->get().get());
|
||||
testOk1(PVUnion::UNDEFINED_INDEX == u->getSelectedIndex());
|
||||
testOk1("" == u->getSelectedFieldName());
|
||||
@@ -480,13 +472,13 @@ void testUnion() {
|
||||
testOk1(0 == u->getSelectedIndex());
|
||||
testOk1("doubleValue" == u->getSelectedFieldName());
|
||||
serializationTest(u);
|
||||
|
||||
|
||||
u->select<PVInt>("intValue")->put(543);
|
||||
testOk1(543 == u->get<PVInt>()->get());
|
||||
testOk1(1 == u->getSelectedIndex());
|
||||
testOk1("intValue" == u->getSelectedFieldName());
|
||||
serializationTest(u);
|
||||
|
||||
|
||||
u->select<PVInt>(1)->put(5432);
|
||||
testOk1(5432 == u->get<PVInt>()->get());
|
||||
serializationTest(u);
|
||||
@@ -496,12 +488,12 @@ void testUnion() {
|
||||
testOk1(PVUnion::UNDEFINED_INDEX == u->getSelectedIndex());
|
||||
testOk1("" == u->getSelectedFieldName());
|
||||
serializationTest(u);
|
||||
|
||||
|
||||
u->set("doubleValue", doubleValue);
|
||||
testOk1(doubleValue.get() == u->get().get());
|
||||
testOk1(0 == u->getSelectedIndex());
|
||||
serializationTest(u);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
u->set(1, doubleValue);
|
||||
@@ -523,7 +515,7 @@ void testUnion() {
|
||||
// expected
|
||||
testPass("PVUnion.select(int32) index out of bounds test");
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
u->select(-2);
|
||||
@@ -545,22 +537,22 @@ void testUnion() {
|
||||
// expected
|
||||
testPass("PVUnion.set(int32, PVFieldPtr const&) index out of bounds test");
|
||||
}
|
||||
|
||||
|
||||
testDiag("\tUnion array test");
|
||||
|
||||
PVUnionArrayPtr unionArray = factory->createPVUnionArray(getFieldCreate()->createUnionArray(punion));
|
||||
testOk1(unionArray.get()!=NULL);
|
||||
|
||||
|
||||
unionArray->setLength(6);
|
||||
data.clear();
|
||||
|
||||
u = factory->createPVUnion(punion);
|
||||
data.push_back(u);
|
||||
|
||||
|
||||
u = factory->createPVUnion(punion);
|
||||
u->select<PVDouble>(0)->put(12);
|
||||
data.push_back(u);
|
||||
|
||||
|
||||
u = factory->createPVUnion(punion);
|
||||
u->select<PVInt>(1)->put(421);
|
||||
data.push_back(u);
|
||||
@@ -569,7 +561,7 @@ void testUnion() {
|
||||
|
||||
unionArray->replace(freeze(data));
|
||||
serializationTest(unionArray);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void testStructureArray() {
|
||||
@@ -633,38 +625,38 @@ void serializationFieldTest(FieldConstPtr const & field)
|
||||
{
|
||||
testShow()<<CURRENT_FUNCTION<<"\n"<<field;
|
||||
|
||||
buffer->clear();
|
||||
buffer->clear();
|
||||
|
||||
// serialize
|
||||
field->serialize(buffer, flusher);
|
||||
// serialize
|
||||
field->serialize(buffer, flusher);
|
||||
|
||||
// deserialize
|
||||
buffer->flip();
|
||||
// deserialize
|
||||
buffer->flip();
|
||||
|
||||
FieldConstPtr deserializedField = getFieldCreate()->deserialize(buffer, control);
|
||||
FieldConstPtr deserializedField = getFieldCreate()->deserialize(buffer, control);
|
||||
|
||||
testShow()<<" after "<<(void*)field.get()<<" == "<<(void*)deserializedField.get();
|
||||
testOk1(*field == *deserializedField);
|
||||
testOk1(*field == *deserializedField);
|
||||
}
|
||||
|
||||
void testIntrospectionSerialization()
|
||||
{
|
||||
testDiag("Testing introspection serialization...");
|
||||
testDiag("Testing introspection serialization...");
|
||||
|
||||
FieldCreatePtr factory = getFieldCreate();
|
||||
testOk1(factory.get()!=NULL);
|
||||
FieldCreatePtr factory = getFieldCreate();
|
||||
testOk1(factory.get()!=NULL);
|
||||
|
||||
// be sure all is covered
|
||||
for (int i = pvBoolean; i < pvString; i++)
|
||||
{
|
||||
ScalarType scalarType = static_cast<ScalarType>(i);
|
||||
// be sure all is covered
|
||||
for (int i = pvBoolean; i < pvString; i++)
|
||||
{
|
||||
ScalarType scalarType = static_cast<ScalarType>(i);
|
||||
|
||||
ScalarConstPtr scalar = factory->createScalar(scalarType);
|
||||
serializationFieldTest(scalar);
|
||||
ScalarConstPtr scalar = factory->createScalar(scalarType);
|
||||
serializationFieldTest(scalar);
|
||||
|
||||
ScalarArrayConstPtr array = factory->createScalarArray(scalarType);
|
||||
serializationFieldTest(array);
|
||||
}
|
||||
ScalarArrayConstPtr array = factory->createScalarArray(scalarType);
|
||||
serializationFieldTest(array);
|
||||
}
|
||||
|
||||
// and a structure
|
||||
StructureConstPtr structure = getStandardField()->timeStamp();
|
||||
@@ -677,11 +669,11 @@ void testIntrospectionSerialization()
|
||||
// variant union
|
||||
UnionConstPtr variant = factory->createVariantUnion();
|
||||
serializationFieldTest(variant);
|
||||
|
||||
|
||||
// variant array union
|
||||
UnionArrayConstPtr variantArray = factory->createVariantUnionArray();
|
||||
serializationFieldTest(variantArray);
|
||||
|
||||
|
||||
// union
|
||||
UnionConstPtr punion = factory->createFieldBuilder()->
|
||||
add("double", pvDouble)->
|
||||
@@ -693,7 +685,7 @@ void testIntrospectionSerialization()
|
||||
addArray("intArray", pvInt)->
|
||||
createUnion();
|
||||
serializationFieldTest(punion);
|
||||
|
||||
|
||||
// union array
|
||||
UnionArrayConstPtr punionArray = factory->createUnionArray(punion);
|
||||
serializationFieldTest(punionArray);
|
||||
@@ -748,7 +740,7 @@ void testBoundedString() {
|
||||
try {
|
||||
pvStr->put("tooLargeString");
|
||||
testFail("too large string accepted");
|
||||
} catch (std::overflow_error oe) {
|
||||
} catch (std::overflow_error& oe) {
|
||||
// OK
|
||||
}
|
||||
|
||||
@@ -877,7 +869,7 @@ MAIN(testSerialization) {
|
||||
testStructure();
|
||||
testStructureId();
|
||||
testStructureArray();
|
||||
|
||||
|
||||
testUnion();
|
||||
|
||||
testArraySizeType();
|
||||
@@ -894,4 +886,3 @@ MAIN(testSerialization) {
|
||||
|
||||
return testDone();
|
||||
}
|
||||
|
||||
|
||||
@@ -474,6 +474,9 @@ void testVectorConvert()
|
||||
testOk1(ints.unique());
|
||||
testOk1(strings.size()==ints.size());
|
||||
testOk1(strings.at(0)=="42");
|
||||
|
||||
testDiag("convert empty array");
|
||||
testOk1(pvd::shared_vector_convert<double>(pvd::shared_vector<pvd::int32>()).empty());
|
||||
}
|
||||
|
||||
void testWeak()
|
||||
@@ -522,7 +525,7 @@ void testICE()
|
||||
testOk1(B.size()==6);
|
||||
testOk1(A.data()!=check);
|
||||
testOk1(B.data()==check);
|
||||
|
||||
|
||||
D = B; // create second const reference
|
||||
|
||||
// clears D, but reference to B
|
||||
@@ -695,7 +698,7 @@ void testCXX11Init()
|
||||
|
||||
MAIN(testSharedVector)
|
||||
{
|
||||
testPlan(191);
|
||||
testPlan(192);
|
||||
testDiag("Tests for shared_vector");
|
||||
|
||||
testDiag("sizeof(shared_vector<pvd::int32>)=%lu",
|
||||
|
||||
@@ -134,12 +134,12 @@ void showNTScalarNumeric()
|
||||
{
|
||||
testDiag("%s", CURRENT_FUNCTION);
|
||||
pvd::PVStructurePtr input(pvd::getPVDataCreate()->createPVStructure(scalarNumeric));
|
||||
input->getSubFieldT<pvd::PVScalar>("value")->putFrom(-42);
|
||||
input->getSubFieldT<pvd::PVScalar>("value")->putFrom(pvd::int32(-42));
|
||||
|
||||
testDiff("<undefined> -42 \n", print(input->stream()));
|
||||
|
||||
input->getSubFieldT<pvd::PVScalar>("alarm.severity")->putFrom(1);
|
||||
input->getSubFieldT<pvd::PVScalar>("alarm.status")->putFrom(1);
|
||||
input->getSubFieldT<pvd::PVScalar>("alarm.severity")->putFrom(pvd::int32(1));
|
||||
input->getSubFieldT<pvd::PVScalar>("alarm.status")->putFrom(pvd::int32(1));
|
||||
input->getSubFieldT<pvd::PVString>("alarm.message")->put("FOO");
|
||||
|
||||
testDiff("<undefined> -42 MINOR DEVICE FOO \n", print(input->stream()));
|
||||
@@ -162,8 +162,8 @@ void showNTScalarString()
|
||||
|
||||
testDiff("<undefined> bar \n", print(input->stream()));
|
||||
|
||||
input->getSubFieldT<pvd::PVScalar>("alarm.severity")->putFrom(1);
|
||||
input->getSubFieldT<pvd::PVScalar>("alarm.status")->putFrom(1);
|
||||
input->getSubFieldT<pvd::PVScalar>("alarm.severity")->putFrom(pvd::int32(1));
|
||||
input->getSubFieldT<pvd::PVScalar>("alarm.status")->putFrom(pvd::int32(1));
|
||||
input->getSubFieldT<pvd::PVString>("alarm.message")->put("FOO");
|
||||
|
||||
testDiff("<undefined> bar MINOR DEVICE FOO \n", print(input->stream()));
|
||||
@@ -197,12 +197,12 @@ void showNTEnum()
|
||||
|
||||
input->getSubFieldT<pvd::PVInt>("value.index")->put(1);
|
||||
|
||||
testDiff("<undefined> (1) a two\n", print(input->stream()), "two");
|
||||
testDiff("<undefined> (1) \"a two\"\n", print(input->stream()), "two");
|
||||
|
||||
testDiff("epics:nt/NTEnum:1.0 \n"
|
||||
" enum_t value (1) a two\n"
|
||||
" enum_t value (1) \"a two\"\n"
|
||||
" int index 1\n"
|
||||
" string[] choices [\"one\", \"a two\"]\n"
|
||||
" string[] choices [one, \"a two\"]\n"
|
||||
" alarm_t alarm \n"
|
||||
" int severity 0\n"
|
||||
" int status 0\n"
|
||||
@@ -299,7 +299,7 @@ void testRaw()
|
||||
|
||||
testDiff("omg \n"
|
||||
" string scalar \n" // bit 1
|
||||
" string[] scalarArray [\"hello\", \"world\\x7F\"]\n"
|
||||
" string[] scalarArray [hello, \"world\\x7F\"]\n"
|
||||
" structure below\n"
|
||||
" int A 0\n" // bit 4
|
||||
" union select\n"
|
||||
@@ -319,7 +319,7 @@ void testRaw()
|
||||
|
||||
testDiff("omg \n"
|
||||
"\033[1m string scalar \n"
|
||||
"\033[0m\033[1m string[] scalarArray [\"hello\", \"world\\x7F\"]\n"
|
||||
"\033[0m\033[1m string[] scalarArray [hello, \"world\\x7F\"]\n"
|
||||
"\033[0m structure below\n"
|
||||
"\033[1m int A 0\n"
|
||||
"\033[0m union select\n"
|
||||
@@ -347,13 +347,20 @@ void testEscape()
|
||||
testEqual("hello\"\"world", std::string(SB()<<pvd::escape("hello\"world").style(pvd::escape::CSV)));
|
||||
|
||||
testEqual("hello\"\"world", pvd::escape("hello\"world").style(pvd::escape::CSV).str());
|
||||
|
||||
testEqual("hello_world", std::string(SB()<<pvd::maybeQuote("hello_world")));
|
||||
testEqual("\"hello_world\\\"\"", std::string(SB()<<pvd::maybeQuote("hello_world\"")));
|
||||
testEqual("\"hello world\"", std::string(SB()<<pvd::maybeQuote("hello world")));
|
||||
testEqual("\"hello\\nworld\"", std::string(SB()<<pvd::maybeQuote("hello\nworld")));
|
||||
testEqual("\"hello\\\"world\"", std::string(SB()<<pvd::maybeQuote("hello\"world")));
|
||||
testEqual("\"hello\\x7Fworld\"", std::string(SB()<<pvd::maybeQuote("hello\x7Fworld")));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
MAIN(testprinter)
|
||||
{
|
||||
testPlan(20);
|
||||
testPlan(26);
|
||||
showNTScalarNumeric();
|
||||
showNTScalarString();
|
||||
showNTEnum();
|
||||
|
||||
@@ -64,7 +64,7 @@ static void testAlarm()
|
||||
{
|
||||
testDiag("testAlarm\n");
|
||||
Alarm alarm;
|
||||
PVAlarm pvAlarm;
|
||||
PVAlarm pvAlarm;
|
||||
bool result;
|
||||
PVFieldPtr pvField = doubleRecord->getSubField<PVStructure>(string("alarm"));
|
||||
if(pvField.get()==NULL) {
|
||||
@@ -93,7 +93,7 @@ static void testTimeStamp()
|
||||
{
|
||||
testDiag("testTimeStamp\n");
|
||||
TimeStamp timeStamp;
|
||||
PVTimeStamp pvTimeStamp;
|
||||
PVTimeStamp pvTimeStamp;
|
||||
bool result;
|
||||
PVFieldPtr pvField = doubleRecord->getSubField<PVStructure>(string("timeStamp"));
|
||||
if(pvField.get()==NULL) {
|
||||
@@ -132,7 +132,7 @@ static void testControl()
|
||||
{
|
||||
testDiag("testControl\n");
|
||||
Control control;
|
||||
PVControl pvControl;
|
||||
PVControl pvControl;
|
||||
bool result;
|
||||
PVFieldPtr pvField = doubleRecord->getSubField<PVStructure>(string("control"));
|
||||
if(pvField.get()==NULL) {
|
||||
@@ -159,7 +159,7 @@ static void testDisplay()
|
||||
{
|
||||
testDiag("testDisplay\n");
|
||||
Display display;
|
||||
PVDisplay pvDisplay;
|
||||
PVDisplay pvDisplay;
|
||||
bool result;
|
||||
PVFieldPtr pvField = doubleRecord->getSubField<PVStructure>(string("display"));
|
||||
if(pvField.get()==NULL) {
|
||||
@@ -191,7 +191,7 @@ static void testDisplay()
|
||||
static void testEnumerated()
|
||||
{
|
||||
testDiag("testEnumerated\n");
|
||||
PVEnumerated pvEnumerated;
|
||||
PVEnumerated pvEnumerated;
|
||||
bool result;
|
||||
PVFieldPtr pvField = enumeratedRecord->getSubField<PVStructure>(string("value"));
|
||||
if(pvField.get()==NULL) {
|
||||
@@ -232,4 +232,3 @@ MAIN(testProperty)
|
||||
printRecords();
|
||||
return testDone();;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ static StandardPVFieldPtr standardPVField;
|
||||
static void test()
|
||||
{
|
||||
std::ostringstream oss;
|
||||
|
||||
|
||||
testDiag("\ntestBitSetUtil\n");
|
||||
StringArray fieldNames;
|
||||
PVFieldPtrArray pvFields;
|
||||
@@ -127,4 +127,3 @@ MAIN(testBitSetUtil)
|
||||
test();
|
||||
return testDone();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ void test_factory()
|
||||
testOk1(fb.get() != 0);
|
||||
|
||||
FieldBuilderPtr fb2 = fieldCreate->createFieldBuilder();
|
||||
testOk1(fb.get() != fb2.get());
|
||||
testOk1(fb.get() != fb2.get());
|
||||
}
|
||||
|
||||
void test_structure()
|
||||
@@ -34,7 +34,7 @@ void test_structure()
|
||||
|
||||
FieldCreatePtr fieldCreate = getFieldCreate();
|
||||
FieldBuilderPtr fb = fieldCreate->createFieldBuilder();
|
||||
|
||||
|
||||
// test with simple (non-nested) structure
|
||||
std::string ID = "testStructureID";
|
||||
StructureConstPtr s = fb->setId(ID)->
|
||||
@@ -44,7 +44,7 @@ void test_structure()
|
||||
testOk1(s.get() != 0);
|
||||
testOk1(ID == s->getID());
|
||||
testOk1(2 == s->getFields().size());
|
||||
|
||||
|
||||
FieldConstPtr f0 = s->getField(0);
|
||||
testOk1(scalar == f0->getType());
|
||||
testOk1("double" == s->getFieldName(0));
|
||||
@@ -54,13 +54,13 @@ void test_structure()
|
||||
testOk1(scalarArray == f1->getType());
|
||||
testOk1("intArray" == s->getFieldName(1));
|
||||
testOk(pvInt == std::tr1::static_pointer_cast<const ScalarArray>(f1)->getElementType(), "f1 element type == int");
|
||||
|
||||
|
||||
// test reuse with empty structure
|
||||
StructureConstPtr emptyStructure = fb->createStructure();
|
||||
testOk1(emptyStructure.get() != 0);
|
||||
testOk1(Structure::DEFAULT_ID == emptyStructure->getID());
|
||||
testOk1(0 == emptyStructure->getFields().size());
|
||||
|
||||
|
||||
// test add/addArray with Field
|
||||
StructureConstPtr s2 = fb->add("s", s)->
|
||||
addArray("sArray", s)->
|
||||
@@ -137,7 +137,7 @@ void test_nestedStructure()
|
||||
testDiag("Test test_nestedStructure()");
|
||||
|
||||
FieldCreatePtr fieldCreate = getFieldCreate();
|
||||
|
||||
|
||||
std::string NESTED_ID = "nestedID";
|
||||
StructureConstPtr s = fieldCreate->createFieldBuilder()->
|
||||
add("double", pvDouble)->
|
||||
@@ -163,21 +163,21 @@ void test_nestedStructure()
|
||||
|
||||
{
|
||||
StructureConstPtr s2 = std::tr1::static_pointer_cast<const Structure>(f1);
|
||||
|
||||
|
||||
testOk1(s2.get() != 0);
|
||||
testOk1(NESTED_ID == s2->getID());
|
||||
testOk1(2 == s2->getFields().size());
|
||||
|
||||
|
||||
FieldConstPtr f20 = s2->getField(0);
|
||||
testOk1(scalar == f20->getType());
|
||||
testOk1("short" == s2->getFieldName(0));
|
||||
testOk(pvShort == std::tr1::static_pointer_cast<const Scalar>(f20)->getScalarType(), "f20 scalar type == short");
|
||||
|
||||
|
||||
FieldConstPtr f21 = s2->getField(1);
|
||||
testOk1(scalar == f21->getType());
|
||||
testOk1("long" == s2->getFieldName(1));
|
||||
testOk(pvLong == std::tr1::static_pointer_cast<const Scalar>(f21)->getScalarType(), "f21 element type == long");
|
||||
|
||||
|
||||
}
|
||||
|
||||
FieldConstPtr f2 = s->getField(2);
|
||||
@@ -185,15 +185,15 @@ void test_nestedStructure()
|
||||
testOk1("intArray" == s->getFieldName(2));
|
||||
testOk(pvInt == std::tr1::static_pointer_cast<const ScalarArray>(f2)->getElementType(), "f2 element type == int");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void test_nestedStructureArray()
|
||||
{
|
||||
testDiag("Test test_nestedStructureArray()");
|
||||
|
||||
FieldCreatePtr fieldCreate = getFieldCreate();
|
||||
|
||||
|
||||
std::string NESTED_ID = "nestedID";
|
||||
StructureConstPtr s = fieldCreate->createFieldBuilder()->
|
||||
add("double", pvDouble)->
|
||||
@@ -219,21 +219,21 @@ void test_nestedStructureArray()
|
||||
|
||||
{
|
||||
StructureConstPtr s2 = std::tr1::static_pointer_cast<const StructureArray>(f1)->getStructure();
|
||||
|
||||
|
||||
testOk1(s2.get() != 0);
|
||||
testOk1(NESTED_ID == s2->getID());
|
||||
testOk1(2 == s2->getFields().size());
|
||||
|
||||
|
||||
FieldConstPtr f20 = s2->getField(0);
|
||||
testOk1(scalar == f20->getType());
|
||||
testOk1("short" == s2->getFieldName(0));
|
||||
testOk(pvShort == std::tr1::static_pointer_cast<const Scalar>(f20)->getScalarType(), "f20 scalar type == short");
|
||||
|
||||
|
||||
FieldConstPtr f21 = s2->getField(1);
|
||||
testOk1(scalar == f21->getType());
|
||||
testOk1("long" == s2->getFieldName(1));
|
||||
testOk(pvLong == std::tr1::static_pointer_cast<const Scalar>(f21)->getScalarType(), "f21 element type == long");
|
||||
|
||||
|
||||
}
|
||||
|
||||
FieldConstPtr f2 = s->getField(2);
|
||||
|
||||
@@ -32,7 +32,7 @@ static void testScalarCommon(ScalarType stype,
|
||||
ScalarConstPtr pscalar = fieldCreate->createScalar(stype);
|
||||
Type type = pscalar->getType();
|
||||
testOk1(type==scalar);
|
||||
|
||||
|
||||
std::ostringstream oss;
|
||||
oss << type;
|
||||
testOk1(oss.str().compare("scalar")==0);
|
||||
@@ -307,17 +307,17 @@ static void testUnion()
|
||||
|
||||
testOk1(union1arr->getUnion()==union1);
|
||||
testOk1(union1arr->getID()=="union[]");
|
||||
|
||||
|
||||
UnionConstPtr variantUnion1 = fieldCreate->createVariantUnion();
|
||||
|
||||
testOk1(variantUnion1->getNumberFields()==0);
|
||||
testOk1(variantUnion1->getID() == Union::ANY_ID);
|
||||
|
||||
|
||||
UnionArrayConstPtr variantUnion1arr = fieldCreate->createVariantUnionArray();
|
||||
|
||||
testOk1(variantUnion1arr->getUnion()==variantUnion1);
|
||||
testOk1(variantUnion1arr->getID()=="any[]");
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void testBoundedString()
|
||||
|
||||
@@ -72,7 +72,7 @@ MAIN(testOperators)
|
||||
|
||||
pvStructure = standardPVField->scalarArray(pvDouble,"alarm,timeStamp");
|
||||
std::cout << *pvStructure << std::endl;
|
||||
|
||||
|
||||
PVDoubleArray::svector values(3);
|
||||
values[0] = 1.1; values[1] = 2.2; values[2] = 3.3;
|
||||
PVDoubleArrayPtr darray = pvStructure->getSubField<PVDoubleArray>("value");
|
||||
@@ -95,4 +95,3 @@ MAIN(testOperators)
|
||||
|
||||
return testDone();
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,10 @@ static string allProperties("alarm,timeStamp,display,control,valueAlarm");
|
||||
static void testSizes()
|
||||
{
|
||||
#define SHOW(T) testDiag("sizeof(" #T ")==%zu", sizeof(T))
|
||||
SHOW(std::string);
|
||||
SHOW(std::vector<int>);
|
||||
SHOW(shared_vector<int>);
|
||||
SHOW(std::tr1::shared_ptr<PVField>);
|
||||
SHOW(Field);
|
||||
SHOW(Structure);
|
||||
SHOW(StructureArray);
|
||||
@@ -77,7 +81,7 @@ static void testCreatePVStructure()
|
||||
pvFields.push_back(pv1);
|
||||
PVStructurePtr pvParent = pvDataCreate->createPVStructure(
|
||||
fieldNames,pvFields);
|
||||
|
||||
|
||||
std::cout << "testCreatePVStructure PASSED" << std::endl;
|
||||
}
|
||||
|
||||
@@ -340,7 +344,7 @@ static void testPVScalar()
|
||||
testPVScalarWithProperties(string("float"),pvFloat);
|
||||
testPVScalarWithProperties(string("double"),pvDouble);
|
||||
testPVScalarWithProperties(string("string"),pvString);
|
||||
|
||||
|
||||
std::cout << "testPVScalar PASSED" << std::endl;
|
||||
}
|
||||
|
||||
@@ -382,7 +386,7 @@ static void testScalarArray()
|
||||
}
|
||||
|
||||
static void testRequest()
|
||||
{
|
||||
{
|
||||
StringArray nullNames;
|
||||
FieldConstPtrArray nullFields;
|
||||
StringArray optionNames(1);
|
||||
@@ -787,4 +791,3 @@ MAIN(testPVData)
|
||||
}
|
||||
return testDone();
|
||||
}
|
||||
|
||||
|
||||
@@ -113,9 +113,9 @@ static void testCompress()
|
||||
static void testRemove()
|
||||
{
|
||||
testDiag("Test structure array remove");
|
||||
|
||||
|
||||
PVStructureArray::svector contents(10);
|
||||
|
||||
|
||||
for(size_t i=0; i<contents.size(); i++)
|
||||
contents[i] = standardField->alarm()->build();
|
||||
|
||||
|
||||
@@ -64,4 +64,3 @@ MAIN(testPVType)
|
||||
printf("PASSED\n");
|
||||
return testDone();
|
||||
}
|
||||
|
||||
|
||||
@@ -203,4 +203,3 @@ MAIN(testPVUnion)
|
||||
testClearUnion();
|
||||
return testDone();
|
||||
}
|
||||
|
||||
|
||||
@@ -68,4 +68,3 @@ MAIN(testStandardField)
|
||||
testPass("testStandardField");
|
||||
return testDone();
|
||||
}
|
||||
|
||||
|
||||
@@ -73,4 +73,3 @@ MAIN(testStandardPVField)
|
||||
testPass("testStandardPVField");
|
||||
return testDone();
|
||||
}
|
||||
|
||||
|
||||
2
testApp/rtemsTestData.c
Normal file
2
testApp/rtemsTestData.c
Normal file
@@ -0,0 +1,2 @@
|
||||
/* no test data */
|
||||
const void* epicsRtemsFSImage = 0;
|
||||
Reference in New Issue
Block a user