Update contrib.
1 // Copyright (c) 2005-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // *IMPORTANT*: This should only be run when called from T_UCRT0P1.
15 // See TestCase SYSLIB-0001 in T_UCRT0P1.CPP for more information.
25 RTest TheTest(_L("T_UCRT0P2"));
28 //Test macros and functions
29 LOCAL_C void Check(TInt aValue, TInt aLine)
32 TheTest(EFalse, aLine);
35 LOCAL_C void Check(TInt aValue, TInt aExpected, TInt aLine)
37 if(aValue != aExpected)
39 RDebug::Print(_L("*** Expected error: %d, got: %d\r\n"), aExpected, aValue);
40 TheTest(EFalse, aLine);
44 #define TEST(arg) ::Check((arg), __LINE__)
45 #define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__)
49 //DEF074278: Java VM requires more command line testArguments.
50 void Defect_DEF074278_Part2()
52 TBuf<180> testArguments(_L("one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty twenty-one twenty-two twenty-three twenty-four "));
53 TBuf<210> inputArguments;
61 TheTest.Printf(_L("Retrieving the arguments passed in from T_UCRT0P1\n"));
62 __crt0(argc,argv,envp); // get args & environment from somewhere
64 //Get all the arguments into a descriptor, beginning at pos 1, as pos 0 contains
65 //the T_UCRT0P2 exe path and name.
66 for (TInt i=1; i < argc; i++)
70 inputArguments.Append((TChar)*str++);
71 inputArguments.Append(' ');
74 //tests all the arguments were passed to the new process correctly.
75 TheTest.Printf(_L("Checking all arguements were passed to the new process correctly... "));
76 TEST(testArguments == inputArguments );
77 TEST2(testArgNo, argc);
85 LOCAL_C void RunTestsL ()
87 Defect_DEF074278_Part2();
91 /This should only be called from T_UCRT0P1, as it is part of the same test.
93 GLDEF_C TInt E32Main()
95 CTrapCleanup* tc = CTrapCleanup::New();
100 TheTest.Printf(_L("Starting the tests in the child process T_UCRT0P2 ...\n"));
101 TheTest.Start(_L(" @SYMTestCaseID:SYSLIB-STDLIB-LEGACY-T_UCRT0P2-0001 "));
102 TRAPD(error,RunTestsL());
103 TEST2(error,KErrNone);