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