int main() { #ifdef TEST_MAIN testMain(); #else // setlocale(LC_ALL,""); // 이거 용도가?? // changeFilenameInDirectory("E:\\utorrent\\*"); #endif return 0; }
int main() { std::string disconnectInput = readFile(TEST_SOURCE_DIR "/input/disconnect.cpp"); if (!codeCompiles(disconnectInput) || !codeCompiles(readFile(TEST_SOURCE_DIR "/refactored/disconnect.cpp")) || !codeCompiles(readFile(TEST_SOURCE_DIR "/refactored/disconnect-NULL.cpp")) || !codeCompiles(readFile(TEST_SOURCE_DIR "/refactored/disconnect-0.cpp")) || !codeCompiles(readFile(TEST_SOURCE_DIR "/refactored/disconnect-Q_NULLPTR.cpp"))) { llvm::errs() << "Error: code does not compile!"; return 1; } if (testMain(disconnectInput, readFile(TEST_SOURCE_DIR "/refactored/disconnect.cpp"), 11, 11) != 0) return 1; nullPtrString = "NULL"; if (testMain(disconnectInput, readFile(TEST_SOURCE_DIR "/refactored/disconnect-NULL.cpp"), 11, 11) != 0) return 1; nullPtrString = "0"; if (testMain(disconnectInput, readFile(TEST_SOURCE_DIR "/refactored/disconnect-0.cpp"), 11, 11) != 0) return 1; nullPtrString = "Q_NULLPTR"; if (testMain(disconnectInput, readFile(TEST_SOURCE_DIR "/refactored/disconnect-Q_NULLPTR.cpp"), 11, 11) != 0) return 1; return 0; }
BOOL PerformanceTestApp::InitInstance() { // アプリケーション マニフェストが visual スタイルを有効にするために、 // ComCtl32.dll Version 6 以降の使用を指定する場合は、 // Windows XP に InitCommonControlsEx() が必要です。さもなければ、ウィンドウ作成はすべて失敗します。 INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); // アプリケーションで使用するすべてのコモン コントロール クラスを含めるには、 // これを設定します。 InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinApp::InitInstance(); // 標準初期化 // これらの機能を使わずに最終的な実行可能ファイルの // サイズを縮小したい場合は、以下から不要な初期化 // ルーチンを削除してください。 // 設定が格納されているレジストリ キーを変更します。 // TODO: 会社名または組織名などの適切な文字列に // この文字列を変更してください。 SetRegistryKey(_T("アプリケーション ウィザードで生成されたローカル アプリケーション")); PerformanceTestDlg dlg; m_pMainWnd = &dlg; app::TestMain testMain(dlg.getTestForm()); INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: ダイアログが <OK> で消された時のコードを // 記述してください。 } else if (nResponse == IDCANCEL) { // TODO: ダイアログが <キャンセル> で消された時のコードを // 記述してください。 } // ダイアログは閉じられました。アプリケーションのメッセージ ポンプを開始しないで // アプリケーションを終了するために FALSE を返してください。 return FALSE; }
void $module$Test (int testNumber) { TEST_STR *testStr; /* Allocation de la structure */ if ((testStr = testInit(testNumber, "$module$", $MODULE$_CLIENT_MBOX_REPLY_SIZE, $MODULE$_ABORT_RQST, $nbRequest$, $module$TestRequestNameTab, $module$TestRqstFuncTab, $nbPosterData$, $module$TestPosterNameTab, $module$TestPosterShowFuncTab)) == NULL) return; /* Init specifiques */ $module$TestInitTask (testStr); /* Fonction principale */ testMain(testStr); }
int main(){ testMain(); }
int main() { testMain(); ResourceManager application; return application.run(); }
acp_sint32_t main(acp_sint32_t aArgc, acp_char_t *aArgv[]) { acp_char_t *sArgs[3]; acp_proc_t sProc; acp_rc_t sRC; acp_sint32_t sShmKey; acp_char_t sKeyStr[16]; acp_char_t sLongParam[] = "--opt=012345678901234567890123456789"; acp_char_t *sManyArgs[11] = {sKeyStr, sLongParam, sLongParam, sLongParam, sLongParam, sLongParam, sLongParam, sLongParam, sLongParam, NULL}; ACT_TEST_BEGIN(); if (aArgc > 1) { /* * This is the Daemon doing! */ acp_sint32_t sSign; acp_uint32_t sResult; sRC = acpCStrToInt32(aArgv[1], 16, &sSign, &sResult, 10, NULL); ACT_CHECK(ACP_RC_IS_SUCCESS(sRC)); sShmKey = sSign * sResult; testMain(sShmKey); } else { acp_shm_t sShm; acp_sint32_t i; acp_sint32_t sCmp; /* * Parent Does HERE! */ /* use parent process id as a shm_key */ sShmKey = (acp_sint32_t)acpProcGetSelfID(); (void)acpSnprintf(sKeyStr, 15, "%d", sShmKey); /* * Parent passes a message to the daemon through shared memory. */ for (i = 0; i < SHM_TRY_COUNT; i++) { sRC = acpShmCreate(sShmKey, MAX_SHM_SIZE, TEST_PERM_RWRWRW); if (ACP_RC_IS_SUCCESS(sRC)) { break; } else { /* try another shared-memory key */ sShmKey++; } } ACT_CHECK(ACP_RC_IS_SUCCESS(sRC)); sRC = acpShmAttach(&sShm, sShmKey); ACT_CHECK(ACP_RC_IS_SUCCESS(sRC)); acpMemCpy(sShm.mAddr, TEST_STRING_PARK, TEST_STRING_PARK_LENGTH); /* * Launch daemon! */ sArgs[0] = sKeyStr; sArgs[1] = NULL; /* * BUG - 30120 acpProcLaunchDaemon fails to execute daemon with * a large parameters set. * Try to start daemon with path longer then MAX_PATH on Windows */ #if defined(ALTI_CFG_OS_WINDOWS) sRC = acpProcLaunchDaemon(&sProc, TEST_STRING_LONGPATH, sArgs, ACP_TRUE); ACT_CHECK_DESC(ACP_RC_IS_ENAMETOOLONG(sRC), ("Could run the daemon with " "too long path to executable")); #endif sRC = acpProcLaunchDaemon(&sProc, aArgv[0], sManyArgs, ACP_FALSE); ACT_CHECK_DESC(ACP_RC_IS_SUCCESS(sRC), ("Cannot launch a daemon with error %d", sRC)); /* read a message from the daemon, * it can take some time */ for (i = 0; i < SHM_TRY_COUNT; i++) { sCmp = acpMemCmp(sShm.mAddr, TEST_STRING_SOSI, TEST_STRING_SOSI_LENGTH); if (sCmp == 0) { break; } else { acpSleepSec(1); } } ACT_CHECK_DESC(0 == sCmp, ("Fails to read data from daemon")); #if defined(ALTI_CFG_OS_WINDOWS) /* remove "exe" extension and try to execute */ aArgv[0][acpCStrLen(aArgv[0], 128) - 4] = '\0'; sArgs[0] = sKeyStr; sArgs[1] = NULL; sRC = acpProcLaunchDaemon(&sProc, aArgv[0], sArgs, ACP_FALSE); ACT_CHECK_DESC(ACP_RC_IS_SUCCESS(sRC), ("Cannot launch a daemon which has no \".exe\"" "extension with error %d", sRC)); #endif sRC = acpShmDetach(&sShm); ACT_CHECK(ACP_RC_IS_SUCCESS(sRC)); sRC = acpShmDestroy(sShmKey); ACT_CHECK(ACP_RC_IS_SUCCESS(sRC)); } return 0; }