void TestVector( const Allocator& a ) { typedef std::vector< typename Allocator::value_type, Allocator > Vector; Vector v1( Policy< Allocator >::template GetDefault< Vector >( a ) ); Vector v2( Policy< Allocator >::template GetCopied< Vector >( a ) ); TestVector( a, v1 ); TestVector( a, v2 ); v1.swap( v2 ); TestVector( a, v1 ); TestVector( a, v2 ); }
int main ( int argc, char* argv[] ) { ParseTextOptions(&argc, argv); JXApplication* app = new JXApplication(&argc, argv, "testj2dplot", kDefaultStringData); assert( app != NULL ); Test2DPlotDirector* dataDir = new Test2DPlotDirector(app); assert( dataDir != NULL ); TestData(dataDir); Test2DPlotDirector* logDataDir = new Test2DPlotDirector(app); assert( logDataDir != NULL ); TestLogData(logDataDir); Test2DPlotDirector* vectorDir = new Test2DPlotDirector(app); assert( vectorDir != NULL ); TestVector(vectorDir); logDataDir->Activate(); dataDir->Activate(); vectorDir->Activate(); app->Run(); return 0; }
void LibTest::Run() { if ( !TestMatrix() ) { std::cout << "TestMatrix() failed\n"; } if ( !TestVector() ) { std::cout << "TestVector() failed\n"; } }
void TestWithContainers( const Allocator& a ) { TestVector( a ); TestDeque( a ); TestList( a ); TestSet( a ); TestMultiset( a ); TestMap( a ); TestMultimap( a ); TestString( a ); TestStack( a ); TestQueue( a ); TestPriorityQueue( a ); }
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // TODO: Place code here. WNDCLASS cs; cs.cbClsExtra =0; cs.cbWndExtra = 0; cs.hbrBackground = (HBRUSH)(COLOR_WINDOW +1);//°×É«±³¾° cs.hCursor = LoadCursor(NULL,IDC_CROSS); cs.hIcon = LoadIcon(NULL,IDI_APPLICATION); cs.hInstance = hInstance; cs.lpszClassName = "CircleLine"; cs.lpszMenuName = NULL; cs.style = CS_OWNDC; cs.lpfnWndProc =(WNDPROC) MyWndProc; if(!RegisterClass(&cs)) { MessageBox(NULL,"Register window class error","Error",MB_OK); } int x = GetSystemMetrics(SM_CXSCREEN); int y = GetSystemMetrics(SM_CYSCREEN); HWND hWindowHandle = CreateWindowEx(WS_EX_CLIENTEDGE|WS_EX_OVERLAPPEDWINDOW,"CircleLine","Lab1", WS_OVERLAPPEDWINDOW ,x/2,y/2,800,600,NULL,NULL,NULL,NULL); _ASSERT(hWindowHandle != NULL); g_hwnd = hWindowHandle; g_hdc = GetDC(g_hwnd); Init(); ShowWindow(hWindowHandle,nCmdShow); UpdateWindow(hWindowHandle); #ifdef _DEBUG TestVector(); TestMatrix(); #endif MSG msg; while(1) { if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) { // test if this is a quit if (msg.message == WM_QUIT) break; // translate any accelerator keys TranslateMessage(&msg); // send the message to the window proc DispatchMessage(&msg); } // end if // main game processing goes here // Render(); //LOCAL rotation main_logic(hWindowHandle); } // end whi return msg.wParam; }
void TestHMACSHA512(const std::string &hexkey, const std::string &hexin, const std::string &hexout) { std::vector<unsigned char> key = ParseHex(hexkey); TestVector(CHMAC_SHA512(&key[0], key.size()), ParseHex(hexin), ParseHex(hexout)); }
void TestRIPEMD160(const std::string &in, const std::string &hexout) { TestVector(CRIPEMD160(), in, ParseHex(hexout));}
void TestSHA512(const std::string &in, const std::string &hexout) { TestVector(CSHA512(), in, ParseHex(hexout));}
static void TestHMACSHA256(const std::string &hexkey, const std::string &hexin, const std::string &hexout) { std::vector<unsigned char> key = ParseHex(hexkey); TestVector(CHMAC_SHA256(key.data(), key.size()), ParseHex(hexin), ParseHex(hexout)); }
static void TestSHA256(const std::string &in, const std::string &hexout) { TestVector(CSHA256(), in, ParseHex(hexout));}