2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 18:12:43 +00:00

Stop using assert() in tests so we can test with NDEBUG defined.

[SVN r33026]
This commit is contained in:
Dave Abrahams
2006-02-20 15:45:40 +00:00
parent c15216b385
commit 6ef31ba33a
19 changed files with 125 additions and 90 deletions

View File

@@ -2,6 +2,8 @@
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <boost/assert.hpp>
#include <boost/python/class.hpp>
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
@@ -15,10 +17,10 @@ struct X
{
explicit X(int x) : x(x), magic(7654321) { ++counter; }
X(X const& rhs) : x(rhs.x), magic(7654321) { ++counter; }
virtual ~X() { assert(magic == 7654321); magic = 6666666; x = 9999; --counter; }
virtual ~X() { BOOST_ASSERT(magic == 7654321); magic = 6666666; x = 9999; --counter; }
void set(int x) { assert(magic == 7654321); this->x = x; }
int value() const { assert(magic == 7654321); return x; }
void set(int x) { BOOST_ASSERT(magic == 7654321); this->x = x; }
int value() const { BOOST_ASSERT(magic == 7654321); return x; }
static int count() { return counter; }
private:
void operator=(X const&);