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:
parent
10e18e1c83
commit
997ffc628c
1 changed files with 13 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue