Esempio n. 1
0
int main(int argc, char* argv[])
{
    CTest t;
    t.PrintData();

    return 0;
}
Esempio n. 2
0
// 사용자 코드
int _tmain(int argc, _TCHAR* argv[])
{
	CTest t;
	t.PrintData();

	return 0;
}
Esempio n. 3
0
int main()
{
	CTest t;
	t.PrintData();

	return 0;
}
Esempio n. 4
0
// ---------------------------------------------------------------------------
// CTest::NewL
// Static constructor.
// ---------------------------------------------------------------------------
//   
CTest* CTest::NewL( CConsoleBase& aConsole, TMccNetSettings aNetsettings )
    {
    CTest* self = new ( ELeave ) CTest();
    CleanupStack::PushL( self );

    self->ConstructL( aConsole, aNetsettings );

    CleanupStack::Pop( self );
    return self;
    }
Esempio n. 5
0
int main()
{
	CTest cTest;
	cTest.Start();
	//fn::Sleep(1);
	//const pid_t nRet = fn::Wait(NULL);
	cTest.Stop();
	FN_LOG_INFO("main");

	return 0;
}
Esempio n. 6
0
int main(int argc, char* argv[])
{
  //静态使用
//   CTest test;
//   test.ShowMsg();
// 
//   printf("%d", g_nNumber);
//   ShowMsg();


  //动态使用
  BOOL b;
  HMODULE hDll = LoadLibrary("FirstDll.dll"); //引用计数++
  hDll = LoadLibrary("FirstDll.dll");
  if (hDll != NULL)
  {
    //调用类
    CMyTest *pObject = (CMyTest*)new char[0x1000];
    
    //获取构函数地址
    Conver conver;
    conver.m_p = (void*)GetProcAddress(hDll, "??0CTest@@QAE@XZ");
    (pObject->*conver.m_pfn)();

    conver.m_p = (void*)GetProcAddress(hDll, "?ShowMsg@@YGXXZ");
    (pObject->*conver.m_pfn)();


    conver.m_p = (void*)GetProcAddress(hDll, "??1CTest@@UAE@XZ");
    (pObject->*conver.m_pfn)();

    delete[] (void*)pObject;


    //方法2:
    CRAETE_OBJECT pfnCreateObj = (CRAETE_OBJECT)GetProcAddress(hDll, "?CreateObject@@YAPAVCTest@@XZ");;
    CTest *pTest = pfnCreateObj();
    pTest->ShowMsg();

    b = FreeLibrary(hDll); //引用计数--
    b = FreeLibrary(hDll);
    b = FreeLibrary(hDll);
  }




  return 0;
}
Esempio n. 7
0
int main()
{
	CMyPoint pt(3, 4);
	CMyVec2 vec2(5, 6);
	CTest t;
	// 证明友元和本类无关,否则应该这么打印
	// CMyPoint::Print(pt)	当 Print 为静态函数时
	// pt.Print();
	Print(pt);				// 友元的输出方式,没有 this,也没有类 CMyPoint:: 作用域
	pt.Print();				// 成员函数的,有 this
	CMyPoint::Print(pt);	// 类的输出方式,也没有 this,但是类作为对象的模板,是不是可以直接访问,内政

	t.Print(pt);			// 友元类的成员函数输出方式
	CTest::OutPut(pt);		// 友元类的类函数输出方式

	// 友元:尽可能杜绝互为朋友的情况,因为它十分严重的破坏了类的封装性
	pt.Print(vec2);
	vec2.Print(pt);
	return 0;
}
Esempio n. 8
0
int main()
{
    CTest t;
    typedef void (*fn)();

    fn f = (fn)(((long long int*)(*(long long int*)&t))[2]);
    f();
    printf("%p\n", (long long int*)f);

    f = (fn)(((long long int*)(*(long long int*)&t))[3]);
    f();
    printf("%p\n", (long long int*)f);

    f = (fn)(((long long int*)(*(long long int*)&t))[0]);
    f();
    printf("%p\n", (long long int*)f);

    
    t.Show();
    return 0;
}
Esempio n. 9
0
void TestFunc()
{

	CTest testobj;
	testobj.test_write_json_by_path();
	testobj.test_write_json_by_stream();
	testobj.test_save_by_custom();

	testobj.test_read_json_by_path();
	testobj.test_read_json_by_stream();
	testobj.test_read_json_by_custom();
}
Esempio n. 10
0
void CUci::Debug()
{
	// on off
	char *token ; 
	token = GetNextToken();
	if(strcmp(token,"on")==0)	{		Print("info string debug mode on\n");	}
	else
	if(strcmp(token,"off")==0)	{		Print("info string debug mode off\n");	}
#ifdef DEVELOPMENT
	else
	if(strcmp(token,"test")==0)
	{
		Print("info string debug test on\n");
		CTest t;
		t.Test();
		Print("info string debug test off\n");
	}
	else
	if(strcmp(token,"kiwipete")==0)
	{
		Partida.LoadEPD("r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1 ");
		Print("info string kiwipete position loaded\n");
	}
	else
	if(strcmp(token,"estudia")==0)
	{

		CTest t;
		char * path = GetNextToken();
		t.Estudia(path);
	}
	else
	if(strcmp(token,"perftepd")==0)
	{
		PerftEpd t;
		char * path = GetNextToken();
		t.epdfile = path;
		t.Start();
	}
	else
	if(strcmp(token,"testepd")==0)
	{
		int depth_time;
		char * path = GetNextToken();
		if(path)
		{
			depth_time = atoi(path);
			path = GetNextToken();
			if(path)
			{
				char local[200];
				strcpy(local,path);
				CTest t;
				t.TestEpd(depth_time,local);
			}
			else
			{
				Print("info string Sintax: debug testepd depth(0-50) file.pgn\n");
				Print("info string Sintax: debug testepd time(miliseg) file.pgn\n");
			}
		}
		else
		{
				Print("info string Sintax: debug testepd depth(0-50) file.pgn\n");
				Print("info string Sintax: debug testepd time(miliseg) file.pgn\n");
		}
	}
	else
	if(strcmp(token,"t")==0)
	{
		char local[200];
		strcpy(local,"twic663.epd");
		CTest t;
		t.TestEpd(4,local);
	}
	else
	if(strcmp(token,"perft")==0)
	{
	   int d = 0;
		token = GetNextToken();
		if(token)
		{
			d = atoi(token);
			CTest t;
		   t.DoPerft(d);
		}
		else
		{
			Print("info string Sintax: debug perft depth\n");
		}
	}
	else
	if(strcmp(token,"display")==0)
	{
	   Partida.T.DibujaP();
	   Print("%s\n",Partida.T.SaveFEN());
	}
	else
	if(strcmp(token,"score")==0)
	{
		CSort Sort;
		Sort.Init(Partida.T,3);
		Print("%s;%d\n",Partida.T.SaveFEN(),Partida.T.Evalua(-99999,99999));
		printf("pst:\t\t%d\t%d \n", OppValue(Partida.T.PstDValue),EndValue(Partida.T.PstDValue));
		printf("Material:\t%d\t%d\n",Partida.T.Material[0],Partida.T.Material[1] );
		printf("Peones:\t\t%d\t%d\n",Partida.T.ValorPeones[0],Partida.T.ValorPeones[1] );
		printf("Caballos:\t%d\t%d\n",Partida.T.EvalCaballos[0],Partida.T.EvalCaballos[1] );
		printf("Alfiles:\t%d\t%d\n",Partida.T.EvalAlfiles[0],Partida.T.EvalAlfiles[1]  );
		printf("Torres:\t\t%d\t%d\n",Partida.T.EvalTorres[0],Partida.T.EvalTorres[1] );
		printf("Damas:\t\t%d\t%d\n",Partida.T.EvalDamas[0],Partida.T.EvalDamas[1] );
		printf("Cob Peones:\t%d\t%d\n",Partida.T.PawnCover[0],Partida.T.PawnCover[1] );
		printf("Total:\t\t%d\t%d\n",Partida.T.Opening,Partida.T.EndGame);
		
    }
	else
	if(strcmp(token,"split")==0)
	{
		token = GetNextToken();
		if(token)
		{
			CTest t;
			t.Split(token);
		}
	}
	else
	if(strcmp(token,"suite")==0)
	{
		CTest t;
		t.TestSuite();
	}
	else
	if(strcmp(token,"sts")==0)
	{
		CTest t;
		t.STS(100);
	}
	else
	if(strcmp(token,"sts1")==0)
	{
		CTest t;
		t.STS(1000);
	}
	else
	if(strcmp(token,"sts10")==0)
	{
		CTest t;
		t.STS10();
	}
	else
	if(strcmp(token,"simetria")==0)
	{
		token = GetNextToken();
		if(token)
		{
			CTest t;
			t.TestSimetria(token);
		}
	}
	else
	if(strcmp(token,"eval")==0)
	{
		extern void epdeval();
		epdeval();
	}
	else
	if(strcmp(token,"pgn2epd")==0)
	{
		token = GetNextToken();
		Pgn2Epd t;
		t.Parsea(token);
	}
	else
	if(strcmp(token,"train")==0)
	{
		token = GetNextToken();
		TrainEpd t;
		t.Start();
	}
	else
	if(strcmp(token,"stat")==0)
	{
		token = GetNextToken();
		TrainEpd t;
		t.Statistics();
	}
	else
	if(strcmp(token,"pgn2cmd")==0)
	{
		token = GetNextToken();
		Pgn2Cmd t;
		t.Parsea(token);
	}
	else // Branch Factor
	if(strcmp(token,"bf")==0)
	{
		Partida.DumpBranchFactor();
	}
#endif
}
Esempio n. 11
0
int main(){
   CTest test;
   test.TestLambda();
   return 0;
}
Esempio n. 12
0
void test_func()
{
	CTest obj;
	obj.test_release_xml();
	obj.test_load_xml();
}