int MultiClientTestAutomatic(unsigned long initialPostSize) { FILE * log; int cycle; postSize = initialPostSize; do { printf("Preparing test with %u bytes of data ...", postSize); ClientMain(0); if (expectedData==0) { printf(" Error: Could not read any data\a\r\n"); return 1; } printf(" OK: %u bytes of data\r\n", expectedData); printf("Starting multi client test: %i cycles, %i clients each\r\n\r\n", (int)TESTCYCLES, (int)CLIENTCOUNT); good=bad=0; for (cycle=1;cycle<=TESTCYCLES;cycle++) { RunMultiClientTest(cycle); } printf("\r\n--------\r\n%u errors\r\n%u OK\r\n--------\r\n\r\n", bad, good); log = fopen("testclient.log", "at"); if (log) { fprintf(log, "%u\t%u\t%u\r\n", postSize, good, bad); fclose(log); } postSize = (postSize!=0) ? (postSize<<1) : 1; } while (postSize!=0); return 0; }
INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT) { // Create application object ClientMain main = ClientMain(strCmdLine); main.start(); //try { // main.start(); //} catch (Exception& e) { // MessageBoxA(NULL, e.getFullDescription().c_str(), "An exception has occurred:", MB_OK|MB_ICONERROR|MB_TASKMODAL); //} catch (...) { // MessageBoxA(NULL, "Unknown, not Ogre, error", "An exception has occurred:", MB_OK|MB_ICONERROR|MB_TASKMODAL); //} return 0; }
int SingleClientTestAutomatic(unsigned long initialPostSize) { FILE * log; int cycle; int i; postSize = initialPostSize; for (cycle=1;cycle<=TESTCYCLES;cycle++) { good=bad=0; for (i=0;i<1 /* 000 */;i++) { expectedData=17; ClientMain((void*)1); } log = fopen("testclient.log", "at"); if (log) { fprintf(log, "Cylce<%u>\t%u\t%u\r\n", cycle, good, bad); fclose(log); } printf("test cycle %u: %u good, %u bad\r\n", cycle, good, bad); } return 0; }