GLDEF_C TInt E32Main() { test.Title(); test.Start(_L("Test V1 notifier")); if(UserSvr::IpcV1Available()) DoTests(KUidTestTextNotifier1,EFalse); else test.Printf(_L("IPC V1 not supported")); test.Next(_L("Test V2 notifier")); DoTests(KUidTestTextNotifier2,EFalse); test.Next(_L("Test V1 notifier using MNotifierManager")); if(UserSvr::IpcV1Available()) DoTests(KUidTestTextNotifier1,ETrue); else test.Printf(_L("IPC V1 not supported")); test.Next(_L("Test V2 notifier using MNotifierManager")); if(UserSvr::IpcV1Available()) DoTests(KUidTestTextNotifier2,ETrue); else test.Printf(_L("FIX ME! - Can't run because IPC V1 not supported\n")); test.Next(_L("TestNotify")); TestNotify(); test.Next(_L("TestNotifyCancel")); TestNotifyCancel(); test.Next(_L("Test removed methods")); TestRemovedMethods(); test.Next(_L("Interactive Tests")); test.Printf(_L(" Do you want to test notifiers interactively? y/n\n")); test.Printf(_L(" Waiting 10 seconds for answer...\n")); TRequestStatus keyStat; test.Console()->Read(keyStat); RTimer timer; test(timer.CreateLocal()==KErrNone); TRequestStatus timerStat; timer.After(timerStat,10*1000000); User::WaitForRequest(timerStat,keyStat); TInt key = 0; if(keyStat!=KRequestPending) key = test.Console()->KeyCode(); timer.Cancel(); test.Console()->ReadCancel(); User::WaitForAnyRequest(); if(key=='y' || key=='Y') DoInteractiveTests(); else test.Printf(_L(" Interactive Tests Not Run\n")); test.End(); return(0); }
GLDEF_C TInt E32Main() { CTrapCleanup* cleanup; cleanup=CTrapCleanup::New(); __UHEAP_MARK; test.Title(); test.Start(_L("Starting tests...")); TTime timerC; timerC.HomeTime(); DoTests(); TTime endTimeC; endTimeC.HomeTime(); TTimeIntervalSeconds timeTakenC; TInt r=endTimeC.SecondsFrom(timerC,timeTakenC); test(r==KErrNone); test.Printf(_L("Time taken for test = %d seconds\n"),timeTakenC.Int()); test.End(); test.Close(); __UHEAP_MARKEND; delete cleanup; return(KErrNone); }
TInt E32Main() { TheTest.Title(); CTrapCleanup* tc = CTrapCleanup::New(); TheTest(tc != NULL); __UHEAP_MARK; TestEnvInit(); DeleteTestFiles(); TheTest.Start(_L(" @SYMTestCaseID:SYSLIB-SQL-CT-1650 OS porting layer tests")); DoTests(); TestEnvDestroy(); __UHEAP_MARKEND; TheTest.End(); TheTest.Close(); delete tc; User::Heap().Check(); return KErrNone; }
TInt E32Main() { TheSqliteDb = NULL; TheTest.Title(); CTrapCleanup* tc = CTrapCleanup::New(); __UHEAP_MARK; CreateTestEnv(); TInt err = sqlite3SymbianLibInit(); TEST2(err, KErrNone); DoTests(); sqlite3SymbianLibFinalize(); DestroyTestEnv(); CloseSTDLIB(); __UHEAP_MARKEND; TheTest.End(); TheTest.Close(); delete tc; User::Heap().Check(); return KErrNone; }
TInt E32Main() { TheTest.Title(); CTrapCleanup* tc = CTrapCleanup::New(); TheTest(tc != NULL); __UHEAP_MARK; GetCmdLineParamsAndSqlConfigString(TheTest, _L("t_sqlperformance4"), TheCmdLineParams, TheSqlConfigString); PrepareDbName(KCDriveDatabase, TheCmdLineParams.iDriveName, TheDbFileName); TheTest.Printf(_L("==Databases: %S\r\n"), &TheDbFileName); TestEnvInit(); DoTests(); TestEnvDestroy(); __UHEAP_MARKEND; TheTest.End(); TheTest.Close(); delete tc; User::Heap().Check(); return KErrNone; }
int main(int argc, char **argv) { Widget toplevel; Widget Form; Widget Label; XtAppContext app; Arg args[10]; int n; XtSetLanguageProc(NULL, NULL, NULL); toplevel = XtVaAppInitialize(&app, "test5", NULL, 0, &argc, argv, FallBack, NULL); printf("\nCreate a Label\n"); n = 0; XtSetArg(args[n], XmNwidth, 80); n++; XtSetArg(args[n], XmNheight, 30); n++; XtSetArg(args[n], XmNrecomputeSize, False); n++; Label = XmCreateLabel(toplevel, "TestWidget", args, n); DoTests(Label); printf("\nManage the Label\n"); XtManageChild(Label); DoTests(Label); printf("\nRealize the Shell\n"); XtRealizeWidget(toplevel); DoTests(Label); printf("%s\n",GlobalResult ? "All Passed" : "One or more Failed"); GlobalErrors = GlobalResult ? 0 : 1; { static XtWidgetGeometry Expected[] = { CWWidth | CWHeight, 0, 0, 80, 30, 0,0,0, /* Form */ }; PrintDetails(toplevel, Expected); } LessTifTestMainLoop(toplevel); exit(GlobalResult ? 0 : 1); }
GLDEF_C TInt E32Main() // main function called by E32 { __UHEAP_MARK; CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack TRAP_IGNORE(DoTests()); delete cleanup; // destroy clean-up stack REComSession::FinalClose(); __UHEAP_MARKEND; return 0; // and return }
int main(int argc, char **argv) { Widget toplevel; Widget Form; Widget Label; XtAppContext app; XtSetLanguageProc(NULL, NULL, NULL); toplevel = XtVaAppInitialize(&app, "test5", NULL, 0, &argc, argv, FallBack, NULL); printf("\nCreate a RowColumn\n"); Label = XmCreateRowColumn(toplevel, "TestWidget", NULL, 0); DoTests(Label); printf("\nManage the RowColumn\n"); XtManageChild(Label); DoTests(Label); printf("\nRealize the RowColumn\n"); XtRealizeWidget(toplevel); DoTests(Label); printf("%s\n",GlobalResult ? "All Passed" : "One or more Failed"); { static XtWidgetGeometry Expected[] = { CWWidth | CWHeight, 500, 500, 16, 16, 0,0,0, }; PrintDetails(toplevel, Expected); } LessTifTestMainLoop(toplevel); /* XtAppMainLoop(app); */ exit(GlobalResult ? 0 : 1); }
GLDEF_C TInt E32Main() { __UHEAP_MARK; CTrapCleanup *cleanup=CTrapCleanup::New(); test.Title(); test.Start(_L("Testing CBaActiveScheduler")); TRAPD(err,DoTests()); test(err==KErrNone); test.End(); test.Close(); delete cleanup; __UHEAP_MARKEND; return(0); }
STATUS CMcOdyTest::Enable(Message *pMsg) { Tracef("CMcOdyTest::Enable()\n"); // run our test routines DoTests (); // report successful enable Reply (pMsg, CTS_SUCCESS); return (CTS_SUCCESS); } /* end of CMcOdyTest::Enable */
GLDEF_C void CallTestsL() // // Call all tests // { TInt r = TheFs.CharToDrive( gSessionPath[0], gDriveNumber ); test( KErrNone == r ); // select appropriate metrics table if(IsFileSystemFAT32(TheFs, gDriveNumber)) { TheMetrics = &FAT32Metrics; RDebug::Printf("Using FAT32 metrics\r\n"); } else if(IsTestingLFFS()) { TheMetrics = &LffsMetrics; RDebug::Printf("Using LFFS metrics\r\n"); } else { TDriveInfo driveInfo; r=TheFs.Drive(driveInfo, gDriveNumber); test(r==KErrNone); if((driveInfo.iType==EMediaNANDFlash) && !(driveInfo.iMediaAtt & KMediaAttWriteProtected)) { TheMetrics = &NandMetrics; RDebug::Printf("Using NAND metrics\r\n"); } else { TheMetrics = &DefMetrics; RDebug::Printf("Using default metrics\r\n"); } } FillDiskCycle = 1; #ifdef REUSE_THREAD gRequestEnd = EFalse; #endif DoTests(); }
LOCAL_C TInt ThreadEntryPoint(TAny* aArg) { __UHEAP_MARK; CTrapCleanup* cleanup=CTrapCleanup::New(); TThreadData* data = static_cast<TThreadData*>(aArg); ASSERT(data); TRAPD(r, DoTests(data->iScriptFile, data->iLogFile, ETrue)); //TRAPD(r, PerformTests(TestTypes(), data->iScriptFile, data->iLogFile)); ASSERT( (r==KErrNone) || (r==KErrInUse) ); delete cleanup; __UHEAP_MARKEND; return (r); }
/** * This function sets up a console, a log file and checks * whether we need to wait for a key pressed after test * completion. * First DoThreadedTestsL is called, if everything is ok * it return ETrue and we move on to the standard tests. * If something went amiss (return EFalse) we skip * the standard test and return. */ LOCAL_D void SetupAndRunTests() { CConsoleBase* console = Console::NewL(_L("Test code"), TSize(KConsFullScreen, KConsFullScreen)); HBufC* logFile = GetArgument(1); if (logFile->Length()==0) { _LIT(defaultLog, "\\tcertstore.log"); TDriveUnit sysDrive (RFs::GetSystemDrive()); TDriveName sysdriveName (sysDrive.Name()); TBuf <18> fileName (sysdriveName); fileName.Append(defaultLog); logFile->ReAlloc(18); TPtr16 plog = logFile->Des(); plog.Append(fileName); } HBufC* wait = GetArgument(2); TBool waitAfterCompletion = EFalse; if (wait->Find(_L("-w")) != KErrNotFound) { waitAfterCompletion = ETrue; } TBool res = EFalse; TRAPD(err, res = DoThreadedTestsL(console, logFile, waitAfterCompletion)); if (res) { // Now run a normal tcertstore test to check store integrity TRAP(err, DoTests()); } delete console; delete wait; delete logFile; }
TInt E32Main() { TheTest.Title(); CTrapCleanup* tc = CTrapCleanup::New(); TheTest(tc != NULL); __UHEAP_MARK; DoTests(); DeleteTestFiles(); __UHEAP_MARKEND; TheTest.End(); TheTest.Close(); delete tc; User::Heap().Check(); return KErrNone; }
void main() { DWORD dwVersion; HRESULT hr; time_t ttime; BOOL fOleInitialized = FALSE; char ch; if (0 != fopen_s( &g_fpLogFile,"sampclnt.out", "at")) { DumpErrorMsg( "Warning: cannot open log file sampclnt.out\n" ); goto error; } time(&ttime); DumpStatusMsg( "\n-------------------------\n\n"); char buf[26]; ctime_s(buf,26,&ttime); DumpStatusMsg( "running sampclnt.exe\n%s\n\n",buf); dwVersion = OleBuildVersion(); if (HIWORD(dwVersion) != rmm) { DumpErrorMsg( "Error: OLE version mismatch. Build version %ld, current version %ld\n", rmm, HIWORD(dwVersion) ); goto error; } hr = OleInitialize( NULL ); if (FAILED(hr)) { DUMP_ERROR_LINENUMBER(); DumpErrorMsg("Error: OleInitialize failed\n"); goto error; } fOleInitialized = TRUE; hr = CoGetMalloc( MEMCTX_TASK, &g_pIMalloc ); if (FAILED(hr)) { DUMP_ERROR_LINENUMBER(); DumpErrorMsg("Error: CoGetMalloc failed\n"); goto error; } hr = DoTests(); if (FAILED(hr)) { DUMP_ERROR_LINENUMBER(); DumpErrorHResult( hr, "DoTests"); goto error; } g_pIMalloc->Release(); OleUninitialize(); if (g_fpLogFile) fclose(g_fpLogFile); /* Pause before we quit, in case user ran from an icon, so they can see our messages. */ printf("\n\n>>> Output has gone into 'sampclnt.out'."); printf("\n>>> You may wish to use a wide-column editor to view this file.\n\n"); printf("<press any key to continue>"); ch = _getch(); return; error: if (g_pIMalloc) g_pIMalloc->Release(); if (fOleInitialized) OleUninitialize(); if (g_fpLogFile) fclose(g_fpLogFile); /* Pause before we quit, in case user ran from an icon, so they can see our messages. */ printf("\n\n>>> Output has gone into 'sampclnt.out'."); printf("\n>>> You may wish to use a wide-column editor to view this file.\n\n"); printf("<press any key to continue>"); ch = _getch(); return; }