7 Commits
8.0.3 ... 8.0.4

Author SHA1 Message Date
Michael Davidsaver
b1c8303870 Update version numbers for release 2021-02-25 09:35:12 -08:00
Michael Davidsaver
a3ef984f4f ci: switch travis -> github 2020-12-20 11:08:29 -08:00
Michael Davidsaver
ca86a63180 update release notes 2020-11-14 13:43:38 -08:00
Michael Davidsaver
07b79693af Deprecate/remove unused buffer alignment tools
ByteBuffer::align() does not work as expected
on some RTEMS targets where malloc() returns
buffers aligned only to 4 bytes.

SerializableControl::alignBuffer() and
DeserializableControl::alignData() are implemented,
but never called, in this module and pvAccessCPP.
ByteBuffer::align() is only needed to implement
these two methods.

Leave non-pure virtual stubs to assist in migration.
2020-11-14 11:07:15 -08:00
Michael Davidsaver
4ef9e18ac6 enable RTEMS CI testing 2020-11-13 20:51:23 -08:00
Michael Davidsaver
320cc3c60b shared_vector_convert<>() fix convert of empty array
Empty arrays can be untyped, but this doesn't matter.
2020-09-29 15:52:49 -07:00
Michael Davidsaver
45d0d76a7f Set next development version 2020-07-26 13:30:34 -07:00
18 changed files with 201 additions and 202 deletions

2
.ci

Submodule .ci updated: 12d769835e...ad8dd4a136

153
.github/workflows/ci-scripts-build.yml vendored Normal file
View 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

View File

@@ -1,94 +0,0 @@
# .travis.yml for use with EPICS Base ci-scripts
# (see: https://github.com/epics-base/ci-scripts)
language: cpp
compiler: gcc
dist: bionic
cache:
directories:
- $HOME/.cache
env:
global:
- SETUP_PATH=.ci-local
addons:
apt:
packages:
# for all EPICS builds
- libreadline6-dev
- libncurses5-dev
- perl
# for clang compiler
- clang
# for mingw builds (32bit and 64bit)
- g++-mingw-w64-i686
- g++-mingw-w64-x86-64
# for RTEMS cross builds
- qemu-system-x86
install:
- python .ci/cue.py prepare
script:
- python .ci/cue.py build
- python .ci/cue.py test-results
jobs:
include:
# Windows builds
- env: BASE=7.0
os: windows
compiler: vs2017
- env: BASE=7.0
os: windows
# Different configurations of default gcc and clang
- env: BASE=7.0
- env: BASE=7.0
compiler: clang
- env: BASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11"
- env: BASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11"
compiler: clang
# Trusty: compiler versions very close to RHEL 7
- env: BASE=7.0
dist: trusty
- env: BASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11"
dist: trusty
- env: BASE=3.15 EXTRA="CMD_CXXFLAGS=-std=c++11"
dist: trusty
# Cross-compilations to Windows using MinGW and WINE
- env: BASE=7.0 WINE=32 TEST=NO BCFG=static
- env: BASE=7.0 WINE=64 TEST=NO
# Other gcc versions (added as an extra package)
- env: BASE=7.0
compiler: gcc-6
addons: { apt: { packages: ["g++-6"], sources: ["ubuntu-toolchain-r-test"] } }
- env: BASE=7.0
compiler: gcc-7
addons: { apt: { packages: ["g++-7"], sources: ["ubuntu-toolchain-r-test"] } }
# MacOS build
- env: BASE=7.0
os: osx
compiler: clang
addons: { homebrew: { packages: ["re2c"], update: true } }

View File

@@ -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.3
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

View File

@@ -2,7 +2,7 @@
EPICS_PVD_MAJOR_VERSION = 8
EPICS_PVD_MINOR_VERSION = 0
EPICS_PVD_MAINTENANCE_VERSION = 3
EPICS_PVD_MAINTENANCE_VERSION = 4
# Development flag, set to zero for release versions

View File

@@ -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.3
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

View File

@@ -2,6 +2,15 @@
@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)
=========================

View File

@@ -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.
*

View File

@@ -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.

View File

@@ -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));

View File

@@ -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,

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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*/)
{

View File

@@ -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()
@@ -695,7 +698,7 @@ void testCXX11Init()
MAIN(testSharedVector)
{
testPlan(191);
testPlan(192);
testDiag("Tests for shared_vector");
testDiag("sizeof(shared_vector<pvd::int32>)=%lu",

View File

@@ -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()));

2
testApp/rtemsTestData.c Normal file
View File

@@ -0,0 +1,2 @@
/* no test data */
const void* epicsRtemsFSImage = 0;