Skip to content

Commit 11f4ca1

Browse files
committed
Disable tests that will only work in DEBUG mode when NDEBUG is defined
1 parent a85ce03 commit 11f4ca1

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

src/test/json/create.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ namespace tao
6262
TEST_ASSERT( !( w < v ) );
6363
TEST_ASSERT( !( w > v ) );
6464

65+
#ifndef NDEBUG
6566
TEST_ASSERT( u.type() == type::DISCARDED );
6667
TEST_THROWS( u = u );
68+
#endif
6769

6870
u.reset();
6971
TEST_ASSERT( u.type() == type::UNINITIALIZED );

src/test/json/ostream.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ namespace tao
3636
const value v = std::move( d );
3737

3838
TEST_THROWS( to_string( e ) );
39+
#ifndef NDEBUG
3940
TEST_THROWS( to_string( d ) );
41+
#endif
4042

4143
test_simple( null, "null" );
4244
test_simple( true, "true" );

src/test/json/reference.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ namespace tao
3030
{
3131
value e;
3232
resolve_references( e );
33+
#ifndef NDEBUG
3334
value e2 = std::move( e );
3435
TEST_THROWS( resolve_references( e ) );
36+
#endif
3537
}
3638

3739
test( "{\"foo\":1,\"bar\":2}", "{\"foo\":1,\"bar\":2}" );

src/test/json/self_contained.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ namespace tao
4949
TEST_ASSERT( is_self_contained( v4 ) );
5050

5151
make_self_contained( e );
52-
52+
#ifndef NDEBUG
5353
TEST_THROWS( make_self_contained( d ) );
54-
54+
#endif
5555
make_self_contained( v1 );
5656
make_self_contained( v2 );
5757

0 commit comments

Comments
 (0)