Skip to content

Commit 8b88b1e

Browse files
authored
UT: remove special handling of BDE < 4.9 (#891)
Signed-off-by: Evgeny Malygin <[email protected]>
1 parent afbd8cf commit 8b88b1e

File tree

2 files changed

+5
-48
lines changed

2 files changed

+5
-48
lines changed

src/groups/bmq/bmqtst/bmqtst_testhelper.h

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,7 @@
286286
#include <ball_multiplexobserver.h>
287287
#include <ball_severity.h>
288288
#include <balst_stacktracetestallocator.h>
289-
#if BSL_VERSION >= BSL_MAKE_VERSION(4, 9)
290289
#include <bdlm_metricsregistry.h>
291-
#endif
292290
#include <bdlsb_memoutstreambuf.h>
293291
#include <bsl_cstddef.h>
294292
#include <bsl_cstdio.h>
@@ -603,23 +601,16 @@
603601
ball::LoggerManagerScopedGuard _logManagerGuard(&_logMultiplexObserver, \
604602
_logConfig);
605603

606-
#if BSL_VERSION >= BSL_MAKE_VERSION(4, 9)
607-
#define INIT_METRICS_REGISTRY() \
608-
/* Access the metrics registry default instance before assign the */ \
609-
/* global allocator */ \
610-
bdlm::MetricsRegistry::defaultInstance();
611-
#else
612-
#define INIT_METRICS_REGISTRY() /* Not required for previous BDE versions */
613-
#endif
614-
615604
#define INIT_GLOBAL_ALLOCATOR_INTERNAL() \
616605
/* Global Allocator */ \
617606
/* NOTE: The global allocator has a static storage duration to outlive */ \
618607
/* all static objects using that allocator. */ \
619608
static bslma::TestAllocator _gblAlloc( \
620609
"global", \
621610
(bmqtst::TestHelperUtil::verbosityLevel() >= 4)); \
622-
INIT_METRICS_REGISTRY() \
611+
/* Access the metrics registry default instance before assigning the */ \
612+
/* global allocator */ \
613+
bdlm::MetricsRegistry::defaultInstance(); \
623614
bslma::Default::setGlobalAllocator(&_gblAlloc);
624615

625616
#ifdef BSLS_PLATFORM_CMP_CLANG

src/groups/bmq/bmqu/bmqu_sharedresource.t.cpp

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -222,24 +222,7 @@ static void test1_resource_creators()
222222
}
223223

224224
// 4. exception safety
225-
// Current BDE version 4.8 has a memory leak which is already fixed
226-
// (https://github.com/bloomberg/bde/commit/42950dfbcaf2c76cdabc266afacecee67da21a59)
227-
// but not released yet. Skip address sanitizer check for BDE version less
228-
// than 4.9.
229-
#if BSL_VERSION < BSL_MAKE_VERSION(4, 9)
230-
#if defined(__has_feature) // Clang-supported method for checking sanitizers.
231-
static const bool skipTest = __has_feature(address_sanitizer);
232-
#elif defined(__SANITIZE_ADDRESS__)
233-
// GCC-supported macros for checking ASAN.
234-
static const bool skipTest = true;
235-
#else
236-
static const bool skipTest = false; // Default to running the test.
237-
#endif
238-
#else
239-
static const bool skipTest = false; // Default to running the test.
240-
#endif
241-
242-
if (!skipTest) {
225+
{
243226
typedef bmqu::SharedResourceFactoryDeleter<int, bslma::Allocator>
244227
Deleter;
245228

@@ -525,24 +508,7 @@ static void test4_resource_reset()
525508
}
526509

527510
// 5. exception safety
528-
// Current BDE version 4.8 has a memory leak which is already fixed
529-
// (https://github.com/bloomberg/bde/commit/42950dfbcaf2c76cdabc266afacecee67da21a59)
530-
// but not released yet. Skip address sanitizer check for BDE version less
531-
// than 4.9.
532-
#if BSL_VERSION < BSL_MAKE_VERSION(4, 9)
533-
#if defined(__has_feature) // Clang-supported method for checking sanitizers.
534-
static const bool skipTest = __has_feature(address_sanitizer);
535-
#elif defined(__SANITIZE_ADDRESS__)
536-
// GCC-supported macros for checking ASAN.
537-
static const bool skipTest = true;
538-
#else
539-
static const bool skipTest = false; // Default to running the test.
540-
#endif
541-
#else
542-
static const bool skipTest = false; // Default to running the test.
543-
#endif
544-
545-
if (!skipTest) {
511+
{
546512
typedef bmqu::SharedResourceFactoryDeleter<int, bslma::Allocator>
547513
Deleter;
548514

0 commit comments

Comments
 (0)