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