testPlan(): select isolated network configuration for QSRV
This commit is contained in:
@@ -23,6 +23,8 @@
|
||||
namespace pvxs {
|
||||
|
||||
/** Prepare for testing. Call after testPlan()
|
||||
* @since UNRELEASED If linked with pvxsIoc library, PVA server started
|
||||
* by ``iocInit()`` will use "isolated" configuration.
|
||||
*/
|
||||
PVXS_API
|
||||
void testSetup();
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
* in file LICENSE that is included with this distribution.
|
||||
*/
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#include "pvxs/version.h"
|
||||
|
||||
#if !defined(GCC_VERSION) || GCC_VERSION>VERSION_INT(4,9,0,0)
|
||||
@@ -29,6 +31,8 @@
|
||||
|
||||
namespace pvxs {
|
||||
|
||||
static std::atomic<bool> thisIsATest{false};
|
||||
|
||||
void testSetup()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
@@ -39,9 +43,15 @@ void testSetup()
|
||||
if(prev)
|
||||
testDiag("SetErrorMode() disables 0x%x\n", (unsigned)prev);
|
||||
#endif
|
||||
thisIsATest = true;
|
||||
}
|
||||
|
||||
namespace impl {
|
||||
bool inUnitTest()
|
||||
{
|
||||
return thisIsATest;
|
||||
}
|
||||
|
||||
loc_bad_alloc::loc_bad_alloc(const char *file, int line)
|
||||
{
|
||||
if(auto sep = strrchr(file, '/')) {
|
||||
|
||||
@@ -56,6 +56,9 @@ struct promote_print<int8_t> { static int op(const char& v) { return v; }};
|
||||
template<>
|
||||
struct promote_print<uint8_t> { static unsigned op(const char& v) { return v; }};
|
||||
|
||||
PVXS_API
|
||||
bool inUnitTest();
|
||||
|
||||
/* specialization of bad_alloc which notes the location from which
|
||||
* the exception originates.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user