sourcehook/test/test1.cpp
changeset 387 093c72464b35
parent 386 08583103ba6f
child 388 498e769e86a4
     1.1 --- a/sourcehook/test/test1.cpp	Sun Oct 07 23:00:38 2007 +0000
     1.2 +++ b/sourcehook/test/test1.cpp	Mon Oct 08 14:20:51 2007 +0000
     1.3 @@ -391,6 +391,11 @@
     1.4  	{
     1.5  		hello = 10;
     1.6  	}
     1.7 +
     1.8 +	Test *MyTestFactory()
     1.9 +	{
    1.10 +		return new Test;
    1.11 +	}
    1.12  }
    1.13  
    1.14  template <class T> T func(T a)
    1.15 @@ -398,7 +403,6 @@
    1.16  	return a;
    1.17  }
    1.18  
    1.19 -
    1.20  bool TestBasic(std::string &error)
    1.21  {
    1.22  	// Simple test for ModuleInMemory
    1.23 @@ -416,8 +420,8 @@
    1.24  	g_PLID = 1337;
    1.25  
    1.26  	HandlersF1 f1_handlers;
    1.27 -	Test test;
    1.28 -	Test *pTest = &test;
    1.29 +	Test *pTest = MyTestFactory();
    1.30 +	CAutoPtrDestruction<Test> apd(pTest);
    1.31  
    1.32  	void *pOrigVfnPtrF1 = (*reinterpret_cast<void***>(pTest))[0];
    1.33