kerneltest/f32test/server/t_file.cpp
branchRCL_3
changeset 42 a179b74831c9
parent 6 0173bcd7697c
child 43 c1f20ce4abcf
--- a/kerneltest/f32test/server/t_file.cpp	Thu Jul 15 20:11:42 2010 +0300
+++ b/kerneltest/f32test/server/t_file.cpp	Thu Aug 19 11:14:22 2010 +0300
@@ -197,6 +197,13 @@
 	r=ZFile.Open(TheFs,fn,EFileStreamText);
 	test(r==KErrNone);
 
+	// check the file on the Z: drive his read-only
+	TEntry fileAtt;
+	r=TheFs.Entry(fn,fileAtt);
+	test_KErrNone(r);
+	test((fileAtt.iAtt & KEntryAttReadOnly) == KEntryAttReadOnly);
+
+
 	test.Next(_L("Read file"));
 	TBuf8<0x100> a,b;
 	FOREVER
@@ -953,6 +960,44 @@
 	test(r==KErrNone);
 	f.Close();
 
+
+	test.Next(_L("Internal attribute can't be read"));
+
+	r=TheFs.SetAtt(fname,0,KEntryAttReadOnly);
+	test_KErrNone(r);
+
+	r=f.Open(TheFs,fname,EFileWrite);
+	test_KErrNone(r);
+
+	r=f.SetAtt(KEntryAttReadOnly, 0);	// this will set internal attribut KEntryAttModified
+	test_KErrNone(r);
+
+	// copied \sf\os\kernelhwsrv\userlibandfileserver\fileserver\inc\common.h
+	const TUint KEntryAttModified=0x20000000;	
+
+	TUint att;
+	r = f.Att(att);
+	test_KErrNone(r);
+    test.Printf(_L("att %x"), att);
+	test_Value(att & KEntryAttModified, (att & KEntryAttModified) == 0);
+
+	r=f.SetAtt(att | KEntryAttModified, 0);
+	test_KErrNone(r);
+
+	r = f.Att(att);
+	test_KErrNone(r);
+    test.Printf(_L("att %x"), att);
+	test_Value(att & KEntryAttModified, (att & KEntryAttModified) == 0);
+
+	test.Next(_L("file time is set"));
+	r = f.Modified(time);
+	test(time.Int64() != 0);
+
+    r = f.Flush(); //-- this will flush attributes to the media
+    test_KErrNone(r);
+	f.Close();
+
+
 	// Tidy up
 	r=TheFs.SetAtt(fname,0,KEntryAttReadOnly);
 	test(r==KErrNone);