Subject: |
[Bug 1828900] [NEW] dbUnitTest::testdbRecordPtr() is easy to mis-use |
From: |
Andrew Johnson via Core-talk <[email protected]> |
To: |
[email protected] |
Date: |
Mon, 13 May 2019 22:51:44 -0000 |
Public bug reported:
There can be a mis-match between the record type expected and the type
of the record returned, but a typical use of testdbRecordPtr() will cast
the pointer to the expected type with no warnings produced if it's
wrong, and any test code that accesses a record-specific field will
likely be pointing at the wrong address.
It should be possible to define a new macro in dbUnitTest.h and an
associated helper function that takes the expected record type as an
argument and checks that the type returned matches the one expected,
returning a pointer that is already cast to the expected type. It should
call testAbort() if the wrong record type is found.
** Affects: epics-base
Importance: Wishlist
Status: New
** Tags: codeathon
--
You received this bug notification because you are a member of EPICS
Core Developers, which is subscribed to EPICS Base.
Matching subscriptions: epics-core-list-subscription
https://bugs.launchpad.net/bugs/1828900
Title:
dbUnitTest::testdbRecordPtr() is easy to mis-use
Status in EPICS Base:
New
Bug description:
There can be a mis-match between the record type expected and the type
of the record returned, but a typical use of testdbRecordPtr() will
cast the pointer to the expected type with no warnings produced if
it's wrong, and any test code that accesses a record-specific field
will likely be pointing at the wrong address.
It should be possible to define a new macro in dbUnitTest.h and an
associated helper function that takes the expected record type as an
argument and checks that the type returned matches the one expected,
returning a pointer that is already cast to the expected type. It
should call testAbort() if the wrong record type is found.
To manage notifications about this bug go to:
https://bugs.launchpad.net/epics-base/+bug/1828900/+subscriptions
- Navigate by Date:
- Prev:
[Bug 1722535] Re: 'make distclean' inside a submodule Andrew Johnson via Core-talk
- Next:
Re: [Bug 1722535] Re: 'make distclean' inside a submodule Andrew Johnson via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
<2019>
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: [Bug 1722535] Re: 'make distclean' inside a submodule Andrew Johnson via Core-talk
- Next:
_WIN32_WINNT defines in EPICS base Freddie Akeroyd - UKRI STFC via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
<2019>
2020
2021
2022
2023
2024
|