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