equal
deleted
inserted
replaced
20 // This is because, TFindFile returns KErrPermissionDenied, |
20 // This is because, TFindFile returns KErrPermissionDenied, |
21 // whether the file is available or not, in such folders. |
21 // whether the file is available or not, in such folders. |
22 // |
22 // |
23 // |
23 // |
24 |
24 |
|
25 #define __E32TEST_EXTENSION__ |
25 #include <e32test.h> |
26 #include <e32test.h> |
26 #include <f32file.h> |
27 #include <f32file.h> |
27 |
28 |
28 _LIT(KTestString,"t_findcapnone"); |
29 _LIT(KTestString,"t_findcapnone"); |
29 |
30 |
47 |
48 |
48 test.Title(); |
49 test.Title(); |
49 |
50 |
50 Err=FileServer.Connect(); |
51 Err=FileServer.Connect(); |
51 |
52 |
52 test(Err==KErrNone); |
53 test_KErrNone(Err); |
53 |
54 |
54 // RTest.Next is called from function "TestFind()". |
55 // RTest.Next is called from function "TestFind()". |
55 // RTest.Start is called here to start the test. |
56 // RTest.Start is called here to start the test. |
56 test.Start(_L("Test Starts : Dummy Test")); |
57 test.Start(_L("Test Starts : Dummy Test")); |
57 |
58 |
64 // Expected return value: KErrPermissionDenied |
65 // Expected return value: KErrPermissionDenied |
65 Err=TestFind(_L("Drive specified & available Path exists File does not exist"), |
66 Err=TestFind(_L("Drive specified & available Path exists File does not exist"), |
66 _L("z:\\sys\\bin\\"), |
67 _L("z:\\sys\\bin\\"), |
67 _L("nonexistingfile.txt")); |
68 _L("nonexistingfile.txt")); |
68 |
69 |
69 test(Err==KErrPermissionDenied); |
70 test_Value(Err, Err == KErrPermissionDenied); |
70 |
71 |
71 // Test: Find existing file in existing /sys folder |
72 // Test: Find existing file in existing /sys folder |
72 // |
73 // |
73 // Drive Name : Z: |
74 // Drive Name : Z: |
74 // Path : sys\bin |
75 // Path : sys\bin |
77 // Expected return value: KErrPermissionDenied |
78 // Expected return value: KErrPermissionDenied |
78 Err=TestFind(_L("Drive specified & available Path exists File exists"), |
79 Err=TestFind(_L("Drive specified & available Path exists File exists"), |
79 _L("z:\\sys\\bin\\"), |
80 _L("z:\\sys\\bin\\"), |
80 _L("t_findcaptestfile.txt")); |
81 _L("t_findcaptestfile.txt")); |
81 |
82 |
82 test(Err==KErrPermissionDenied); |
83 test_Value(Err, Err == KErrPermissionDenied); |
83 |
84 |
84 // Test: Find non existing file in existing / non existing /sys folder |
85 // Test: Find non existing file in existing / non existing /sys folder |
85 // |
86 // |
86 // Drive Name : C: |
87 // Drive Name : C: |
87 // Path : sys |
88 // Path : sys |
90 // Expected return value: KErrPermissionDenied |
91 // Expected return value: KErrPermissionDenied |
91 Err=TestFind(_L("Drive specified & available Path may exist File does not exist"), |
92 Err=TestFind(_L("Drive specified & available Path may exist File does not exist"), |
92 _L("c:\\sys\\"), |
93 _L("c:\\sys\\"), |
93 _L("nonexisting.txt")); |
94 _L("nonexisting.txt")); |
94 |
95 |
95 test(Err==KErrPermissionDenied); |
96 test_Value(Err, Err == KErrPermissionDenied); |
96 |
97 |
97 // Test: Find existing file in /sys folder without specifying the path |
98 // Test: Find existing file in /sys folder without specifying the path |
98 // |
99 // |
99 // Drive Name : Not specified. |
100 // Drive Name : Not specified. |
100 // Path : sys\bin |
101 // Path : sys\bin |
103 // Expected return value: KErrPermissionDenied |
104 // Expected return value: KErrPermissionDenied |
104 Err=TestFind(_L("Drive not specified Path exists File exists"), |
105 Err=TestFind(_L("Drive not specified Path exists File exists"), |
105 _L("\\sys\\bin\\"), |
106 _L("\\sys\\bin\\"), |
106 _L("t_findcaptestfile.txt")); |
107 _L("t_findcaptestfile.txt")); |
107 |
108 |
108 test(Err==KErrPermissionDenied); |
109 test_Value(Err, Err == KErrPermissionDenied); |
109 |
110 |
110 // Test: Find non existing file in /sys folder without specifying the path |
111 // Test: Find non existing file in /sys folder without specifying the path |
111 // |
112 // |
112 // Drive Name : Not specified |
113 // Drive Name : Not specified |
113 // Path : sys |
114 // Path : sys |
116 // Expected return value: KErrPermissionDenied |
117 // Expected return value: KErrPermissionDenied |
117 Err=TestFind(_L("Drive not specified Path exists File does not exist"), |
118 Err=TestFind(_L("Drive not specified Path exists File does not exist"), |
118 _L("\\sys\\"), |
119 _L("\\sys\\"), |
119 _L("nonexisting.txt")); |
120 _L("nonexisting.txt")); |
120 |
121 |
121 test(Err==KErrPermissionDenied); |
122 test_Value(Err, Err == KErrPermissionDenied); |
122 |
123 |
123 FileServer.Close(); |
124 FileServer.Close(); |
124 |
125 |
125 test.Printf(_L("Test completed\n")); |
126 test.Printf(_L("Test completed\n")); |
126 |
127 |