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.
20 LOCAL_D RTest test(_L("T_UCRT0P1"));
25 @SYMTestCaseID SYSLIB-STDLIB-UT-1669
26 @SYMTestCaseDesc Testing whether increasing KMaxArgC from 20 to 25 results in the extra arguments
27 passed in to a new process to be handled correctly.
29 @SYMTestActions Starts a new process (T_UCRT0P2) passing in a set of arguments and this new process
30 checks all the arguements were handled correctly.
31 @SYMTestExpectedResults The test should not fail.
34 void Defect_DEF074278()
36 test.Next(_L(" @SYMTestCaseID:SYSLIB-STDLIB-UT-1669 - Defect_DEF074278... "));
38 TBuf<180> arguments(_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 "));
40 test.Printf(_L("Create a new process passing in a large number of arguements\n"));
41 //Creating another process to run T_UCRT0P2 passing in 24 arguments (25th will be the
42 //path and name of the exe). T_UCRT0P2 should only be run via this test and not on it's own.
43 TInt err=me.Create(_L("T_UCRT0P2"),arguments);
44 if (err==KErrNotFound)
45 err=me.Create(_L("z:\\test\\T_UCRT0P2"),arguments);
46 if (err==KErrNotFound)
47 err=me.Create(_L("c:\\test\\T_UCRT0P2"),arguments);
48 if (err==KErrNotFound)
49 err=me.Create(_L("z:\\sys\\bin\\T_UCRT0P2"),arguments);
52 //Checking that the child proces T_UCRT0P2 executes properly with no panic
53 TRequestStatus status;
56 User::WaitForRequest(status);
57 //Test to make sure the child process ended correctly
58 test(status==KErrNone);
59 test(me.ExitReason()==KErrNone);
65 @SYMTestCaseID SYSLIB-STDLIB-UT-4003
66 @SYMTestCaseDesc When there are heap memory allocation failures in __crt0, any locally allocated
67 heap memory should be cleaned up before the pointers go out of scope, preventing a memory leak.
68 @SYMTestPriority Medium
69 @SYMTestActions Start new process (T_UCRT0P3) passing arguments. Set heap allocation to fail at certain
70 points in __crt0. Clean up any locally allocated before routine returns. Check pointers
71 are set to NULL and there are no memory leaks.
72 @SYMTestExpectedResults No memory is leaked and pointer are NULL.
75 void Defect_DEF124477()
77 test.Next(_L("@SYMTestCaseID:SYSLIB-STDLIB-UT-4003 - Defect_DEF124477..."));
79 TBuf<20> arguments(_L("random arguements"));
81 test.Printf(_L("Create a new process passing in the arguements\n"));
82 //Creating another process to run T_UCRT0P3 passing in the arguments.
83 // T_UCRT0P3 should only be run via this test and not on it's own.
84 TInt err=me.Create(_L("T_UCRT0P3"),arguments);
85 if (err==KErrNotFound)
86 err=me.Create(_L("z:\\test\\T_UCRT0P3"),arguments);
89 //Checking that the child proces T_UCRT0P3 executes properly with no panic
90 TRequestStatus status;
93 User::WaitForRequest(status);
94 //Test to make sure the child process ended correctly
95 test(status==KErrNone);
96 test(me.ExitReason()==KErrNone);
103 LOCAL_C void RunTestsL()
107 Defect_DEF124477(); // OOM related test.
112 GLDEF_C TInt E32Main()
115 test.Start(_L(" Running T_UCRT0P1 tests..."));
117 CTrapCleanup* cleanup=CTrapCleanup::New();
118 test(cleanup != NULL);
119 TRAPD(error,RunTestsL());
120 test(error==KErrNone);