add test and solution for static ... fiasco crash

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@560 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
syntheticpp 2006-02-27 18:47:42 +00:00
parent 10e18e1c83
commit 997ffc628c

View file

@ -13,7 +13,7 @@
#include <utility>
#include <boost/test/minimal.hpp>
//#define TEST_LOKI_FUNCTION
#define TEST_LOKI_FUNCTION
#ifndef TEST_LOKI_FUNCTION
#include <boost/function.hpp>
@ -21,6 +21,11 @@ using namespace boost;
#else
#define LOKI_CLASS_LEVEL_THREADING
// disable to see "static instantiation order fiasco" crash
#define LOKI_FUNCTOR_IS_NOT_A_SMALLOBJECT
#include <boost/ref.hpp>
#include <loki/Function.h>
using namespace Loki;
@ -64,6 +69,12 @@ struct add_to_obj
int value;
};
function<void()> static_func(write_five);
static void test_static_function()
{
static_func();
}
static void test_zero_args()
{
@ -754,6 +765,7 @@ static void test_call()
int test_main(int, char* [])
{
test_static_function();
test_zero_args();
test_one_arg();
test_two_args();