equal
deleted
inserted
replaced
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 // |
7 // |
8 // Initial Contributors: |
8 // Initial Contributors: |
9 // Nokia Corporation - initial contribution. |
9 // Nokia Corporation - initial contribution. |
14 // Test CApaCommandLine Apis\n |
14 // Test CApaCommandLine Apis\n |
15 // Test CApaCommandLine API by setting launching information and |
15 // Test CApaCommandLine API by setting launching information and |
16 // checking setter and getter function.\n |
16 // checking setter and getter function.\n |
17 // |
17 // |
18 // |
18 // |
19 |
|
20 |
|
21 |
19 |
22 /** |
20 /** |
23 @file |
21 @file |
24 @internalComponent - Internal Symbian test code |
22 @internalComponent - Internal Symbian test code |
25 */ |
23 */ |
143 //User::LeaveIfError(fSession.ShareProtected()); |
141 //User::LeaveIfError(fSession.ShareProtected()); |
144 INFO_PRINTF1(_L("Check for the existence of C:\\System\\Data Directory")); |
142 INFO_PRINTF1(_L("Check for the existence of C:\\System\\Data Directory")); |
145 TInt ret = fSession.Entry(KTempDir,dirEntry); |
143 TInt ret = fSession.Entry(KTempDir,dirEntry); |
146 if(ret==KErrNotFound) |
144 if(ret==KErrNotFound) |
147 { |
145 { |
148 INFO_PRINTF1(_L("Create C:\\System\\Data Directory if not existing already")); |
146 INFO_PRINTF1(_L("Create C:\\System\\Data Directory if not existing already")); |
149 fSession.MkDir(KTempDir); /* Create Data Directory as it does not exist */ |
147 fSession.MkDir(KTempDir); /* Created Data Directory as it does not exist */ |
150 } |
148 } |
151 User::LeaveIfError(file.Replace(fSession, KTDocName, EFileStreamText|EFileShareAny)); |
149 User::LeaveIfError(file.Replace(fSession, KTDocName, EFileStreamText|EFileShareAny)); |
152 User::LeaveIfError(file.Write(KTWriteData));//write some test data |
150 User::LeaveIfError(file.Write(KTWriteData));//write some test data |
153 |
151 |
154 INFO_PRINTF1(_L("The Set command line APIs are invoked with valid arguments")); |
152 INFO_PRINTF1(_L("The Set command line APIs are invoked with valid arguments")); |
275 User::LeaveIfError(fSession.ShareProtected()); |
273 User::LeaveIfError(fSession.ShareProtected()); |
276 INFO_PRINTF1(_L("Check for the existence of C:\\System\\Data Directory")); |
274 INFO_PRINTF1(_L("Check for the existence of C:\\System\\Data Directory")); |
277 TInt ret = fSession.Entry(KTempDir,dirEntry); |
275 TInt ret = fSession.Entry(KTempDir,dirEntry); |
278 if(ret==KErrNotFound) |
276 if(ret==KErrNotFound) |
279 { |
277 { |
280 INFO_PRINTF1(_L("Create C:\\System\\Data Directory if not existing already")); |
278 INFO_PRINTF1(_L("Create C:\\System\\Data Directory if not existing already")); |
|
279 fSession.MkDir(KTempDir); /* Created Data Directory as it does not exist */ |
281 } |
280 } |
282 User::LeaveIfError(file.Replace(fSession, KTDocName, EFileStreamText|EFileShareAny)); |
281 User::LeaveIfError(file.Replace(fSession, KTDocName, EFileStreamText|EFileShareAny)); |
283 TRAP(ret,cmdLine->SetFileByHandleL(file)); |
282 TRAP(ret,cmdLine->SetFileByHandleL(file)); |
284 TEST(KErrNone==ret); |
283 TEST(KErrNone==ret); |
285 break; |
284 break; |
406 TInt ret = fSession.Entry(KTempDir,dirEntry); |
405 TInt ret = fSession.Entry(KTempDir,dirEntry); |
407 |
406 |
408 if(ret==KErrNotFound) |
407 if(ret==KErrNotFound) |
409 { |
408 { |
410 INFO_PRINTF1(_L("Create C:\\System\\Data Directory if not existing already")); |
409 INFO_PRINTF1(_L("Create C:\\System\\Data Directory if not existing already")); |
|
410 fSession.MkDir(KTempDir); /* Created Data Directory as it does not exist */ |
411 } |
411 } |
412 |
412 |
413 User::LeaveIfError(file.Replace(fSession, KTDocName, EFileStreamText|EFileShareAny)); |
413 User::LeaveIfError(file.Replace(fSession, KTDocName, EFileStreamText|EFileShareAny)); |
414 User::LeaveIfError(file.Write(KTWriteData)); |
414 User::LeaveIfError(file.Write(KTWriteData)); |
415 |
415 |
673 __UHEAP_MARKEND; |
673 __UHEAP_MARKEND; |
674 |
674 |
675 INFO_PRINTF1(_L("Test completed!")); |
675 INFO_PRINTF1(_L("Test completed!")); |
676 return TestStepResult(); |
676 return TestStepResult(); |
677 } |
677 } |
|
678 |
|
679 |