int main( int argc, char* argv[] ) { TestApp* pcTest = new TestApp(); pcTest->Run(); return( 0 ); }
INT WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE, LPTSTR, INT) { TestApp app; app.Setup(hInst); return app.Run(); }
// main function int main() { setlocale(LC_ALL, ""); TestApp *app = TestApp::Instance(); app->Run(); return 0; }
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { TestApp* tApp = new TestApp(hInstance); if(!tApp->Init()) return 1; return tApp->Run(); }
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { TestApp app; app.Initialize(); app.Run(); app.Finalize(); return 0; }
// main int main(int argc, char **argv) { // find app file and get signature from resources char path[B_PATH_NAME_LENGTH]; status_t error = get_app_path(path); char signature[B_MIME_TYPE_LENGTH]; if (error == B_OK) { // init app file BFile file; error = file.SetTo(path, B_READ_ONLY); // get signature BString signatureString; if (error == B_OK) { if (file.ReadAttrString("signature", &signatureString) == B_OK && signatureString.Length() > 0) { strcpy(signature, signatureString.String()); } else strcpy(signature, kDefaultTestAppSignature); } else printf("ERROR: Couldn't init app file: %s\n", strerror(error)); } else printf("ERROR: Couldn't get app ref: %s\n", strerror(error)); // create the app TestApp *app = NULL; if (error == B_OK) { app = new TestApp(signature); // unitTesterMessenger = BMessenger(kUnitTesterSignature); error = init_unit_tester_messenger(); if (error != B_OK) printf("ERROR: Couldn't init messenger: %s\n", strerror(error)); // send started message BMessage message(MSG_STARTED); message.AddString("path", path); unitTesterMessenger.SendMessage(&message); // send main() args message BMessage argsMessage(MSG_MAIN_ARGS); argsMessage.AddInt32("argc", argc); for (int i = 0; i < argc; i++) argsMessage.AddString("argv", argv[i]); unitTesterMessenger.SendMessage(&argsMessage); // run the app app->Run(); delete app; // send terminated message unitTesterMessenger.SendMessage(MSG_TERMINATED); } return 0; }
void Test::Run() { m_result = true; try { TestApp* app = new TestApp; Punk::Config cfg; cfg.gpu_config.view_width = 800; cfg.gpu_config.view_height = 600; app->Init(cfg); System::Mouse::Instance()->LockInWindow(false); app->Run(); delete app; } catch(System::PunkException& e) { out_error() << e.ToString() << std::endl; m_result = false; } catch(...) { m_result = false; } }