Update contrib.
1 // Copyright (c) 2006-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 the License "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 // f32test\server\t_findcapall.cpp
15 // PlatSec compatibility test. Application capability is ALLFILES
16 // Tests to confirm DEF088224 changes do not affect exisitng functionality
17 // TFindFile should NEVER return KErrPermissionDenied for FindByDir requests
18 // z:\sys\bin\t_findcaptestfile.txt is used for testing.
19 // If the file is not avialable in the location, test will panic.
26 _LIT(KTestString,"t_findcapall");
28 LOCAL_C RTest test(KTestString);
30 LOCAL_C RFs FileServer;
32 LOCAL_C TInt TestFind(const TPtrC16 aTestDesc, const TPtrC16 aFPath, const TPtrC16 aFName)
36 TFindFile FindFile(FileServer);
37 Err=FindFile.FindByDir(aFName,aFPath);
42 GLDEF_C TInt E32Main()
48 Err=FileServer.Connect();
52 // RTest.Next is called from function "TestFind()".
53 // RTest.Start is called here to start the test.
54 test.Start(_L("Test Starts : Dummy Test"));
56 // Test: Find non existing file in existing /sys folder
60 // File Name : nonexistingfile.txt
62 // Expected return value: KErrNotFound
63 Err=TestFind(_L("Drive specified & available Path exists File does not exist"),
65 _L("nonexistingfile.txt"));
67 test(Err==KErrNotFound);
69 // Test: Find existing file in existing /sys folder
73 // File Name : t_findcaptestfile.txt
75 // Expected return value: KErrNone
76 Err=TestFind(_L("Drive specified & available Path exists File exists"),
78 _L("t_findcaptestfile.txt"));
82 // Test: Find non existing file in existing / non existing /sys folder
86 // File Name : nonexisting.txt
88 // Expected return value: KErrNotFound
89 Err=TestFind(_L("Drive specified & available Path may exist File does not exist"),
91 _L("nonexisting.txt"));
93 test(Err==KErrNotFound);
95 // Test: Find existing file in /sys folder without specifying the path
97 // Drive Name : Not specified.
99 // File Name : t_findcaptestfile.txt
101 // Expected return value: KErrNone
102 Err=TestFind(_L("Drive not specified Path exists File exists"),
104 _L("t_findcaptestfile.txt"));
108 // Test: Find non existing file in /sys folder without specifying the path
110 // Drive Name : Not specified
112 // File Name : nonexistingfile.txt
114 // Expected return value: KErrNotFound
115 Err=TestFind(_L("Drive not specified Path exists File does not exist"),
117 _L("nonexisting.txt"));
119 test(Err==KErrNotFound);
123 test.Printf(_L("Test completed\n"));