Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80537 - trunk/libs/context/test
From: oliver.kowalke_at_[hidden]
Date: 2012-09-16 05:29:15


Author: olli
Date: 2012-09-16 05:29:13 EDT (Sun, 16 Sep 2012)
New Revision: 80537
URL: http://svn.boost.org/trac/boost/changeset/80537

Log:
context: add test for stack size (min, max, default)

Text files modified:
   trunk/libs/context/test/test_context.cpp | 16 ++++++++++++++++
   1 files changed, 16 insertions(+), 0 deletions(-)

Modified: trunk/libs/context/test/test_context.cpp
==============================================================================
--- trunk/libs/context/test/test_context.cpp (original)
+++ trunk/libs/context/test/test_context.cpp 2012-09-16 05:29:13 EDT (Sun, 16 Sep 2012)
@@ -76,6 +76,21 @@
     ctx::jump_fcontext( fc, & fcm, 0);
 }
 
+void test_stack()
+{
+ ctx::guarded_stack_allocator alloc;
+
+ bool unbound = ctx::guarded_stack_allocator::is_stack_unbound();
+ std::size_t min = ctx::guarded_stack_allocator::minimum_stacksize();
+ std::size_t def = ctx::guarded_stack_allocator::default_stacksize();
+ BOOST_CHECK( min <= def);
+ if ( ! unbound)
+ {
+ std::size_t max = ctx::guarded_stack_allocator::maximum_stacksize();
+ BOOST_CHECK( max >= def);
+ }
+}
+
 void test_setup()
 {
     ctx::guarded_stack_allocator alloc;
@@ -205,6 +220,7 @@
     boost::unit_test::test_suite * test =
         BOOST_TEST_SUITE("Boost.Context: context test suite");
 
+ test->add( BOOST_TEST_CASE( & test_stack) );
     test->add( BOOST_TEST_CASE( & test_setup) );
     test->add( BOOST_TEST_CASE( & test_start) );
     test->add( BOOST_TEST_CASE( & test_jump) );


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk