lowlevellibsandfws/apputils/tsrc/T_CLINE.CPP
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <e32cons.h>
       
    17 #include <bacline.h>
       
    18 
       
    19 CConsoleBase* console;
       
    20 
       
    21 void WriteArgsL()
       
    22 	{
       
    23 	CCommandLineArguments* args=CCommandLineArguments::NewLC();
       
    24 	for (TInt i=0; i<args->Count(); i++)
       
    25 		{
       
    26 		TPtrC argumentPrt(args->Arg(i));
       
    27 		console->Printf(_L("arg %d == %S\n"), i, &argumentPrt);
       
    28 		}
       
    29 	CleanupStack::PopAndDestroy();
       
    30 	}
       
    31 
       
    32 void TestReaderL()
       
    33 	{
       
    34 	console=Console::NewL(_L("Command-line arguments reader test"),TSize(KConsFullScreen, KConsFullScreen));
       
    35 	CleanupStack::PushL(console);
       
    36 	WriteArgsL();
       
    37 	//The following two lines were removed to support the automated test for T_CLINEPARENT
       
    38 	//console->Printf(_L("Press any key to exit:"));
       
    39 	//console->Getch();
       
    40 	CleanupStack::PopAndDestroy(console);
       
    41 	}
       
    42 
       
    43 GLDEF_C TInt E32Main()
       
    44     {
       
    45 	__UHEAP_MARK; // mark heap state
       
    46 	CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack
       
    47 	TRAPD(error,TestReaderL()); // do most stuff under cleanup stack
       
    48 	__ASSERT_ALWAYS(!error,User::Invariant());
       
    49 	delete cleanup; // destroy clean-up stack
       
    50 	__UHEAP_MARKEND; // check no memory leak
       
    51 	return 0; // and return
       
    52     }
       
    53