754 test_Value(r, (r == KErrNotFound)||(r==KErrPathNotFound)||(r==KErrNone)); |
752 test_Value(r, (r == KErrNotFound)||(r==KErrPathNotFound)||(r==KErrNone)); |
755 |
753 |
756 TFileName path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\"); |
754 TFileName path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\"); |
757 TRequestStatus reqStat(KRequestPending); |
755 TRequestStatus reqStat(KRequestPending); |
758 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
756 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
759 test(reqStat==KRequestPending); |
757 test_Value(reqStat.Int(), reqStat==KRequestPending); |
760 |
758 |
761 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\")); |
759 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\")); |
762 test_KErrNone(r); |
760 test_KErrNone(r); |
763 |
761 |
764 User::WaitForRequest(reqStat); |
762 User::WaitForRequest(reqStat); |
765 test(reqStat==KErrNone); |
763 test_KErrNone(reqStat.Int()); |
766 |
764 |
767 path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\PayNoAttention.man"); |
765 path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\PayNoAttention.man"); |
768 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
766 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
769 test(reqStat==KRequestPending); |
767 test_Value(reqStat.Int(), reqStat==KRequestPending); |
770 |
768 |
771 RFile file; |
769 RFile file; |
772 r=file.Replace(TheFs,path,EFileStream); |
770 r=file.Replace(TheFs,path,EFileStream); |
773 test_KErrNone(r); |
771 test_KErrNone(r); |
774 file.Close(); |
772 file.Close(); |
775 |
773 |
776 User::WaitForRequest(reqStat); |
774 User::WaitForRequest(reqStat); |
777 test(reqStat==KErrNone); |
775 test_KErrNone(reqStat.Int()); |
778 |
776 |
779 r=TheFs.Delete(path); |
777 r=TheFs.Delete(path); |
780 test_KErrNone(r); |
778 test_KErrNone(r); |
781 |
779 |
782 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
780 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
783 test(reqStat==KRequestPending); |
781 test_Value(reqStat.Int(), reqStat==KRequestPending); |
784 // Now cancel the outstanding request |
782 // Now cancel the outstanding request |
785 TheFs.NotifyChangeCancel(reqStat); |
783 TheFs.NotifyChangeCancel(reqStat); |
786 User::WaitForRequest(reqStat); |
784 User::WaitForRequest(reqStat); |
787 test(reqStat==KErrCancel); |
785 test_Value(reqStat.Int(), reqStat==KErrCancel); |
788 |
786 |
789 // Repeat with a ENotifyFile request |
787 // Repeat with a ENotifyFile request |
790 TheFs.NotifyChange(ENotifyFile,reqStat,path); |
788 TheFs.NotifyChange(ENotifyFile,reqStat,path); |
791 test(reqStat==KRequestPending); |
789 test_Value(reqStat.Int(), reqStat==KRequestPending); |
792 |
790 |
793 r=file.Replace(TheFs,path,EFileStream); |
791 r=file.Replace(TheFs,path,EFileStream); |
794 test_KErrNone(r); |
792 test_KErrNone(r); |
795 file.Close(); |
793 file.Close(); |
796 |
794 |
797 User::WaitForRequest(reqStat); |
795 User::WaitForRequest(reqStat); |
798 test(reqStat==KErrNone); |
796 test_KErrNone(reqStat.Int()); |
799 |
797 |
800 r=TheFs.Delete(path); |
798 r=TheFs.Delete(path); |
801 test_KErrNone(r); |
799 test_KErrNone(r); |
802 |
800 |
803 TheFs.NotifyChange(ENotifyFile,reqStat,path); |
801 TheFs.NotifyChange(ENotifyFile,reqStat,path); |
804 test(reqStat==KRequestPending); |
802 test_Value(reqStat.Int(), reqStat==KRequestPending); |
805 // Now cancel the outstanding request |
803 // Now cancel the outstanding request |
806 TheFs.NotifyChangeCancel(reqStat); |
804 TheFs.NotifyChangeCancel(reqStat); |
807 User::WaitForRequest(reqStat); |
805 User::WaitForRequest(reqStat); |
808 test(reqStat==KErrCancel); |
806 test_Value(reqStat.Int(), reqStat==KErrCancel); |
809 |
807 |
810 // Repeat with an ENotifyAttributes request |
808 // Repeat with an ENotifyAttributes request |
811 TheFs.NotifyChange(ENotifyAttributes,reqStat,path); |
809 TheFs.NotifyChange(ENotifyAttributes,reqStat,path); |
812 test(reqStat==KRequestPending); |
810 test_Value(reqStat.Int(), reqStat==KRequestPending); |
813 |
811 |
814 r=file.Replace(TheFs,path,EFileStream); |
812 r=file.Replace(TheFs,path,EFileStream); |
815 test_KErrNone(r); |
813 test_KErrNone(r); |
816 file.Close(); |
814 file.Close(); |
817 |
815 |
818 User::WaitForRequest(reqStat); |
816 User::WaitForRequest(reqStat); |
819 test(reqStat==KErrNone); // Monitoring attributes but informed anyway |
817 test_KErrNone(reqStat.Int()); // Monitoring attributes but informed anyway |
820 |
818 |
821 r=TheFs.Delete(path); |
819 r=TheFs.Delete(path); |
822 test_KErrNone(r); |
820 test_KErrNone(r); |
823 |
821 |
824 TheFs.NotifyChange(ENotifyAttributes,reqStat,path); |
822 TheFs.NotifyChange(ENotifyAttributes,reqStat,path); |
825 test(reqStat==KRequestPending); |
823 test_Value(reqStat.Int(), reqStat==KRequestPending); |
826 // Now cancel the outstanding request |
824 // Now cancel the outstanding request |
827 TheFs.NotifyChangeCancel(reqStat); |
825 TheFs.NotifyChangeCancel(reqStat); |
828 User::WaitForRequest(reqStat); |
826 User::WaitForRequest(reqStat); |
829 test(reqStat==KErrCancel); |
827 test_Value(reqStat.Int(), reqStat==KErrCancel); |
830 |
828 |
831 // Repeat with an ENotifyWrite request |
829 // Repeat with an ENotifyWrite request |
832 TheFs.NotifyChange(ENotifyWrite,reqStat,path); |
830 TheFs.NotifyChange(ENotifyWrite,reqStat,path); |
833 test(reqStat==KRequestPending); |
831 test_Value(reqStat.Int(), reqStat==KRequestPending); |
834 |
832 |
835 r=file.Replace(TheFs,path,EFileStream); |
833 r=file.Replace(TheFs,path,EFileStream); |
836 test_KErrNone(r); |
834 test_KErrNone(r); |
837 file.Close(); |
835 file.Close(); |
838 |
836 |
839 User::WaitForRequest(reqStat); |
837 User::WaitForRequest(reqStat); |
840 test(reqStat==KErrNone); // Monitoring file writing but informed anyway |
838 test_KErrNone(reqStat.Int()); // Monitoring file writing but informed anyway |
841 |
839 |
842 r=TheFs.Delete(path); |
840 r=TheFs.Delete(path); |
843 test_KErrNone(r); |
841 test_KErrNone(r); |
844 |
842 |
845 TheFs.NotifyChange(ENotifyWrite,reqStat,path); |
843 TheFs.NotifyChange(ENotifyWrite,reqStat,path); |
846 test(reqStat==KRequestPending); |
844 test_Value(reqStat.Int(), reqStat==KRequestPending); |
847 // Now cancel the outstanding request |
845 // Now cancel the outstanding request |
848 TheFs.NotifyChangeCancel(reqStat); |
846 TheFs.NotifyChangeCancel(reqStat); |
849 User::WaitForRequest(reqStat); |
847 User::WaitForRequest(reqStat); |
850 test(reqStat==KErrCancel); |
848 test_Value(reqStat.Int(), reqStat==KErrCancel); |
851 |
849 |
852 // Repeat with an ENotifyDisk request |
850 // Repeat with an ENotifyDisk request |
853 TheFs.NotifyChange(ENotifyDisk,reqStat,path); |
851 TheFs.NotifyChange(ENotifyDisk,reqStat,path); |
854 test(reqStat==KRequestPending); |
852 test_Value(reqStat.Int(), reqStat==KRequestPending); |
855 |
853 |
856 r=file.Replace(TheFs,path,EFileStream); |
854 r=file.Replace(TheFs,path,EFileStream); |
857 test_KErrNone(r); |
855 test_KErrNone(r); |
858 file.Close(); |
856 file.Close(); |
859 |
857 |
860 User::WaitForRequest(reqStat); |
858 User::WaitForRequest(reqStat); |
861 test(reqStat==KErrNone); // Monitoring disk activity but informed anyway |
859 test_KErrNone(reqStat.Int()); // Monitoring disk activity but informed anyway |
862 |
860 |
863 r=TheFs.Delete(path); |
861 r=TheFs.Delete(path); |
864 test_KErrNone(r); |
862 test_KErrNone(r); |
865 |
863 |
866 TheFs.NotifyChange(ENotifyAttributes,reqStat,path); |
864 TheFs.NotifyChange(ENotifyAttributes,reqStat,path); |
867 test(reqStat==KRequestPending); |
865 test_Value(reqStat.Int(), reqStat==KRequestPending); |
868 // Now cancel the outstanding request |
866 // Now cancel the outstanding request |
869 TheFs.NotifyChangeCancel(reqStat); |
867 TheFs.NotifyChangeCancel(reqStat); |
870 User::WaitForRequest(reqStat); |
868 User::WaitForRequest(reqStat); |
871 test(reqStat==KErrCancel); |
869 test_Value(reqStat.Int(), reqStat==KErrCancel); |
872 |
870 |
873 // Now do much the same with directory monitoring |
871 // Now do much the same with directory monitoring |
874 path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\"); |
872 path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\"); |
875 TheFs.RmDir(path); |
873 TheFs.RmDir(path); |
876 |
874 |
877 TheFs.NotifyChange(ENotifyDir,reqStat,path); |
875 TheFs.NotifyChange(ENotifyDir,reqStat,path); |
878 test(reqStat==KRequestPending); |
876 test_Value(reqStat.Int(), reqStat==KRequestPending); |
879 |
877 |
880 TheFs.MkDir(path); |
878 TheFs.MkDir(path); |
881 test_KErrNone(r); |
879 test_KErrNone(r); |
882 |
880 |
883 User::WaitForRequest(reqStat); |
881 User::WaitForRequest(reqStat); |
884 test(reqStat==KErrNone); |
882 test_KErrNone(reqStat.Int()); |
885 |
883 |
886 TheFs.RmDir(path); |
884 TheFs.RmDir(path); |
887 test_KErrNone(r); |
885 test_KErrNone(r); |
888 |
886 |
889 TheFs.NotifyChange(ENotifyDir,reqStat,path); |
887 TheFs.NotifyChange(ENotifyDir,reqStat,path); |
890 test_KErrNone(r); |
888 test_KErrNone(r); |
891 test(reqStat==KRequestPending); |
889 test_Value(reqStat.Int(), reqStat==KRequestPending); |
892 |
890 |
893 // Now cancel the outstanding request |
891 // Now cancel the outstanding request |
894 TheFs.NotifyChangeCancel(reqStat); |
892 TheFs.NotifyChangeCancel(reqStat); |
895 User::WaitForRequest(reqStat); |
893 User::WaitForRequest(reqStat); |
896 test(reqStat==KErrCancel); |
894 test_Value(reqStat.Int(), reqStat==KErrCancel); |
897 |
895 |
898 TheFs.NotifyChange(ENotifyDir,reqStat,path); |
896 TheFs.NotifyChange(ENotifyDir,reqStat,path); |
899 test_KErrNone(r); |
897 test_KErrNone(r); |
900 test(reqStat==KRequestPending); |
898 test_Value(reqStat.Int(), reqStat==KRequestPending); |
901 |
899 |
902 // Get a separate thread to create the directory |
900 // Get a separate thread to create the directory |
903 RThread thread; |
901 RThread thread; |
904 thread.Create(_L("RequestAheadyThready"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest10); |
902 thread.Create(_L("RequestAheadyThready"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest10); |
905 TRequestStatus thrdStat(KRequestPending); |
903 TRequestStatus thrdStat(KRequestPending); |
906 thread.Logon(thrdStat); |
904 thread.Logon(thrdStat); |
907 thread.Resume(); |
905 thread.Resume(); |
908 thread.Close(); |
906 thread.Close(); |
909 |
907 |
910 User::WaitForRequest(thrdStat); |
908 User::WaitForRequest(thrdStat); |
911 test(thrdStat==KErrNone); |
909 test_KErrNone(thrdStat.Int()); |
912 User::WaitForRequest(reqStat); |
910 User::WaitForRequest(reqStat); |
913 test(reqStat==KErrNone); |
911 test_KErrNone(reqStat.Int()); |
914 |
912 |
915 TheFs.RmDir(path); |
913 TheFs.RmDir(path); |
916 test_KErrNone(r); |
914 test_KErrNone(r); |
917 |
915 |
918 // Check that notification is not received for a non-existent file if only the previously |
916 // Check that notification is not received for a non-existent file if only the previously |
919 // non existent directory that contains it is created |
917 // non existent directory that contains it is created |
920 path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\PayNoAttention.man"); |
918 path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\PayNoAttention.man"); |
921 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
919 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
922 test_KErrNone(r); |
920 test_KErrNone(r); |
923 test(reqStat==KRequestPending); |
921 test_Value(reqStat.Int(), reqStat==KRequestPending); |
924 |
922 |
925 thread.Create(_L("RequestAheadThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest10); |
923 thread.Create(_L("RequestAheadThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest10); |
926 thread.Logon(thrdStat); |
924 thread.Logon(thrdStat); |
927 thread.Resume(); |
925 thread.Resume(); |
928 thread.Close(); |
926 thread.Close(); |
929 |
927 |
930 User::WaitForRequest(thrdStat); |
928 User::WaitForRequest(thrdStat); |
931 test(thrdStat==KErrNone); |
929 test_KErrNone(thrdStat.Int()); |
932 test(reqStat==KRequestPending); |
930 test_Value(reqStat.Int(), reqStat==KRequestPending); |
933 |
931 |
934 // Now get a thread to create the file |
932 // Now get a thread to create the file |
935 thread.Create(_L("RequestAhead"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest11); |
933 thread.Create(_L("RequestAhead"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest11); |
936 thread.Logon(thrdStat); |
934 thread.Logon(thrdStat); |
937 thread.Resume(); |
935 thread.Resume(); |
938 User::WaitForRequest(thrdStat); |
936 User::WaitForRequest(thrdStat); |
939 test(thrdStat==KErrNone); |
937 test_KErrNone(thrdStat.Int()); |
940 thread.Close(); |
938 thread.Close(); |
941 |
939 |
942 User::WaitForRequest(reqStat); |
940 User::WaitForRequest(reqStat); |
943 test(reqStat==KErrNone); |
941 test_KErrNone(reqStat.Int()); |
944 |
942 |
945 TheFs.Delete(path); |
943 TheFs.Delete(path); |
946 test_KErrNone(r); |
944 test_KErrNone(r); |
947 |
945 |
948 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
946 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
949 test_KErrNone(r); |
947 test_KErrNone(r); |
950 test(reqStat==KRequestPending); |
948 test_Value(reqStat.Int(), reqStat==KRequestPending); |
951 |
949 |
952 // Now cancel the outstanding request |
950 // Now cancel the outstanding request |
953 TheFs.NotifyChangeCancel(reqStat); |
951 TheFs.NotifyChangeCancel(reqStat); |
954 User::WaitForRequest(reqStat); |
952 User::WaitForRequest(reqStat); |
955 test(reqStat==KErrCancel); |
953 test_Value(reqStat.Int(), reqStat==KErrCancel); |
956 |
954 |
957 path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\"); |
955 path=_L("\\F32-TST\\NOTIFY\\BehindTheCurtain\\"); |
958 TheFs.RmDir(path); |
956 TheFs.RmDir(path); |
959 test_KErrNone(r); |
957 test_KErrNone(r); |
960 } |
958 } |
970 TRequestStatus reqStat(KRequestPending); |
968 TRequestStatus reqStat(KRequestPending); |
971 TRequestStatus thrdStat(KRequestPending); |
969 TRequestStatus thrdStat(KRequestPending); |
972 TFileName path=(_L("\\F32-TST\\")); |
970 TFileName path=(_L("\\F32-TST\\")); |
973 |
971 |
974 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
972 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
975 test(reqStat==KRequestPending); |
973 test_Value(reqStat.Int(), reqStat==KRequestPending); |
976 RThread thread; |
974 RThread thread; |
977 TInt r=thread.Create(_L("MyThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1); |
975 TInt r=thread.Create(_L("MyThread"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1); |
978 test_KErrNone(r); |
976 test_KErrNone(r); |
979 thread.Logon(thrdStat); |
977 thread.Logon(thrdStat); |
980 thread.Resume(); |
978 thread.Resume(); |
981 User::WaitForRequest(thrdStat); |
979 User::WaitForRequest(thrdStat); |
982 test(thrdStat==KErrNone); |
980 test_KErrNone(thrdStat.Int()); |
983 User::WaitForRequest(reqStat); |
981 User::WaitForRequest(reqStat); |
984 test(reqStat==KErrNone); |
982 test_KErrNone(reqStat.Int()); |
985 thread.Close(); |
983 thread.Close(); |
986 |
984 |
987 // Repeat the test |
985 // Repeat the test |
988 test.Next(_L("Repeat Test notification of an entry change")); |
986 test.Next(_L("Repeat Test notification of an entry change")); |
989 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
987 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
990 test(reqStat==KRequestPending); |
988 test_Value(reqStat.Int(), reqStat==KRequestPending); |
991 r=thread.Create(_L("MyThread2"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1); |
989 r=thread.Create(_L("MyThread2"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1); |
992 test_KErrNone(r); |
990 test_KErrNone(r); |
993 thread.Logon(thrdStat); |
991 thread.Logon(thrdStat); |
994 thread.Resume(); |
992 thread.Resume(); |
995 User::WaitForRequest(thrdStat); |
993 User::WaitForRequest(thrdStat); |
996 test(thrdStat==KErrNone); |
994 test_KErrNone(thrdStat.Int()); |
997 User::WaitForRequest(reqStat); |
995 User::WaitForRequest(reqStat); |
998 test(reqStat==KErrNone); |
996 test_KErrNone(reqStat.Int()); |
999 thread.Close(); |
997 thread.Close(); |
1000 |
998 |
1001 // Test it can be cancelled |
999 // Test it can be cancelled |
1002 test.Next(_L("Test Notify cancel")); |
1000 test.Next(_L("Test Notify cancel")); |
1003 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1001 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1004 test(reqStat==KRequestPending); |
1002 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1005 TheFs.NotifyChangeCancel(); |
1003 TheFs.NotifyChangeCancel(); |
1006 User::WaitForRequest(reqStat); |
1004 User::WaitForRequest(reqStat); |
1007 test(reqStat==KErrCancel); |
1005 test_Value(reqStat.Int(), reqStat==KErrCancel); |
1008 |
1006 |
1009 // Test it can be notified again |
1007 // Test it can be notified again |
1010 test.Next(_L("Test notification still works")); |
1008 test.Next(_L("Test notification still works")); |
1011 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1009 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1012 test(reqStat==KRequestPending); |
1010 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1013 r=thread.Create(_L("MyThread3"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1); |
1011 r=thread.Create(_L("MyThread3"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1); |
1014 test_KErrNone(r); |
1012 test_KErrNone(r); |
1015 thread.Logon(thrdStat); |
1013 thread.Logon(thrdStat); |
1016 thread.Resume(); |
1014 thread.Resume(); |
1017 User::WaitForRequest(thrdStat); |
1015 User::WaitForRequest(thrdStat); |
1018 test(thrdStat==KErrNone); |
1016 test_KErrNone(thrdStat.Int()); |
1019 User::WaitForRequest(reqStat); |
1017 User::WaitForRequest(reqStat); |
1020 test(reqStat==KErrNone); |
1018 test_KErrNone(reqStat.Int()); |
1021 thread.Close(); |
1019 thread.Close(); |
1022 |
1020 |
1023 // Test notification doesn't occur when a change occurs above the directory monitored |
1021 // Test notification doesn't occur when a change occurs above the directory monitored |
1024 // (Notification of rename events occurring above the directory which affect the path |
1022 // (Notification of rename events occurring above the directory which affect the path |
1025 // will occur - this is tested for in Test18()) |
1023 // will occur - this is tested for in Test18()) |
1026 test.Next(_L("Test changing above monitored directory")); |
1024 test.Next(_L("Test changing above monitored directory")); |
1027 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\")); |
1025 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\")); |
1028 test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists)); |
1026 test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists)); |
1029 path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"); |
1027 path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"); |
1030 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1028 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1031 test(reqStat==KRequestPending); |
1029 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1032 r=thread.Create(_L("MyThread4"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1); |
1030 r=thread.Create(_L("MyThread4"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1); |
1033 test_KErrNone(r); |
1031 test_KErrNone(r); |
1034 thread.Logon(thrdStat); |
1032 thread.Logon(thrdStat); |
1035 thread.Resume(); |
1033 thread.Resume(); |
1036 User::WaitForRequest(thrdStat); |
1034 User::WaitForRequest(thrdStat); |
1037 test(thrdStat==KErrNone); |
1035 test_KErrNone(thrdStat.Int()); |
1038 User::After(500000); |
1036 User::After(500000); |
1039 thread.Close(); |
1037 thread.Close(); |
1040 test(reqStat==KRequestPending); |
1038 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1041 TheFs.NotifyChangeCancel(); |
1039 TheFs.NotifyChangeCancel(); |
1042 User::WaitForRequest(reqStat); |
1040 User::WaitForRequest(reqStat); |
1043 test(reqStat==KErrCancel); |
1041 test_Value(reqStat.Int(), reqStat==KErrCancel); |
1044 |
1042 |
1045 // Test notification occurs when a change is made to the subdirectory monitored |
1043 // Test notification occurs when a change is made to the subdirectory monitored |
1046 test.Next(_L("Create a file in monitored subdirectory")); |
1044 test.Next(_L("Create a file in monitored subdirectory")); |
1047 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1045 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1048 test(reqStat==KRequestPending); |
1046 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1049 r=thread.Create(_L("MyThread5"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest2); |
1047 r=thread.Create(_L("MyThread5"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest2); |
1050 test_KErrNone(r); |
1048 test_KErrNone(r); |
1051 thread.Logon(thrdStat); |
1049 thread.Logon(thrdStat); |
1052 thread.Resume(); |
1050 thread.Resume(); |
1053 User::WaitForRequest(thrdStat); |
1051 User::WaitForRequest(thrdStat); |
1054 test(thrdStat==KErrNone); |
1052 test_KErrNone(thrdStat.Int()); |
1055 User::WaitForRequest(reqStat); |
1053 User::WaitForRequest(reqStat); |
1056 test(reqStat==KErrNone); |
1054 test_KErrNone(reqStat.Int()); |
1057 thread.Close(); |
1055 thread.Close(); |
1058 |
1056 |
1059 test.Next(_L("Create a directory in monitored subdirectory")); |
1057 test.Next(_L("Create a directory in monitored subdirectory")); |
1060 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1058 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1061 test(reqStat==KRequestPending); |
1059 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1062 r=thread.Create(_L("MyThread6"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest3); |
1060 r=thread.Create(_L("MyThread6"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest3); |
1063 test_KErrNone(r); |
1061 test_KErrNone(r); |
1064 thread.Logon(thrdStat); |
1062 thread.Logon(thrdStat); |
1065 thread.Resume(); |
1063 thread.Resume(); |
1066 User::WaitForRequest(thrdStat); |
1064 User::WaitForRequest(thrdStat); |
1067 test(thrdStat==KErrNone); |
1065 test_KErrNone(thrdStat.Int()); |
1068 User::WaitForRequest(reqStat); |
1066 User::WaitForRequest(reqStat); |
1069 test(reqStat==KErrNone); |
1067 test_KErrNone(reqStat.Int()); |
1070 thread.Close(); |
1068 thread.Close(); |
1071 |
1069 |
1072 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1070 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1073 test(reqStat==KRequestPending); |
1071 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1074 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\TINMAN\\")); |
1072 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\TINMAN\\")); |
1075 test_KErrNone(r); |
1073 test_KErrNone(r); |
1076 User::WaitForRequest(reqStat); |
1074 User::WaitForRequest(reqStat); |
1077 test(reqStat==KErrNone); |
1075 test_KErrNone(reqStat.Int()); |
1078 |
1076 |
1079 |
1077 |
1080 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\TINMAN\\")); |
1078 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\TINMAN\\")); |
1081 test_KErrNone(r); |
1079 test_KErrNone(r); |
1082 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\")); |
1080 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\SCARECROW\\")); |
1087 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\")); |
1085 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\")); |
1088 test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists)); |
1086 test_Value(r, (r == KErrNone)||(r==KErrAlreadyExists)); |
1089 path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"); |
1087 path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"); |
1090 |
1088 |
1091 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1089 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1092 test(reqStat==KRequestPending); |
1090 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1093 r=thread.Create(_L("MyThread7"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1); |
1091 r=thread.Create(_L("MyThread7"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest1); |
1094 test_KErrNone(r); |
1092 test_KErrNone(r); |
1095 thread.Logon(thrdStat); |
1093 thread.Logon(thrdStat); |
1096 thread.Resume(); |
1094 thread.Resume(); |
1097 User::WaitForRequest(thrdStat); |
1095 User::WaitForRequest(thrdStat); |
1098 test(thrdStat==KErrNone); |
1096 test_KErrNone(thrdStat.Int()); |
1099 User::After(500000); |
1097 User::After(500000); |
1100 thread.Close(); |
1098 thread.Close(); |
1101 test(reqStat==KRequestPending); |
1099 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1102 TheFs.NotifyChangeCancel(); |
1100 TheFs.NotifyChangeCancel(); |
1103 User::WaitForRequest(reqStat); |
1101 User::WaitForRequest(reqStat); |
1104 test(reqStat==KErrCancel); |
1102 test_Value(reqStat.Int(), reqStat==KErrCancel); |
1105 |
1103 |
1106 // Test notification occurs when a change is made to the subdirectory monitored |
1104 // Test notification occurs when a change is made to the subdirectory monitored |
1107 test.Next(_L("Delete a file in monitored subdirectory")); |
1105 test.Next(_L("Delete a file in monitored subdirectory")); |
1108 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1106 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1109 test(reqStat==KRequestPending); |
1107 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1110 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc")); |
1108 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc")); |
1111 test_KErrNone(r); |
1109 test_KErrNone(r); |
1112 User::WaitForRequest(reqStat); |
1110 User::WaitForRequest(reqStat); |
1113 test(reqStat==KErrNone); |
1111 test_KErrNone(reqStat.Int()); |
1114 |
1112 |
1115 RFile file; |
1113 RFile file; |
1116 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.msg"),EFileStream); |
1114 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.msg"),EFileStream); |
1117 test_KErrNone(r); |
1115 test_KErrNone(r); |
1118 file.Close(); |
1116 file.Close(); |
1119 |
1117 |
1120 // Test notification on a specific file |
1118 // Test notification on a specific file |
1121 test.Next(_L("Monitor changes to a specific file")); |
1119 test.Next(_L("Monitor changes to a specific file")); |
1122 path+=_L("WickedWitch.msg"); |
1120 path+=_L("WickedWitch.msg"); |
1123 TheFs.NotifyChange(ENotifyAll,reqStat,path); |
1121 TheFs.NotifyChange(ENotifyAll,reqStat,path); |
1124 test(reqStat==KRequestPending); |
1122 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1125 r=thread.Create(_L("MyThread8"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest8); |
1123 r=thread.Create(_L("MyThread8"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest8); |
1126 test_KErrNone(r); |
1124 test_KErrNone(r); |
1127 thread.Logon(thrdStat); |
1125 thread.Logon(thrdStat); |
1128 thread.Resume(); |
1126 thread.Resume(); |
1129 User::WaitForRequest(thrdStat); |
1127 User::WaitForRequest(thrdStat); |
1130 test(thrdStat==KErrNone); |
1128 test_KErrNone(thrdStat.Int()); |
1131 User::WaitForRequest(reqStat); |
1129 User::WaitForRequest(reqStat); |
1132 test(reqStat==KErrNone); |
1130 test_KErrNone(reqStat.Int()); |
1133 thread.Close(); |
1131 thread.Close(); |
1134 |
1132 |
1135 // Test notification does not occur if a change is made above the file |
1133 // Test notification does not occur if a change is made above the file |
1136 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1134 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1137 test(reqStat==KRequestPending); |
1135 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1138 thread.Create(_L("MyThread9"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest2); |
1136 thread.Create(_L("MyThread9"),ThreadEntryPoint,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)ETest2); |
1139 thread.Logon(thrdStat); |
1137 thread.Logon(thrdStat); |
1140 thread.Resume(); |
1138 thread.Resume(); |
1141 User::WaitForRequest(thrdStat); |
1139 User::WaitForRequest(thrdStat); |
1142 test(thrdStat==KErrNone); |
1140 test_KErrNone(thrdStat.Int()); |
1143 User::After(500000); |
1141 User::After(500000); |
1144 thread.Close(); |
1142 thread.Close(); |
1145 test(reqStat==KRequestPending); |
1143 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1146 TheFs.NotifyChangeCancel(); |
1144 TheFs.NotifyChangeCancel(); |
1147 User::WaitForRequest(reqStat); |
1145 User::WaitForRequest(reqStat); |
1148 test(reqStat==KErrCancel); |
1146 test_Value(reqStat.Int(), reqStat==KErrCancel); |
1149 |
1147 |
1150 // Test notification occurs when a change is made to the file |
1148 // Test notification occurs when a change is made to the file |
1151 test.Next(_L("Delete monitored file")); |
1149 test.Next(_L("Delete monitored file")); |
1152 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1150 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1153 test(reqStat==KRequestPending); |
1151 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1154 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.Msg")); |
1152 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\WickedWitch.Msg")); |
1155 test_KErrNone(r); |
1153 test_KErrNone(r); |
1156 User::WaitForRequest(reqStat); |
1154 User::WaitForRequest(reqStat); |
1157 test(reqStat==KErrNone); |
1155 test_KErrNone(reqStat.Int()); |
1158 |
1156 |
1159 // Test notification request is now submitted on the non existent path successfully |
1157 // Test notification request is now submitted on the non existent path successfully |
1160 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1158 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1161 test(reqStat==KRequestPending); |
1159 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1162 TheFs.NotifyChangeCancel(reqStat); |
1160 TheFs.NotifyChangeCancel(reqStat); |
1163 User::WaitForRequest(reqStat); |
1161 User::WaitForRequest(reqStat); |
1164 test(reqStat==KErrCancel); |
1162 test_Value(reqStat.Int(), reqStat==KErrCancel); |
1165 |
1163 |
1166 path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.Doc"); |
1164 path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.Doc"); |
1167 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1165 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1168 test(reqStat==KRequestPending); |
1166 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1169 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.Doc")); |
1167 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.Doc")); |
1170 test_KErrNone(r); |
1168 test_KErrNone(r); |
1171 User::WaitForRequest(reqStat); |
1169 User::WaitForRequest(reqStat); |
1172 test(reqStat==KErrNone); |
1170 test_KErrNone(reqStat.Int()); |
1173 |
1171 |
1174 path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"); |
1172 path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"); |
1175 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1173 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1176 test(reqStat==KRequestPending); |
1174 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1177 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\")); |
1175 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\")); |
1178 test_KErrNone(r); |
1176 test_KErrNone(r); |
1179 User::WaitForRequest(reqStat); |
1177 User::WaitForRequest(reqStat); |
1180 test(reqStat==KErrNone); |
1178 test_KErrNone(reqStat.Int()); |
1181 |
1179 |
1182 // Submit a request for a path which does not yet exist |
1180 // Submit a request for a path which does not yet exist |
1183 path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\"); |
1181 path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\"); |
1184 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1182 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1185 test(reqStat==KRequestPending); |
1183 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1186 // Now create the directory we are waiting on |
1184 // Now create the directory we are waiting on |
1187 r=TheFs.MkDir(path); |
1185 r=TheFs.MkDir(path); |
1188 test_KErrNone(r); |
1186 test_KErrNone(r); |
1189 // Make sure the notification has now been received |
1187 // Make sure the notification has now been received |
1190 User::WaitForRequest(reqStat); |
1188 User::WaitForRequest(reqStat); |
1191 test(reqStat==KErrNone); |
1189 test_KErrNone(reqStat.Int()); |
1192 |
1190 |
1193 // Submit a request for a file which does not yet exist |
1191 // Submit a request for a file which does not yet exist |
1194 path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\Red-Shoes.red"); |
1192 path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\Red-Shoes.red"); |
1195 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1193 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1196 test(reqStat==KRequestPending); |
1194 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1197 // Now create the file we are waiting on |
1195 // Now create the file we are waiting on |
1198 r=file.Replace(TheFs,path,EFileStream); |
1196 r=file.Replace(TheFs,path,EFileStream); |
1199 test_KErrNone(r); |
1197 test_KErrNone(r); |
1200 file.Close(); |
1198 file.Close(); |
1201 // Make sure the notification has now been received |
1199 // Make sure the notification has now been received |
1202 User::WaitForRequest(reqStat); |
1200 User::WaitForRequest(reqStat); |
1203 test(reqStat==KErrNone); |
1201 test_KErrNone(reqStat.Int()); |
1204 // Submit another notification request and delete the file |
1202 // Submit another notification request and delete the file |
1205 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1203 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1206 test(reqStat==KRequestPending); |
1204 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1207 r=TheFs.Delete(path); |
1205 r=TheFs.Delete(path); |
1208 test_KErrNone(r); |
1206 test_KErrNone(r); |
1209 User::WaitForRequest(reqStat); |
1207 User::WaitForRequest(reqStat); |
1210 test(reqStat==KErrNone); |
1208 test_KErrNone(reqStat.Int()); |
1211 path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\"); |
1209 path=_L("\\F32-TST\\NOTIFY\\GOOD_WITCH\\"); |
1212 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1210 TheFs.NotifyChange(ENotifyEntry,reqStat,path); |
1213 test(reqStat==KRequestPending); |
1211 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1214 r=TheFs.RmDir(path); |
1212 r=TheFs.RmDir(path); |
1215 test_KErrNone(r); |
1213 test_KErrNone(r); |
1216 User::WaitForRequest(reqStat); |
1214 User::WaitForRequest(reqStat); |
1217 test(reqStat==KErrNone); |
1215 test_KErrNone(reqStat.Int()); |
1218 // test passing in an empty string |
1216 // test passing in an empty string |
1219 TheFs.NotifyChange(ENotifyEntry,reqStat,_L("")); |
1217 TheFs.NotifyChange(ENotifyEntry,reqStat,_L("")); |
1220 User::WaitForRequest(reqStat); |
1218 User::WaitForRequest(reqStat); |
1221 test(reqStat==KErrArgument); |
1219 test_Value(reqStat.Int(), reqStat==KErrArgument); |
1222 } |
1220 } |
1223 |
1221 |
1224 static void Test9() |
1222 static void Test9() |
1225 // |
1223 // |
1226 // Test notify for multiple clients |
1224 // Test notify for multiple clients |
1294 test_KErrNone(r); |
1292 test_KErrNone(r); |
1295 r=fs6.SetSessionPath(gSessionPath); |
1293 r=fs6.SetSessionPath(gSessionPath); |
1296 test_KErrNone(r); |
1294 test_KErrNone(r); |
1297 fs6.NotifyChange(ENotifyEntry,reqStat6,path6); |
1295 fs6.NotifyChange(ENotifyEntry,reqStat6,path6); |
1298 |
1296 |
1299 test(reqStat1==KRequestPending); |
1297 test_Value(reqStat1.Int(), reqStat1==KRequestPending); |
1300 test(reqStat2==KRequestPending); |
1298 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
1301 test(reqStat3==KRequestPending); |
1299 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
1302 test(reqStat4==KRequestPending); |
1300 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
1303 test(reqStat5==KRequestPending); |
1301 test_Value(reqStat5.Int(), reqStat5==KRequestPending); |
1304 test(reqStat6==KRequestPending); |
1302 test_Value(reqStat6.Int(), reqStat6==KRequestPending); |
1305 |
1303 |
1306 // Make a change a the top level and check that only the session monitoring |
1304 // Make a change a the top level and check that only the session monitoring |
1307 // that level is notified |
1305 // that level is notified |
1308 test.Next(_L("Test only client monitoring top level is notified")); |
1306 test.Next(_L("Test only client monitoring top level is notified")); |
1309 r=file.Replace(TheFs,_L("\\F32-TST\\NewFile.txt"),EFileStream); |
1307 r=file.Replace(TheFs,_L("\\F32-TST\\NewFile.txt"),EFileStream); |
1310 test_KErrNone(r); |
1308 test_KErrNone(r); |
1311 file.Close(); |
1309 file.Close(); |
1312 User::WaitForRequest(reqStat1); |
1310 User::WaitForRequest(reqStat1); |
1313 test(reqStat1==KErrNone); |
1311 test_KErrNone(reqStat1.Int()); |
1314 test(reqStat2==KRequestPending); |
1312 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
1315 test(reqStat3==KRequestPending); |
1313 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
1316 test(reqStat4==KRequestPending); |
1314 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
1317 test(reqStat5==KRequestPending); |
1315 test_Value(reqStat5.Int(), reqStat5==KRequestPending); |
1318 User::WaitForRequest(reqStat6); |
1316 User::WaitForRequest(reqStat6); |
1319 test(reqStat6==KErrNone); |
1317 test_KErrNone(reqStat6.Int()); |
1320 |
1318 |
1321 r=TheFs.Delete(_L("\\F32-TST\\NewFile.txt")); |
1319 r=TheFs.Delete(_L("\\F32-TST\\NewFile.txt")); |
1322 test_KErrNone(r); |
1320 test_KErrNone(r); |
1323 |
1321 |
1324 // Renew the notify request at the top level and make a change one step lower |
1322 // Renew the notify request at the top level and make a change one step lower |
1325 fs1.NotifyChange(ENotifyEntry,reqStat1,path1); |
1323 fs1.NotifyChange(ENotifyEntry,reqStat1,path1); |
1326 fs6.NotifyChange(ENotifyEntry,reqStat6,path6); |
1324 fs6.NotifyChange(ENotifyEntry,reqStat6,path6); |
1327 test(reqStat1==KRequestPending); |
1325 test_Value(reqStat1.Int(), reqStat1==KRequestPending); |
1328 test(reqStat6==KRequestPending); |
1326 test_Value(reqStat6.Int(), reqStat6==KRequestPending); |
1329 |
1327 |
1330 test.Next(_L("Test clients monitoring levels 1 and 2 are notified")); |
1328 test.Next(_L("Test clients monitoring levels 1 and 2 are notified")); |
1331 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileStream); |
1329 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileStream); |
1332 test_KErrNone(r); |
1330 test_KErrNone(r); |
1333 file.Close(); |
1331 file.Close(); |
1334 |
1332 |
1335 User::WaitForRequest(reqStat1); |
1333 User::WaitForRequest(reqStat1); |
1336 User::WaitForRequest(reqStat2); |
1334 User::WaitForRequest(reqStat2); |
1337 test(reqStat1==KErrNone); |
1335 test_KErrNone(reqStat1.Int()); |
1338 test(reqStat2==KErrNone); |
1336 test_KErrNone(reqStat2.Int()); |
1339 test(reqStat3==KRequestPending); |
1337 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
1340 test(reqStat4==KRequestPending); |
1338 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
1341 test(reqStat5==KRequestPending); |
1339 test_Value(reqStat5.Int(), reqStat5==KRequestPending); |
1342 User::WaitForRequest(reqStat6); |
1340 User::WaitForRequest(reqStat6); |
1343 test(reqStat6==KErrNone); |
1341 test_KErrNone(reqStat6.Int()); |
1344 |
1342 |
1345 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\NewFile.txt")); |
1343 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\NewFile.txt")); |
1346 test_KErrNone(r); |
1344 test_KErrNone(r); |
1347 |
1345 |
1348 // Renew the notify request at the top and second levels and make a change |
1346 // Renew the notify request at the top and second levels and make a change |
1349 // one step lower still |
1347 // one step lower still |
1350 fs1.NotifyChange(ENotifyEntry,reqStat1,path1); |
1348 fs1.NotifyChange(ENotifyEntry,reqStat1,path1); |
1351 fs2.NotifyChange(ENotifyEntry,reqStat2,path2); |
1349 fs2.NotifyChange(ENotifyEntry,reqStat2,path2); |
1352 fs6.NotifyChange(ENotifyEntry,reqStat6,path6); |
1350 fs6.NotifyChange(ENotifyEntry,reqStat6,path6); |
1353 test(reqStat1==KRequestPending); |
1351 test_Value(reqStat1.Int(), reqStat1==KRequestPending); |
1354 test(reqStat2==KRequestPending); |
1352 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
1355 test(reqStat6==KRequestPending); |
1353 test_Value(reqStat6.Int(), reqStat6==KRequestPending); |
1356 |
1354 |
1357 test.Next(_L("Test clients monitoring levels 1,2 and 3 are notified")); |
1355 test.Next(_L("Test clients monitoring levels 1,2 and 3 are notified")); |
1358 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\ANIMAL\\NewFile.txt"),EFileStream); |
1356 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\ANIMAL\\NewFile.txt"),EFileStream); |
1359 test_KErrNone(r); |
1357 test_KErrNone(r); |
1360 file.Close(); |
1358 file.Close(); |
1361 |
1359 |
1362 User::WaitForRequest(reqStat1); |
1360 User::WaitForRequest(reqStat1); |
1363 User::WaitForRequest(reqStat2); |
1361 User::WaitForRequest(reqStat2); |
1364 User::WaitForRequest(reqStat3); |
1362 User::WaitForRequest(reqStat3); |
1365 test(reqStat1==KErrNone); |
1363 test_KErrNone(reqStat1.Int()); |
1366 test(reqStat2==KErrNone); |
1364 test_KErrNone(reqStat2.Int()); |
1367 test(reqStat3==KErrNone); |
1365 test_KErrNone(reqStat3.Int()); |
1368 test(reqStat4==KRequestPending); |
1366 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
1369 test(reqStat5==KRequestPending); |
1367 test_Value(reqStat5.Int(), reqStat5==KRequestPending); |
1370 User::WaitForRequest(reqStat6); |
1368 User::WaitForRequest(reqStat6); |
1371 test(reqStat6==KErrNone); |
1369 test_KErrNone(reqStat6.Int()); |
1372 |
1370 |
1373 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\NewFile.txt")); |
1371 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\NewFile.txt")); |
1374 test_KErrNone(r); |
1372 test_KErrNone(r); |
1375 |
1373 |
1376 // Renew the notify request at the top, second and third levels and make a change |
1374 // Renew the notify request at the top, second and third levels and make a change |
1377 // one step lower still |
1375 // one step lower still |
1378 fs1.NotifyChange(ENotifyEntry,reqStat1,path1); |
1376 fs1.NotifyChange(ENotifyEntry,reqStat1,path1); |
1379 fs2.NotifyChange(ENotifyEntry,reqStat2,path2); |
1377 fs2.NotifyChange(ENotifyEntry,reqStat2,path2); |
1380 fs3.NotifyChange(ENotifyEntry,reqStat3,path3); |
1378 fs3.NotifyChange(ENotifyEntry,reqStat3,path3); |
1381 fs6.NotifyChange(ENotifyEntry,reqStat6,path6); |
1379 fs6.NotifyChange(ENotifyEntry,reqStat6,path6); |
1382 test(reqStat1==KRequestPending); |
1380 test_Value(reqStat1.Int(), reqStat1==KRequestPending); |
1383 test(reqStat2==KRequestPending); |
1381 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
1384 test(reqStat3==KRequestPending); |
1382 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
1385 test(reqStat6==KRequestPending); |
1383 test_Value(reqStat4.Int(), reqStat6==KRequestPending); |
1386 |
1384 |
1387 test.Next(_L("Test clients monitoring levels 1 - 4 are notified")); |
1385 test.Next(_L("Test clients monitoring levels 1 - 4 are notified")); |
1388 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\cat.txt")); |
1386 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\cat.txt")); |
1389 test_KErrNone(r); |
1387 test_KErrNone(r); |
1390 User::WaitForRequest(reqStat1); |
1388 User::WaitForRequest(reqStat1); |
1391 User::WaitForRequest(reqStat2); |
1389 User::WaitForRequest(reqStat2); |
1392 User::WaitForRequest(reqStat3); |
1390 User::WaitForRequest(reqStat3); |
1393 User::WaitForRequest(reqStat4); |
1391 User::WaitForRequest(reqStat4); |
1394 test(reqStat1==KErrNone); |
1392 test_KErrNone(reqStat1.Int()); |
1395 test(reqStat2==KErrNone); |
1393 test_KErrNone(reqStat2.Int()); |
1396 test(reqStat3==KErrNone); |
1394 test_KErrNone(reqStat3.Int()); |
1397 test(reqStat4==KErrNone); |
1395 test_KErrNone(reqStat4.Int()); |
1398 test(reqStat5==KRequestPending); |
1396 test_Value(reqStat5.Int(), reqStat5==KRequestPending); |
1399 User::WaitForRequest(reqStat6); |
1397 User::WaitForRequest(reqStat6); |
1400 test(reqStat6==KErrNone); |
1398 test_KErrNone(reqStat6.Int()); |
1401 |
1399 |
1402 // Renew the notify request at the top, second and third levels and on the file deleted above |
1400 // Renew the notify request at the top, second and third levels and on the file deleted above |
1403 // which will be successful, but will not complete (for obvious reasons) |
1401 // which will be successful, but will not complete (for obvious reasons) |
1404 |
1402 |
1405 // Make a change one step lower still |
1403 // Make a change one step lower still |
1406 fs1.NotifyChange(ENotifyEntry,reqStat1,path1); |
1404 fs1.NotifyChange(ENotifyEntry,reqStat1,path1); |
1407 fs2.NotifyChange(ENotifyEntry,reqStat2,path2); |
1405 fs2.NotifyChange(ENotifyEntry,reqStat2,path2); |
1408 fs3.NotifyChange(ENotifyEntry,reqStat3,path3); |
1406 fs3.NotifyChange(ENotifyEntry,reqStat3,path3); |
1409 fs6.NotifyChange(ENotifyEntry,reqStat6,path6); |
1407 fs6.NotifyChange(ENotifyEntry,reqStat6,path6); |
1410 fs4.NotifyChange(ENotifyEntry,reqStat4,path4); |
1408 fs4.NotifyChange(ENotifyEntry,reqStat4,path4); |
1411 test(reqStat1==KRequestPending); |
1409 test_Value(reqStat1.Int(), reqStat1==KRequestPending); |
1412 test(reqStat2==KRequestPending); |
1410 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
1413 test(reqStat3==KRequestPending); |
1411 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
1414 test(reqStat4==KRequestPending); |
1412 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
1415 test(reqStat6==KRequestPending); |
1413 test_Value(reqStat6.Int(), reqStat6==KRequestPending); |
1416 |
1414 |
1417 test.Next(_L("Test clients monitoring levels 1 - 3 and 5 are notified")); |
1415 test.Next(_L("Test clients monitoring levels 1 - 3 and 5 are notified")); |
1418 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\dog.txt")); |
1416 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\ANIMAL\\dog.txt")); |
1419 test_KErrNone(r); |
1417 test_KErrNone(r); |
1420 User::WaitForRequest(reqStat1); |
1418 User::WaitForRequest(reqStat1); |
1421 User::WaitForRequest(reqStat2); |
1419 User::WaitForRequest(reqStat2); |
1422 User::WaitForRequest(reqStat3); |
1420 User::WaitForRequest(reqStat3); |
1423 // Don't wait for reqStat4 |
1421 // Don't wait for reqStat4 |
1424 User::WaitForRequest(reqStat5); |
1422 User::WaitForRequest(reqStat5); |
1425 User::WaitForRequest(reqStat6); |
1423 User::WaitForRequest(reqStat6); |
1426 test(reqStat1==KErrNone); |
1424 test_KErrNone(reqStat1.Int()); |
1427 test(reqStat2==KErrNone); |
1425 test_KErrNone(reqStat2.Int()); |
1428 test(reqStat3==KErrNone); |
1426 test_KErrNone(reqStat3.Int()); |
1429 test(reqStat4==KRequestPending); // File does not exist |
1427 test_Value(reqStat4.Int(), reqStat4==KRequestPending); // File does not exist |
1430 test(reqStat5==KErrNone); |
1428 test_KErrNone(reqStat5.Int()); |
1431 test(reqStat6==KErrNone); |
1429 test_KErrNone(reqStat6.Int()); |
1432 |
1430 |
1433 fs4.NotifyChangeCancel(reqStat4); |
1431 fs4.NotifyChangeCancel(reqStat4); |
1434 User::WaitForRequest(reqStat4); |
1432 User::WaitForRequest(reqStat4); |
1435 test(reqStat4==KErrCancel); |
1433 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
1436 // Renew the notify request at the top, second and third levels and attempt to renew |
1434 // Renew the notify request at the top, second and third levels and attempt to renew |
1437 // the request on the files deleted above (which will fail). |
1435 // the request on the files deleted above (which will fail). |
1438 |
1436 |
1439 test.Next(_L("Test clients monitoring levels 1 - 3 are notified")); |
1437 test.Next(_L("Test clients monitoring levels 1 - 3 are notified")); |
1440 fs1.NotifyChange(ENotifyEntry,reqStat1,path1); |
1438 fs1.NotifyChange(ENotifyEntry,reqStat1,path1); |
1441 fs2.NotifyChange(ENotifyEntry,reqStat2,path2); |
1439 fs2.NotifyChange(ENotifyEntry,reqStat2,path2); |
1442 fs3.NotifyChange(ENotifyEntry,reqStat3,path3); |
1440 fs3.NotifyChange(ENotifyEntry,reqStat3,path3); |
1443 fs4.NotifyChange(ENotifyEntry,reqStat4,path4); |
1441 fs4.NotifyChange(ENotifyEntry,reqStat4,path4); |
1444 fs6.NotifyChange(ENotifyEntry,reqStat6,path6); |
1442 fs6.NotifyChange(ENotifyEntry,reqStat6,path6); |
1445 fs5.NotifyChange(ENotifyEntry,reqStat5,path5); |
1443 fs5.NotifyChange(ENotifyEntry,reqStat5,path5); |
1446 test(reqStat1==KRequestPending); |
1444 test_Value(reqStat1.Int(), reqStat1==KRequestPending); |
1447 test(reqStat2==KRequestPending); |
1445 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
1448 test(reqStat3==KRequestPending); |
1446 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
1449 test(reqStat4==KRequestPending); |
1447 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
1450 test(reqStat5==KRequestPending); |
1448 test_Value(reqStat5.Int(), reqStat5==KRequestPending); |
1451 test(reqStat6==KRequestPending); |
1449 test_Value(reqStat6.Int(), reqStat6==KRequestPending); |
1452 |
1450 |
1453 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\ANIMAL\\")); |
1451 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\ANIMAL\\")); |
1454 test_KErrNone(r); |
1452 test_KErrNone(r); |
1455 User::WaitForRequest(reqStat1); |
1453 User::WaitForRequest(reqStat1); |
1456 User::WaitForRequest(reqStat2); |
1454 User::WaitForRequest(reqStat2); |
1457 User::WaitForRequest(reqStat3); |
1455 User::WaitForRequest(reqStat3); |
1458 test(reqStat1==KErrNone); |
1456 test_KErrNone(reqStat1.Int()); |
1459 test(reqStat2==KErrNone); |
1457 test_KErrNone(reqStat2.Int()); |
1460 test(reqStat3==KErrNone); |
1458 test_KErrNone(reqStat3.Int()); |
1461 test(reqStat4==KRequestPending); |
1459 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
1462 test(reqStat5==KRequestPending); |
1460 test_Value(reqStat5.Int(), reqStat5==KRequestPending); |
1463 User::WaitForRequest(reqStat6); |
1461 User::WaitForRequest(reqStat6); |
1464 test(reqStat6==KErrNone); |
1462 test_KErrNone(reqStat6.Int()); |
1465 |
1463 |
1466 // Renew the notify request at the top and second levels on the third level |
1464 // Renew the notify request at the top and second levels on the third level |
1467 // which was removed - it'll succeed but won't complete. |
1465 // which was removed - it'll succeed but won't complete. |
1468 |
1466 |
1469 test.Next(_L("Test clients monitoring levels 1 and 2 are notified")); |
1467 test.Next(_L("Test clients monitoring levels 1 and 2 are notified")); |
1523 fs1.NotifyChange(ENotifyAll,status1,path); |
1521 fs1.NotifyChange(ENotifyAll,status1,path); |
1524 fs1.NotifyChange(ENotifyAll,status2,path); |
1522 fs1.NotifyChange(ENotifyAll,status2,path); |
1525 fs1.NotifyChange(ENotifyAll,status3,path); |
1523 fs1.NotifyChange(ENotifyAll,status3,path); |
1526 fs1.NotifyChange(ENotifyAll,status4,path); |
1524 fs1.NotifyChange(ENotifyAll,status4,path); |
1527 fs1.NotifyChange(ENotifyAll,status5,path); |
1525 fs1.NotifyChange(ENotifyAll,status5,path); |
1528 test(status1==KRequestPending); |
1526 test_Value(status1.Int(), status1==KRequestPending); |
1529 test(status2==KRequestPending); |
1527 test_Value(status2.Int(), status2==KRequestPending); |
1530 test(status3==KRequestPending); |
1528 test_Value(status3.Int(), status3==KRequestPending); |
1531 test(status4==KRequestPending); |
1529 test_Value(status4.Int(), status4==KRequestPending); |
1532 test(status5==KRequestPending); |
1530 test_Value(status5.Int(), status5==KRequestPending); |
1533 |
1531 |
1534 test.Next(_L("RFs::NotifyCancel()")); |
1532 test.Next(_L("RFs::NotifyCancel()")); |
1535 // Test that one call to RFs::NotifyCancel() cancels all outstanding requests |
1533 // Test that one call to RFs::NotifyCancel() cancels all outstanding requests |
1536 fs1.NotifyChangeCancel(); |
1534 fs1.NotifyChangeCancel(); |
1537 User::WaitForRequest(status1); |
1535 User::WaitForRequest(status1); |
1538 test(status1==KErrCancel); |
1536 test_Value(status1.Int(), status1==KErrCancel); |
1539 User::WaitForRequest(status2); |
1537 User::WaitForRequest(status2); |
1540 test(status2==KErrCancel); |
1538 test_Value(status2.Int(), status2==KErrCancel); |
1541 User::WaitForRequest(status3); |
1539 User::WaitForRequest(status3); |
1542 test(status3==KErrCancel); |
1540 test_Value(status3.Int(), status3==KErrCancel); |
1543 User::WaitForRequest(status4); |
1541 User::WaitForRequest(status4); |
1544 test(status4==KErrCancel); |
1542 test_Value(status4.Int(), status4==KErrCancel); |
1545 User::WaitForRequest(status5); |
1543 User::WaitForRequest(status5); |
1546 test(status5==KErrCancel); |
1544 test_Value(status5.Int(), status5==KErrCancel); |
1547 // Call the cancel function again to check no further action |
1545 // Call the cancel function again to check no further action |
1548 fs1.NotifyChangeCancel(); |
1546 fs1.NotifyChangeCancel(); |
1549 |
1547 |
1550 // Test overloaded function to cancel a single request |
1548 // Test overloaded function to cancel a single request |
1551 test.Next(_L("Cancel notification request using function overload")); |
1549 test.Next(_L("Cancel notification request using function overload")); |
1552 fs1.NotifyChange(ENotifyAll,status1,path); |
1550 fs1.NotifyChange(ENotifyAll,status1,path); |
1553 fs1.NotifyChange(ENotifyAll,status2,path); |
1551 fs1.NotifyChange(ENotifyAll,status2,path); |
1554 fs1.NotifyChange(ENotifyAll,status3,path); |
1552 fs1.NotifyChange(ENotifyAll,status3,path); |
1555 fs1.NotifyChange(ENotifyAll,status4,path); |
1553 fs1.NotifyChange(ENotifyAll,status4,path); |
1556 fs1.NotifyChange(ENotifyAll,status5,path); |
1554 fs1.NotifyChange(ENotifyAll,status5,path); |
1557 test(status1==KRequestPending); |
1555 test_Value(status1.Int(), status1==KRequestPending); |
1558 test(status2==KRequestPending); |
1556 test_Value(status2.Int(), status2==KRequestPending); |
1559 test(status3==KRequestPending); |
1557 test_Value(status3.Int(), status3==KRequestPending); |
1560 test(status4==KRequestPending); |
1558 test_Value(status4.Int(), status4==KRequestPending); |
1561 test(status5==KRequestPending); |
1559 test_Value(status5.Int(), status5==KRequestPending); |
1562 |
1560 |
1563 // Cancel the outstanding request with status5 |
1561 // Cancel the outstanding request with status5 |
1564 test.Next(_L("RFs::NotifyCancel()")); |
1562 test.Next(_L("RFs::NotifyCancel()")); |
1565 fs1.NotifyChangeCancel(status5); |
1563 fs1.NotifyChangeCancel(status5); |
1566 User::WaitForRequest(status5); |
1564 User::WaitForRequest(status5); |
1567 test(status1==KRequestPending); |
1565 test_Value(status1.Int(), status1==KRequestPending); |
1568 test(status2==KRequestPending); |
1566 test_Value(status2.Int(), status2==KRequestPending); |
1569 test(status3==KRequestPending); |
1567 test_Value(status3.Int(), status3==KRequestPending); |
1570 test(status4==KRequestPending); |
1568 test_Value(status4.Int(), status4==KRequestPending); |
1571 test(status5==KErrCancel); |
1569 test_Value(status5.Int(), status5==KErrCancel); |
1572 |
1570 |
1573 r=TheFs.MkDir(_L("\\F32-TST\\TROPICANA\\")); |
1571 r=TheFs.MkDir(_L("\\F32-TST\\TROPICANA\\")); |
1574 test_KErrNone(r); |
1572 test_KErrNone(r); |
1575 test(status1==KRequestPending); |
1573 test_Value(status1.Int(), status1==KRequestPending); |
1576 test(status2==KRequestPending); |
1574 test_Value(status2.Int(), status2==KRequestPending); |
1577 test(status3==KRequestPending); |
1575 test_Value(status3.Int(), status3==KRequestPending); |
1578 test(status4==KRequestPending); |
1576 test_Value(status4.Int(), status4==KRequestPending); |
1579 |
1577 |
1580 fs1.NotifyChangeCancel(status2); |
1578 fs1.NotifyChangeCancel(status2); |
1581 User::WaitForRequest(status2); |
1579 User::WaitForRequest(status2); |
1582 |
1580 |
1583 test(status1==KRequestPending); |
1581 test_Value(status1.Int(), status1==KRequestPending); |
1584 test(status2==KErrCancel); |
1582 test_Value(status2.Int(), status2==KErrCancel); |
1585 test(status3==KRequestPending); |
1583 test_Value(status3.Int(), status3==KRequestPending); |
1586 test(status4==KRequestPending); |
1584 test_Value(status4.Int(), status4==KRequestPending); |
1587 |
1585 |
1588 r=TheFs.RmDir(_L("\\F32-TST\\TROPICANA\\")); |
1586 r=TheFs.RmDir(_L("\\F32-TST\\TROPICANA\\")); |
1589 test_KErrNone(r); |
1587 test_KErrNone(r); |
1590 test(status1==KRequestPending); |
1588 test_Value(status1.Int(), status1==KRequestPending); |
1591 test(status3==KRequestPending); |
1589 test_Value(status3.Int(), status3==KRequestPending); |
1592 test(status4==KRequestPending); |
1590 test_Value(status4.Int(), status4==KRequestPending); |
1593 |
1591 |
1594 fs1.NotifyChangeCancel(status4); |
1592 fs1.NotifyChangeCancel(status4); |
1595 User::WaitForRequest(status4); |
1593 User::WaitForRequest(status4); |
1596 test(status1==KRequestPending); |
1594 test_Value(status1.Int(), status1==KRequestPending); |
1597 test(status3==KRequestPending); |
1595 test_Value(status3.Int(), status3==KRequestPending); |
1598 test(status4==KErrCancel); |
1596 test_Value(status4.Int(), status4==KErrCancel); |
1599 |
1597 |
1600 fs1.NotifyChangeCancel(status4); // Test no side effects on trying to cancel a request |
1598 fs1.NotifyChangeCancel(status4); // Test no side effects on trying to cancel a request |
1601 test(status4==KErrCancel); // that has already been cancelled |
1599 test_Value(status4.Int(), status4==KErrCancel); // that has already been cancelled |
1602 |
1600 |
1603 fs1.NotifyChangeCancel(status1); |
1601 fs1.NotifyChangeCancel(status1); |
1604 User::WaitForRequest(status1); |
1602 User::WaitForRequest(status1); |
1605 test(status1==KErrCancel); |
1603 test_Value(status1.Int(), status1==KErrCancel); |
1606 test(status3==KRequestPending); |
1604 test_Value(status3.Int(), status3==KRequestPending); |
1607 fs1.NotifyChangeCancel(status1); // Test no side effects on trying to cancel a request |
1605 fs1.NotifyChangeCancel(status1); // Test no side effects on trying to cancel a request |
1608 test(status1==KErrCancel); // that has already been cancelled |
1606 test_Value(status1.Int(), status1==KErrCancel); // that has already been cancelled |
1609 |
1607 |
1610 fs1.NotifyChangeCancel(status3); |
1608 fs1.NotifyChangeCancel(status3); |
1611 User::WaitForRequest(status3); |
1609 User::WaitForRequest(status3); |
1612 test(status3==KErrCancel); |
1610 test_Value(status3.Int(), status3==KErrCancel); |
1613 |
1611 |
1614 fs1.Close(); |
1612 fs1.Close(); |
1615 } |
1613 } |
1616 |
1614 |
1617 static void Test11() |
1615 static void Test11() |
1891 TRequestStatus reqStat(KRequestPending); |
1889 TRequestStatus reqStat(KRequestPending); |
1892 |
1890 |
1893 RFile file; |
1891 RFile file; |
1894 |
1892 |
1895 fs.NotifyChange(ENotifyAll,reqStat,path); |
1893 fs.NotifyChange(ENotifyAll,reqStat,path); |
1896 test(reqStat==KRequestPending); |
1894 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1897 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
1895 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
1898 test_KErrNone(r); |
1896 test_KErrNone(r); |
1899 User::WaitForRequest(reqStat); |
1897 User::WaitForRequest(reqStat); |
1900 test(reqStat==KErrNone); |
1898 test_KErrNone(reqStat.Int()); |
1901 fs.NotifyChange(ENotifyAll,reqStat,path); |
1899 fs.NotifyChange(ENotifyAll,reqStat,path); |
1902 test(reqStat==KRequestPending); |
1900 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1903 r=file.Write(0,_L8("Pay no attention to the man behind the curtain")); |
1901 r=file.Write(0,_L8("Pay no attention to the man behind the curtain")); |
1904 test_KErrNone(r); |
1902 test_KErrNone(r); |
1905 file.Close(); |
1903 file.Close(); |
1906 User::WaitForRequest(reqStat); |
1904 User::WaitForRequest(reqStat); |
1907 test(reqStat==KErrNone); |
1905 test_KErrNone(reqStat.Int()); |
1908 |
1906 |
1909 // RFile::Read() a file within the monitored directory - no notification for reads |
1907 // RFile::Read() a file within the monitored directory - no notification for reads |
1910 path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"); |
1908 path=_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"); |
1911 TBuf8<100> temp; |
1909 TBuf8<100> temp; |
1912 fs.NotifyChange(ENotifyAll,reqStat,path); |
1910 fs.NotifyChange(ENotifyAll,reqStat,path); |
1913 test(reqStat==KRequestPending); |
1911 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1914 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
1912 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
1915 test_KErrNone(r); |
1913 test_KErrNone(r); |
1916 test(reqStat==KRequestPending); |
1914 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1917 r=file.Read(0,temp,100); |
1915 r=file.Read(0,temp,100); |
1918 test(reqStat==KRequestPending); |
1916 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1919 |
1917 |
1920 // RFile::SetAtt() of a file within the monitored directory |
1918 // RFile::SetAtt() of a file within the monitored directory |
1921 test.Next(_L("RFile::SetAtt()")); |
1919 test.Next(_L("RFile::SetAtt()")); |
1922 r=file.SetAtt(KEntryAttSystem,KEntryAttNormal); |
1920 r=file.SetAtt(KEntryAttSystem,KEntryAttNormal); |
1923 test_KErrNone(r); |
1921 test_KErrNone(r); |
1924 User::WaitForRequest(reqStat); |
1922 User::WaitForRequest(reqStat); |
1925 test(reqStat==KErrNone); |
1923 test_KErrNone(reqStat.Int()); |
1926 fs.NotifyChange(ENotifyAll,reqStat,path); |
1924 fs.NotifyChange(ENotifyAll,reqStat,path); |
1927 test(reqStat==KRequestPending); |
1925 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1928 |
1926 |
1929 // RFile::SetSize() of a file within the monitored directory |
1927 // RFile::SetSize() of a file within the monitored directory |
1930 test.Next(_L("RFile::SetSize()")); |
1928 test.Next(_L("RFile::SetSize()")); |
1931 r=file.SetSize(256); |
1929 r=file.SetSize(256); |
1932 test_KErrNone(r); |
1930 test_KErrNone(r); |
1933 User::WaitForRequest(reqStat); |
1931 User::WaitForRequest(reqStat); |
1934 test(reqStat==KErrNone); |
1932 test_KErrNone(reqStat.Int()); |
1935 file.Close(); |
1933 file.Close(); |
1936 |
1934 |
1937 // RFile::Temp() to create a temp file within the monitored directory |
1935 // RFile::Temp() to create a temp file within the monitored directory |
1938 test.Next(_L("RFile::Temp()")); |
1936 test.Next(_L("RFile::Temp()")); |
1939 fs.NotifyChange(ENotifyAll,reqStat,path); |
1937 fs.NotifyChange(ENotifyAll,reqStat,path); |
1940 test(reqStat==KRequestPending); |
1938 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1941 TFileName fileName; |
1939 TFileName fileName; |
1942 r=file.Temp(TheFs,path,fileName,EFileWrite); |
1940 r=file.Temp(TheFs,path,fileName,EFileWrite); |
1943 test_KErrNone(r); |
1941 test_KErrNone(r); |
1944 User::WaitForRequest(reqStat); |
1942 User::WaitForRequest(reqStat); |
1945 test(reqStat==KErrNone); |
1943 test_KErrNone(reqStat.Int()); |
1946 file.Close(); |
1944 file.Close(); |
1947 |
1945 |
1948 // RFile::SetModified() to change modification time of a file within monitored dir |
1946 // RFile::SetModified() to change modification time of a file within monitored dir |
1949 test.Next(_L("RFile::SetModified()")); |
1947 test.Next(_L("RFile::SetModified()")); |
1950 fs.NotifyChange(ENotifyAll,reqStat,path); |
1948 fs.NotifyChange(ENotifyAll,reqStat,path); |
1951 test(reqStat==KRequestPending); |
1949 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1952 TTime now; |
1950 TTime now; |
1953 now.HomeTime(); |
1951 now.HomeTime(); |
1954 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
1952 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
1955 test_KErrNone(r); |
1953 test_KErrNone(r); |
1956 test(reqStat==KRequestPending); |
1954 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1957 file.SetModified(now); |
1955 file.SetModified(now); |
1958 file.Close(); |
1956 file.Close(); |
1959 User::WaitForRequest(reqStat); |
1957 User::WaitForRequest(reqStat); |
1960 test(reqStat==KErrNone); |
1958 test_KErrNone(reqStat.Int()); |
1961 |
1959 |
1962 // RFs::SetEntry() to change a directory entry within the monitored directory |
1960 // RFs::SetEntry() to change a directory entry within the monitored directory |
1963 test.Next(_L("RFs::SetEntry()")); |
1961 test.Next(_L("RFs::SetEntry()")); |
1964 TEntry entry; |
1962 TEntry entry; |
1965 fs.NotifyChange(ENotifyAll,reqStat,path); |
1963 fs.NotifyChange(ENotifyAll,reqStat,path); |
1966 r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry); |
1964 r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry); |
1967 test(reqStat==KRequestPending); |
1965 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1968 now.HomeTime(); |
1966 now.HomeTime(); |
1969 r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal); |
1967 r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal); |
1970 test_KErrNone(r); |
1968 test_KErrNone(r); |
1971 User::WaitForRequest(reqStat); |
1969 User::WaitForRequest(reqStat); |
1972 test(reqStat==KErrNone); |
1970 test_KErrNone(reqStat.Int()); |
1973 |
1971 |
1974 // RFile::Set() to change file's modification time and attributes |
1972 // RFile::Set() to change file's modification time and attributes |
1975 test.Next(_L("RFile::Set()")); |
1973 test.Next(_L("RFile::Set()")); |
1976 fs.NotifyChange(ENotifyAll,reqStat,path); |
1974 fs.NotifyChange(ENotifyAll,reqStat,path); |
1977 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
1975 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
1978 test_KErrNone(r); |
1976 test_KErrNone(r); |
1979 test(reqStat==KRequestPending); |
1977 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1980 now.HomeTime(); |
1978 now.HomeTime(); |
1981 r=file.Set(now,KEntryAttNormal,KEntryAttHidden); |
1979 r=file.Set(now,KEntryAttNormal,KEntryAttHidden); |
1982 file.Close(); |
1980 file.Close(); |
1983 User::WaitForRequest(reqStat); |
1981 User::WaitForRequest(reqStat); |
1984 test(reqStat==KErrNone); |
1982 test_KErrNone(reqStat.Int()); |
1985 |
1983 |
1986 // RFs::SetDriveName() |
1984 // RFs::SetDriveName() |
1987 test.Next(_L("RFs::SetDriveName()")); |
1985 test.Next(_L("RFs::SetDriveName()")); |
1988 fs.NotifyChange(ENotifyAll,reqStat,path); |
1986 fs.NotifyChange(ENotifyAll,reqStat,path); |
1989 test(reqStat==KRequestPending); |
1987 test_Value(reqStat.Int(), reqStat==KRequestPending); |
1990 User::After(KNotifyChangeAfter); |
1988 User::After(KNotifyChangeAfter); |
1991 r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST")); |
1989 r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST")); |
1992 test_KErrNone(r); |
1990 test_KErrNone(r); |
1993 User::WaitForRequest(reqStat); |
1991 User::WaitForRequest(reqStat); |
1994 test(reqStat==KErrNone); |
1992 test_KErrNone(reqStat.Int()); |
1995 fs.NotifyChange(ENotifyEntry,reqStat,path); |
1993 fs.NotifyChange(ENotifyEntry,reqStat,path); |
1996 User::After(KNotifyChangeAfter); |
1994 User::After(KNotifyChangeAfter); |
1997 r=TheFs.SetDriveName(KDefaultDrive,_L("TEST")); |
1995 r=TheFs.SetDriveName(KDefaultDrive,_L("TEST")); |
1998 test_KErrNone(r); |
1996 test_KErrNone(r); |
1999 test(reqStat==KRequestPending); |
1997 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2000 fs.NotifyChangeCancel(reqStat); |
1998 fs.NotifyChangeCancel(reqStat); |
2001 User::WaitForRequest(reqStat); |
1999 User::WaitForRequest(reqStat); |
2002 test(reqStat==KErrCancel); |
2000 test_Value(reqStat.Int(), reqStat==KErrCancel); |
2003 fs.NotifyChange(ENotifyDisk,reqStat,path); |
2001 fs.NotifyChange(ENotifyDisk,reqStat,path); |
2004 User::After(KNotifyChangeAfter); |
2002 User::After(KNotifyChangeAfter); |
2005 r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE")); |
2003 r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE")); |
2006 test_KErrNone(r); |
2004 test_KErrNone(r); |
2007 test(reqStat==KRequestPending); |
2005 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2008 fs.NotifyChangeCancel(reqStat); |
2006 fs.NotifyChangeCancel(reqStat); |
2009 User::WaitForRequest(reqStat); |
2007 User::WaitForRequest(reqStat); |
2010 test(reqStat==KErrCancel); |
2008 test_Value(reqStat.Int(), reqStat==KErrCancel); |
2011 |
2009 |
2012 |
2010 |
2013 // RFs::MkDir() |
2011 // RFs::MkDir() |
2014 fs.NotifyChange(ENotifyAll,reqStat,path); |
2012 fs.NotifyChange(ENotifyAll,reqStat,path); |
2015 test(reqStat==KRequestPending); |
2013 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2016 test.Next(_L("RFs::MkDir()")); |
2014 test.Next(_L("RFs::MkDir()")); |
2017 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\")); |
2015 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\")); |
2018 test_KErrNone(r); |
2016 test_KErrNone(r); |
2019 User::WaitForRequest(reqStat); |
2017 User::WaitForRequest(reqStat); |
2020 test(reqStat==KErrNone); |
2018 test_KErrNone(reqStat.Int()); |
2021 |
2019 |
2022 // RFs::RmDir() |
2020 // RFs::RmDir() |
2023 test.Next(_L("RFs::RmDir()")); |
2021 test.Next(_L("RFs::RmDir()")); |
2024 fs.NotifyChange(ENotifyAll,reqStat,path); |
2022 fs.NotifyChange(ENotifyAll,reqStat,path); |
2025 test(reqStat==KRequestPending); |
2023 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2026 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\")); |
2024 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\")); |
2027 test_KErrNone(r); |
2025 test_KErrNone(r); |
2028 User::WaitForRequest(reqStat); |
2026 User::WaitForRequest(reqStat); |
2029 test(reqStat==KErrNone); |
2027 test_KErrNone(reqStat.Int()); |
2030 |
2028 |
2031 // RFile::Create() |
2029 // RFile::Create() |
2032 test.Next(_L("RFile::Create()")); |
2030 test.Next(_L("RFile::Create()")); |
2033 fs.NotifyChange(ENotifyAll,reqStat,path); |
2031 fs.NotifyChange(ENotifyAll,reqStat,path); |
2034 test(reqStat==KRequestPending); |
2032 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2035 r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite); |
2033 r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite); |
2036 test_KErrNone(r); |
2034 test_KErrNone(r); |
2037 User::WaitForRequest(reqStat); |
2035 User::WaitForRequest(reqStat); |
2038 test(reqStat==KErrNone); |
2036 test_KErrNone(reqStat.Int()); |
2039 file.Close(); |
2037 file.Close(); |
2040 |
2038 |
2041 // RFs::Delete() |
2039 // RFs::Delete() |
2042 test.Next(_L("RFs::Delete()")); |
2040 test.Next(_L("RFs::Delete()")); |
2043 fs.NotifyChange(ENotifyAll,reqStat,path); |
2041 fs.NotifyChange(ENotifyAll,reqStat,path); |
2044 test(reqStat==KRequestPending); |
2042 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2045 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat")); |
2043 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat")); |
2046 test_KErrNone(r); |
2044 test_KErrNone(r); |
2047 User::WaitForRequest(reqStat); |
2045 User::WaitForRequest(reqStat); |
2048 test(reqStat==KErrNone); |
2046 test_KErrNone(reqStat.Int()); |
2049 |
2047 |
2050 // RFile::Replace() |
2048 // RFile::Replace() |
2051 test.Next(_L("RFile::Replace()")); |
2049 test.Next(_L("RFile::Replace()")); |
2052 fs.NotifyChange(ENotifyAll,reqStat,path); |
2050 fs.NotifyChange(ENotifyAll,reqStat,path); |
2053 test(reqStat==KRequestPending); |
2051 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2054 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite); |
2052 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite); |
2055 test_KErrNone(r); |
2053 test_KErrNone(r); |
2056 User::WaitForRequest(reqStat); |
2054 User::WaitForRequest(reqStat); |
2057 test(reqStat==KErrNone); |
2055 test_KErrNone(reqStat.Int()); |
2058 file.Close(); |
2056 file.Close(); |
2059 |
2057 |
2060 // RFs::Delete() |
2058 // RFs::Delete() |
2061 test.Next(_L("RFs::Delete()")); |
2059 test.Next(_L("RFs::Delete()")); |
2062 fs.NotifyChange(ENotifyAll,reqStat,path); |
2060 fs.NotifyChange(ENotifyAll,reqStat,path); |
2063 test(reqStat==KRequestPending); |
2061 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2064 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat")); |
2062 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat")); |
2065 test_KErrNone(r); |
2063 test_KErrNone(r); |
2066 User::WaitForRequest(reqStat); |
2064 User::WaitForRequest(reqStat); |
2067 test(reqStat==KErrNone); |
2065 test_KErrNone(reqStat.Int()); |
2068 |
2066 |
2069 // RFs::SetVolumeLabel() - should only be notification when monitoring relevant TNotifyTypes |
2067 // RFs::SetVolumeLabel() - should only be notification when monitoring relevant TNotifyTypes |
2070 test.Next(_L("RFs::SetVolumeLabel")); |
2068 test.Next(_L("RFs::SetVolumeLabel")); |
2071 fs.NotifyChange(ENotifyAll,reqStat,path); |
2069 fs.NotifyChange(ENotifyAll,reqStat,path); |
2072 |
2070 |
2187 fs.NotifyChange(ENotifyAll,reqStat,path); |
2183 fs.NotifyChange(ENotifyAll,reqStat,path); |
2188 |
2184 |
2189 RFile file; |
2185 RFile file; |
2190 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2186 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2191 test_KErrNone(r); |
2187 test_KErrNone(r); |
2192 test(reqStat==KRequestPending); |
2188 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2193 r=file.Write(0,_L8("Pay no attention to the man behind the curtain")); |
2189 r=file.Write(0,_L8("Pay no attention to the man behind the curtain")); |
2194 file.Close(); |
2190 file.Close(); |
2195 User::WaitForRequest(reqStat); |
2191 User::WaitForRequest(reqStat); |
2196 test(reqStat==KErrNone); |
2192 test_KErrNone(reqStat.Int()); |
2197 |
2193 |
2198 // RFile::Read() a file within the monitored directory - no notification for reads |
2194 // RFile::Read() a file within the monitored directory - no notification for reads |
2199 fs.NotifyChange(ENotifyAll,reqStat,path); |
2195 fs.NotifyChange(ENotifyAll,reqStat,path); |
2200 TBuf8<100> temp; |
2196 TBuf8<100> temp; |
2201 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2197 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2202 test_KErrNone(r); |
2198 test_KErrNone(r); |
2203 test(reqStat==KRequestPending); |
2199 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2204 r=file.Read(0,temp,100); |
2200 r=file.Read(0,temp,100); |
2205 test(reqStat==KRequestPending); |
2201 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2206 |
2202 |
2207 // RFile::SetAtt() of a file within the monitored directory |
2203 // RFile::SetAtt() of a file within the monitored directory |
2208 test.Next(_L("RFile::SetAtt()")); |
2204 test.Next(_L("RFile::SetAtt()")); |
2209 r=file.SetAtt(KEntryAttNormal,KEntryAttHidden); |
2205 r=file.SetAtt(KEntryAttNormal,KEntryAttHidden); |
2210 test_KErrNone(r); |
2206 test_KErrNone(r); |
2211 User::WaitForRequest(reqStat); |
2207 User::WaitForRequest(reqStat); |
2212 test(reqStat==KErrNone); |
2208 test_KErrNone(reqStat.Int()); |
2213 |
2209 |
2214 // RFile::SetSize() of a file within the monitored directory |
2210 // RFile::SetSize() of a file within the monitored directory |
2215 test.Next(_L("RFile::SetSize()")); |
2211 test.Next(_L("RFile::SetSize()")); |
2216 fs.NotifyChange(ENotifyAll,reqStat,path); |
2212 fs.NotifyChange(ENotifyAll,reqStat,path); |
2217 test(reqStat==KRequestPending); |
2213 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2218 r=file.SetSize(256); |
2214 r=file.SetSize(256); |
2219 test_KErrNone(r); |
2215 test_KErrNone(r); |
2220 User::WaitForRequest(reqStat); |
2216 User::WaitForRequest(reqStat); |
2221 test(reqStat==KErrNone); |
2217 test_KErrNone(reqStat.Int()); |
2222 file.Close(); |
2218 file.Close(); |
2223 |
2219 |
2224 // RFile::Temp() to create a temp file in the subtree |
2220 // RFile::Temp() to create a temp file in the subtree |
2225 test.Next(_L("RFile::Temp()")); |
2221 test.Next(_L("RFile::Temp()")); |
2226 fs.NotifyChange(ENotifyAll,reqStat,path); |
2222 fs.NotifyChange(ENotifyAll,reqStat,path); |
2227 test(reqStat==KRequestPending); |
2223 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2228 TFileName fileName; |
2224 TFileName fileName; |
2229 r=file.Temp(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"),fileName,EFileWrite); |
2225 r=file.Temp(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\"),fileName,EFileWrite); |
2230 test_KErrNone(r); |
2226 test_KErrNone(r); |
2231 User::WaitForRequest(reqStat); |
2227 User::WaitForRequest(reqStat); |
2232 test(reqStat==KErrNone); |
2228 test_KErrNone(reqStat.Int()); |
2233 file.Close(); |
2229 file.Close(); |
2234 |
2230 |
2235 // RFile::SetModified() to change modification time of a file within monitored dir |
2231 // RFile::SetModified() to change modification time of a file within monitored dir |
2236 test.Next(_L("RFile::SetModified()")); |
2232 test.Next(_L("RFile::SetModified()")); |
2237 fs.NotifyChange(ENotifyAll,reqStat,path); |
2233 fs.NotifyChange(ENotifyAll,reqStat,path); |
2238 TTime now; |
2234 TTime now; |
2239 now.HomeTime(); |
2235 now.HomeTime(); |
2240 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2236 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2241 test_KErrNone(r); |
2237 test_KErrNone(r); |
2242 test(reqStat==KRequestPending); |
2238 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2243 file.SetModified(now); |
2239 file.SetModified(now); |
2244 file.Close(); |
2240 file.Close(); |
2245 User::WaitForRequest(reqStat); |
2241 User::WaitForRequest(reqStat); |
2246 test(reqStat==KErrNone); |
2242 test_KErrNone(reqStat.Int()); |
2247 |
2243 |
2248 // RFs::Entry() to change a directory entry within the monitored directory |
2244 // RFs::Entry() to change a directory entry within the monitored directory |
2249 test.Next(_L("RFs::Entry()")); |
2245 test.Next(_L("RFs::Entry()")); |
2250 fs.NotifyChange(ENotifyAll,reqStat,path); |
2246 fs.NotifyChange(ENotifyAll,reqStat,path); |
2251 TEntry entry; |
2247 TEntry entry; |
2252 r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry); |
2248 r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry); |
2253 test(reqStat==KRequestPending); |
2249 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2254 now.HomeTime(); |
2250 now.HomeTime(); |
2255 r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal); |
2251 r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal); |
2256 test_KErrNone(r); |
2252 test_KErrNone(r); |
2257 User::WaitForRequest(reqStat); |
2253 User::WaitForRequest(reqStat); |
2258 test(reqStat==KErrNone); |
2254 test_KErrNone(reqStat.Int()); |
2259 |
2255 |
2260 // RFile::Set() to change file's modification time and attributes |
2256 // RFile::Set() to change file's modification time and attributes |
2261 test.Next(_L("RFile::Set()")); |
2257 test.Next(_L("RFile::Set()")); |
2262 fs.NotifyChange(ENotifyAll,reqStat,path); |
2258 fs.NotifyChange(ENotifyAll,reqStat,path); |
2263 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2259 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2264 test_KErrNone(r); |
2260 test_KErrNone(r); |
2265 test(reqStat==KRequestPending); |
2261 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2266 now.HomeTime(); |
2262 now.HomeTime(); |
2267 r=file.Set(now,KEntryAttNormal,KEntryAttHidden); |
2263 r=file.Set(now,KEntryAttNormal,KEntryAttHidden); |
2268 file.Close(); |
2264 file.Close(); |
2269 User::WaitForRequest(reqStat); |
2265 User::WaitForRequest(reqStat); |
2270 test(reqStat==KErrNone); |
2266 test_KErrNone(reqStat.Int()); |
2271 |
2267 |
2272 // RFs::SetDriveName() |
2268 // RFs::SetDriveName() |
2273 test.Next(_L("RFs::SetDriveName()")); |
2269 test.Next(_L("RFs::SetDriveName()")); |
2274 fs.NotifyChange(ENotifyAll,reqStat,path); |
2270 fs.NotifyChange(ENotifyAll,reqStat,path); |
2275 test(reqStat==KRequestPending); |
2271 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2276 User::After(KNotifyChangeAfter); |
2272 User::After(KNotifyChangeAfter); |
2277 r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST")); |
2273 r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST")); |
2278 test_KErrNone(r); |
2274 test_KErrNone(r); |
2279 User::WaitForRequest(reqStat); |
2275 User::WaitForRequest(reqStat); |
2280 test(reqStat==KErrNone); |
2276 test_KErrNone(reqStat.Int()); |
2281 fs.NotifyChange(ENotifyEntry,reqStat,path); |
2277 fs.NotifyChange(ENotifyEntry,reqStat,path); |
2282 r=TheFs.SetDriveName(KDefaultDrive,_L("TEST")); |
2278 r=TheFs.SetDriveName(KDefaultDrive,_L("TEST")); |
2283 test_KErrNone(r); |
2279 test_KErrNone(r); |
2284 test(reqStat==KRequestPending); |
2280 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2285 User::After(KNotifyChangeAfter); |
2281 User::After(KNotifyChangeAfter); |
2286 fs.NotifyChangeCancel(reqStat); |
2282 fs.NotifyChangeCancel(reqStat); |
2287 User::WaitForRequest(reqStat); |
2283 User::WaitForRequest(reqStat); |
2288 test(reqStat==KErrCancel); |
2284 test_Value(reqStat.Int(), reqStat==KErrCancel); |
2289 fs.NotifyChange(ENotifyDisk,reqStat,path); |
2285 fs.NotifyChange(ENotifyDisk,reqStat,path); |
2290 User::After(KNotifyChangeAfter); |
2286 User::After(KNotifyChangeAfter); |
2291 r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE")); |
2287 r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE")); |
2292 test_KErrNone(r); |
2288 test_KErrNone(r); |
2293 test(reqStat==KRequestPending); |
2289 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2294 fs.NotifyChangeCancel(reqStat); |
2290 fs.NotifyChangeCancel(reqStat); |
2295 User::WaitForRequest(reqStat); |
2291 User::WaitForRequest(reqStat); |
2296 test(reqStat==KErrCancel); |
2292 test_Value(reqStat.Int(), reqStat==KErrCancel); |
2297 |
2293 |
2298 // RFs::MkDir() |
2294 // RFs::MkDir() |
2299 test.Next(_L("RFs::MkDir()")); |
2295 test.Next(_L("RFs::MkDir()")); |
2300 fs.NotifyChange(ENotifyAll,reqStat,path); |
2296 fs.NotifyChange(ENotifyAll,reqStat,path); |
2301 test(reqStat==KRequestPending); |
2297 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2302 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\")); |
2298 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\")); |
2303 test_KErrNone(r); |
2299 test_KErrNone(r); |
2304 User::WaitForRequest(reqStat); |
2300 User::WaitForRequest(reqStat); |
2305 test(reqStat==KErrNone); |
2301 test_KErrNone(reqStat.Int()); |
2306 |
2302 |
2307 // RFs::RmDir() |
2303 // RFs::RmDir() |
2308 test.Next(_L("RFs::RmDir()")); |
2304 test.Next(_L("RFs::RmDir()")); |
2309 fs.NotifyChange(ENotifyAll,reqStat,path); |
2305 fs.NotifyChange(ENotifyAll,reqStat,path); |
2310 test(reqStat==KRequestPending); |
2306 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2311 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\")); |
2307 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\")); |
2312 test_KErrNone(r); |
2308 test_KErrNone(r); |
2313 User::WaitForRequest(reqStat); |
2309 User::WaitForRequest(reqStat); |
2314 test(reqStat==KErrNone); |
2310 test_KErrNone(reqStat.Int()); |
2315 |
2311 |
2316 // RFile::Create() |
2312 // RFile::Create() |
2317 test.Next(_L("RFile::Create()")); |
2313 test.Next(_L("RFile::Create()")); |
2318 fs.NotifyChange(ENotifyAll,reqStat,path); |
2314 fs.NotifyChange(ENotifyAll,reqStat,path); |
2319 test(reqStat==KRequestPending); |
2315 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2320 r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite); |
2316 r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite); |
2321 test_KErrNone(r); |
2317 test_KErrNone(r); |
2322 User::WaitForRequest(reqStat); |
2318 User::WaitForRequest(reqStat); |
2323 test(reqStat==KErrNone); |
2319 test_KErrNone(reqStat.Int()); |
2324 file.Close(); |
2320 file.Close(); |
2325 |
2321 |
2326 // RFs::Delete() |
2322 // RFs::Delete() |
2327 test.Next(_L("RFs::Delete()")); |
2323 test.Next(_L("RFs::Delete()")); |
2328 fs.NotifyChange(ENotifyAll,reqStat,path); |
2324 fs.NotifyChange(ENotifyAll,reqStat,path); |
2329 test(reqStat==KRequestPending); |
2325 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2330 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat")); |
2326 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat")); |
2331 test_KErrNone(r); |
2327 test_KErrNone(r); |
2332 User::WaitForRequest(reqStat); |
2328 User::WaitForRequest(reqStat); |
2333 test(reqStat==KErrNone); |
2329 test_KErrNone(reqStat.Int()); |
2334 |
2330 |
2335 // RFile::Replace() |
2331 // RFile::Replace() |
2336 test.Next(_L("RFile::Replace()")); |
2332 test.Next(_L("RFile::Replace()")); |
2337 fs.NotifyChange(ENotifyAll,reqStat,path); |
2333 fs.NotifyChange(ENotifyAll,reqStat,path); |
2338 test(reqStat==KRequestPending); |
2334 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2339 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite); |
2335 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite); |
2340 test_KErrNone(r); |
2336 test_KErrNone(r); |
2341 User::WaitForRequest(reqStat); |
2337 User::WaitForRequest(reqStat); |
2342 test(reqStat==KErrNone); |
2338 test_KErrNone(reqStat.Int()); |
2343 file.Close(); |
2339 file.Close(); |
2344 |
2340 |
2345 // RFs::Delete() |
2341 // RFs::Delete() |
2346 test.Next(_L("RFs::Delete()")); |
2342 test.Next(_L("RFs::Delete()")); |
2347 fs.NotifyChange(ENotifyAll,reqStat,path); |
2343 fs.NotifyChange(ENotifyAll,reqStat,path); |
2348 test(reqStat==KRequestPending); |
2344 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2349 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat")); |
2345 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat")); |
2350 test_KErrNone(r); |
2346 test_KErrNone(r); |
2351 User::WaitForRequest(reqStat); |
2347 User::WaitForRequest(reqStat); |
2352 test(reqStat==KErrNone); |
2348 test_KErrNone(reqStat.Int()); |
2353 |
2349 |
2354 // RFs::SetVolumeLabel() - should be notification under relevant TNotifyType monitoring |
2350 // RFs::SetVolumeLabel() - should be notification under relevant TNotifyType monitoring |
2355 // The operation is non-path specific so all outstanding interested requests are notified |
2351 // The operation is non-path specific so all outstanding interested requests are notified |
2356 test.Next(_L("RFs::SetVolumeLabel()")); |
2352 test.Next(_L("RFs::SetVolumeLabel()")); |
2357 |
2353 |
2456 fs.NotifyChange(ENotifyAll,reqStat,path); |
2452 fs.NotifyChange(ENotifyAll,reqStat,path); |
2457 |
2453 |
2458 RFile file; |
2454 RFile file; |
2459 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2455 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2460 test_KErrNone(r); |
2456 test_KErrNone(r); |
2461 test(reqStat==KRequestPending); |
2457 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2462 r=file.Write(0,_L8("Pay no attention to the man behind the curtain")); |
2458 r=file.Write(0,_L8("Pay no attention to the man behind the curtain")); |
2463 file.Close(); |
2459 file.Close(); |
2464 User::WaitForRequest(reqStat); |
2460 User::WaitForRequest(reqStat); |
2465 test(reqStat==KErrNone); |
2461 test_KErrNone(reqStat.Int()); |
2466 |
2462 |
2467 // RFile::Read() a file within the monitored directory - no notification for reads |
2463 // RFile::Read() a file within the monitored directory - no notification for reads |
2468 fs.NotifyChange(ENotifyAll,reqStat,path); |
2464 fs.NotifyChange(ENotifyAll,reqStat,path); |
2469 TBuf8<100> temp; |
2465 TBuf8<100> temp; |
2470 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2466 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2471 test_KErrNone(r); |
2467 test_KErrNone(r); |
2472 test(reqStat==KRequestPending); |
2468 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2473 r=file.Read(0,temp,100); |
2469 r=file.Read(0,temp,100); |
2474 test(reqStat==KRequestPending); |
2470 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2475 |
2471 |
2476 // RFile::SetAtt() of a file within the monitored directory |
2472 // RFile::SetAtt() of a file within the monitored directory |
2477 r=file.SetAtt(KEntryAttNormal,KEntryAttHidden); |
2473 r=file.SetAtt(KEntryAttNormal,KEntryAttHidden); |
2478 test_KErrNone(r); |
2474 test_KErrNone(r); |
2479 User::WaitForRequest(reqStat); |
2475 User::WaitForRequest(reqStat); |
2480 test(reqStat==KErrNone); |
2476 test_KErrNone(reqStat.Int()); |
2481 |
2477 |
2482 // RFile::SetSize() of a file within the monitored directory |
2478 // RFile::SetSize() of a file within the monitored directory |
2483 fs.NotifyChange(ENotifyAll,reqStat,path); |
2479 fs.NotifyChange(ENotifyAll,reqStat,path); |
2484 test(reqStat==KRequestPending); |
2480 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2485 r=file.SetSize(256); |
2481 r=file.SetSize(256); |
2486 test_KErrNone(r); |
2482 test_KErrNone(r); |
2487 User::WaitForRequest(reqStat); |
2483 User::WaitForRequest(reqStat); |
2488 test(reqStat==KErrNone); |
2484 test_KErrNone(reqStat.Int()); |
2489 file.Close(); |
2485 file.Close(); |
2490 |
2486 |
2491 |
2487 |
2492 // RFile::SetModified() to change modification time of a file within monitored dir |
2488 // RFile::SetModified() to change modification time of a file within monitored dir |
2493 fs.NotifyChange(ENotifyAll,reqStat,path); |
2489 fs.NotifyChange(ENotifyAll,reqStat,path); |
2494 TTime now; |
2490 TTime now; |
2495 now.HomeTime(); |
2491 now.HomeTime(); |
2496 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2492 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2497 test_KErrNone(r); |
2493 test_KErrNone(r); |
2498 test(reqStat==KRequestPending); |
2494 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2499 file.SetModified(now); |
2495 file.SetModified(now); |
2500 file.Close(); |
2496 file.Close(); |
2501 User::WaitForRequest(reqStat); |
2497 User::WaitForRequest(reqStat); |
2502 test(reqStat==KErrNone); |
2498 test_KErrNone(reqStat.Int()); |
2503 |
2499 |
2504 // RFs::Entry() to change a directory entry within the monitored directory |
2500 // RFs::Entry() to change a directory entry within the monitored directory |
2505 fs.NotifyChange(ENotifyAll,reqStat,path); |
2501 fs.NotifyChange(ENotifyAll,reqStat,path); |
2506 TEntry entry; |
2502 TEntry entry; |
2507 r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry); |
2503 r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),entry); |
2508 test(reqStat==KRequestPending); |
2504 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2509 now.HomeTime(); |
2505 now.HomeTime(); |
2510 r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal); |
2506 r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),now,KEntryAttHidden,KEntryAttNormal); |
2511 test_KErrNone(r); |
2507 test_KErrNone(r); |
2512 User::WaitForRequest(reqStat); |
2508 User::WaitForRequest(reqStat); |
2513 test(reqStat==KErrNone); |
2509 test_KErrNone(reqStat.Int()); |
2514 |
2510 |
2515 // RFile::Set() to change file's modification time and attributes |
2511 // RFile::Set() to change file's modification time and attributes |
2516 fs.NotifyChange(ENotifyAll,reqStat,path); |
2512 fs.NotifyChange(ENotifyAll,reqStat,path); |
2517 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2513 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Dorothy.doc"),EFileRead|EFileWrite); |
2518 test_KErrNone(r); |
2514 test_KErrNone(r); |
2519 test(reqStat==KRequestPending); |
2515 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2520 now.HomeTime(); |
2516 now.HomeTime(); |
2521 r=file.Set(now,KEntryAttNormal,KEntryAttHidden); |
2517 r=file.Set(now,KEntryAttNormal,KEntryAttHidden); |
2522 file.Close(); |
2518 file.Close(); |
2523 User::WaitForRequest(reqStat); |
2519 User::WaitForRequest(reqStat); |
2524 test(reqStat==KErrNone); |
2520 test_KErrNone(reqStat.Int()); |
2525 |
2521 |
2526 // RFs::SetDriveName() - should be no notification ever with extended notification |
2522 // RFs::SetDriveName() - should be no notification ever with extended notification |
2527 fs.NotifyChange(ENotifyAll,reqStat,path); |
2523 fs.NotifyChange(ENotifyAll,reqStat,path); |
2528 test(reqStat==KRequestPending); |
2524 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2529 User::After(KNotifyChangeAfter); |
2525 User::After(KNotifyChangeAfter); |
2530 r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST")); |
2526 r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST")); |
2531 test_KErrNone(r); |
2527 test_KErrNone(r); |
2532 User::WaitForRequest(reqStat); |
2528 User::WaitForRequest(reqStat); |
2533 test(reqStat==KErrNone); |
2529 test_KErrNone(reqStat.Int()); |
2534 fs.NotifyChange(ENotifyEntry,reqStat,path); |
2530 fs.NotifyChange(ENotifyEntry,reqStat,path); |
2535 User::After(KNotifyChangeAfter); |
2531 User::After(KNotifyChangeAfter); |
2536 r=TheFs.SetDriveName(KDefaultDrive,_L("TEST")); |
2532 r=TheFs.SetDriveName(KDefaultDrive,_L("TEST")); |
2537 test_KErrNone(r); |
2533 test_KErrNone(r); |
2538 test(reqStat==KRequestPending); |
2534 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2539 fs.NotifyChangeCancel(reqStat); |
2535 fs.NotifyChangeCancel(reqStat); |
2540 User::WaitForRequest(reqStat); |
2536 User::WaitForRequest(reqStat); |
2541 fs.NotifyChange(ENotifyDisk,reqStat,path); |
2537 fs.NotifyChange(ENotifyDisk,reqStat,path); |
2542 User::After(KNotifyChangeAfter); |
2538 User::After(KNotifyChangeAfter); |
2543 r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE")); |
2539 r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVE")); |
2544 test_KErrNone(r); |
2540 test_KErrNone(r); |
2545 test(reqStat==KRequestPending); |
2541 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2546 fs.NotifyChangeCancel(reqStat); |
2542 fs.NotifyChangeCancel(reqStat); |
2547 User::WaitForRequest(reqStat); |
2543 User::WaitForRequest(reqStat); |
2548 test(reqStat==KErrCancel); |
2544 test_Value(reqStat.Int(), reqStat==KErrCancel); |
2549 |
2545 |
2550 |
2546 |
2551 // RFs::MkDir() |
2547 // RFs::MkDir() |
2552 fs.NotifyChange(ENotifyAll,reqStat,path); |
2548 fs.NotifyChange(ENotifyAll,reqStat,path); |
2553 test(reqStat==KRequestPending); |
2549 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2554 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\")); |
2550 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\")); |
2555 test_KErrNone(r); |
2551 test_KErrNone(r); |
2556 User::WaitForRequest(reqStat); |
2552 User::WaitForRequest(reqStat); |
2557 test(reqStat==KErrNone); |
2553 test_KErrNone(reqStat.Int()); |
2558 |
2554 |
2559 // RFs::RmDir() |
2555 // RFs::RmDir() |
2560 fs.NotifyChange(ENotifyAll,reqStat,path); |
2556 fs.NotifyChange(ENotifyAll,reqStat,path); |
2561 test(reqStat==KRequestPending); |
2557 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2562 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\")); |
2558 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\EMERALD_CITY\\")); |
2563 test_KErrNone(r); |
2559 test_KErrNone(r); |
2564 User::WaitForRequest(reqStat); |
2560 User::WaitForRequest(reqStat); |
2565 test(reqStat==KErrNone); |
2561 test_KErrNone(reqStat.Int()); |
2566 |
2562 |
2567 // RFile::Create() |
2563 // RFile::Create() |
2568 fs.NotifyChange(ENotifyAll,reqStat,path); |
2564 fs.NotifyChange(ENotifyAll,reqStat,path); |
2569 test(reqStat==KRequestPending); |
2565 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2570 r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite); |
2566 r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite); |
2571 test_KErrNone(r); |
2567 test_KErrNone(r); |
2572 User::WaitForRequest(reqStat); |
2568 User::WaitForRequest(reqStat); |
2573 test(reqStat==KErrNone); |
2569 test_KErrNone(reqStat.Int()); |
2574 file.Close(); |
2570 file.Close(); |
2575 |
2571 |
2576 // RFs::Delete() |
2572 // RFs::Delete() |
2577 fs.NotifyChange(ENotifyAll,reqStat,path); |
2573 fs.NotifyChange(ENotifyAll,reqStat,path); |
2578 test(reqStat==KRequestPending); |
2574 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2579 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat")); |
2575 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat")); |
2580 test_KErrNone(r); |
2576 test_KErrNone(r); |
2581 User::WaitForRequest(reqStat); |
2577 User::WaitForRequest(reqStat); |
2582 test(reqStat==KErrNone); |
2578 test_KErrNone(reqStat.Int()); |
2583 |
2579 |
2584 // RFile::Replace() |
2580 // RFile::Replace() |
2585 fs.NotifyChange(ENotifyAll,reqStat,path); |
2581 fs.NotifyChange(ENotifyAll,reqStat,path); |
2586 test(reqStat==KRequestPending); |
2582 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2587 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite); |
2583 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat"),EFileRead|EFileWrite); |
2588 test_KErrNone(r); |
2584 test_KErrNone(r); |
2589 User::WaitForRequest(reqStat); |
2585 User::WaitForRequest(reqStat); |
2590 test(reqStat==KErrNone); |
2586 test_KErrNone(reqStat.Int()); |
2591 file.Close(); |
2587 file.Close(); |
2592 |
2588 |
2593 // RFs::Delete() |
2589 // RFs::Delete() |
2594 fs.NotifyChange(ENotifyAll,reqStat,path); |
2590 fs.NotifyChange(ENotifyAll,reqStat,path); |
2595 test(reqStat==KRequestPending); |
2591 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2596 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat")); |
2592 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\MUNCHKINS\\Good_Witch.bat")); |
2597 test_KErrNone(r); |
2593 test_KErrNone(r); |
2598 User::WaitForRequest(reqStat); |
2594 User::WaitForRequest(reqStat); |
2599 test(reqStat==KErrNone); |
2595 test_KErrNone(reqStat.Int()); |
2600 |
2596 |
2601 // RFs::SetVolumeLabel() |
2597 // RFs::SetVolumeLabel() |
2602 // Not path specific, so all outstanding requests of correct TNotifyType are notified |
2598 // Not path specific, so all outstanding requests of correct TNotifyType are notified |
2603 fs.NotifyChange(ENotifyAll,reqStat,path); |
2599 fs.NotifyChange(ENotifyAll,reqStat,path); |
2604 TInt driveNum=CurrentDrive(); |
2600 TInt driveNum=CurrentDrive(); |
2605 TVolumeInfo volInfo; |
2601 TVolumeInfo volInfo; |
2606 TFileName currentVolName; |
2602 TFileName currentVolName; |
2607 r=TheFs.Volume(volInfo,driveNum); |
2603 r=TheFs.Volume(volInfo,driveNum); |
2608 test_KErrNone(r); |
2604 test_KErrNone(r); |
2609 test(reqStat==KRequestPending); |
2605 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2610 currentVolName=volInfo.iName; |
2606 currentVolName=volInfo.iName; |
2611 |
2607 |
2612 r=TheFs.SetVolumeLabel(_L("VOL"),driveNum); |
2608 r=TheFs.SetVolumeLabel(_L("VOL"),driveNum); |
2613 if (r==KErrNone) |
2609 if (r==KErrNone) |
2614 { |
2610 { |
2615 User::WaitForRequest(reqStat); |
2611 User::WaitForRequest(reqStat); |
2616 test(reqStat==KErrNone); |
2612 test_KErrNone(reqStat.Int()); |
2617 r=TheFs.Volume(volInfo,driveNum); |
2613 r=TheFs.Volume(volInfo,driveNum); |
2618 test_KErrNone(r); |
2614 test_KErrNone(r); |
2619 test(volInfo.iName==_L("VOL")); |
2615 test(volInfo.iName==_L("VOL")); |
2620 // Test notification occurs under ENotifyDisk |
2616 // Test notification occurs under ENotifyDisk |
2621 fs.NotifyChange(ENotifyDisk,reqStat,path); |
2617 fs.NotifyChange(ENotifyDisk,reqStat,path); |
2622 test(reqStat==KRequestPending); |
2618 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2623 r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum); |
2619 r=TheFs.SetVolumeLabel(_L("ABCDEFGHIJK"),driveNum); |
2624 test_KErrNone(r); |
2620 test_KErrNone(r); |
2625 User::WaitForRequest(reqStat); |
2621 User::WaitForRequest(reqStat); |
2626 test(reqStat==KErrNone); |
2622 test_KErrNone(reqStat.Int()); |
2627 r=TheFs.Volume(volInfo,driveNum); |
2623 r=TheFs.Volume(volInfo,driveNum); |
2628 test_KErrNone(r); |
2624 test_KErrNone(r); |
2629 |
2625 |
2630 test(volInfo.iName==_L("ABCDEFGHIJK")); |
2626 test(volInfo.iName==_L("ABCDEFGHIJK")); |
2631 |
2627 |
2632 // Test notification does not occur under ENotifyAttributes |
2628 // Test notification does not occur under ENotifyAttributes |
2633 fs.NotifyChange(ENotifyAttributes,reqStat,path); |
2629 fs.NotifyChange(ENotifyAttributes,reqStat,path); |
2634 r=TheFs.SetVolumeLabel(_L("TROPICANA"),driveNum); |
2630 r=TheFs.SetVolumeLabel(_L("TROPICANA"),driveNum); |
2635 test_KErrNone(r); |
2631 test_KErrNone(r); |
2636 test(reqStat==KRequestPending); |
2632 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2637 r=TheFs.Volume(volInfo,driveNum); |
2633 r=TheFs.Volume(volInfo,driveNum); |
2638 test_KErrNone(r); |
2634 test_KErrNone(r); |
2639 |
2635 |
2640 test(volInfo.iName==_L("TROPICANA")); |
2636 test(volInfo.iName==_L("TROPICANA")); |
2641 |
2637 |
2642 fs.NotifyChangeCancel(reqStat); |
2638 fs.NotifyChangeCancel(reqStat); |
2643 User::WaitForRequest(reqStat); |
2639 User::WaitForRequest(reqStat); |
2644 test(reqStat==KErrCancel); |
2640 test_Value(reqStat.Int(), reqStat==KErrCancel); |
2645 // Test notification occurs under ENotifyEntry |
2641 // Test notification occurs under ENotifyEntry |
2646 fs.NotifyChange(ENotifyEntry,reqStat,path); |
2642 fs.NotifyChange(ENotifyEntry,reqStat,path); |
2647 test(reqStat==KRequestPending); |
2643 test_Value(reqStat.Int(), reqStat==KRequestPending); |
2648 r=TheFs.SetVolumeLabel(currentVolName,driveNum); |
2644 r=TheFs.SetVolumeLabel(currentVolName,driveNum); |
2649 test_KErrNone(r); |
2645 test_KErrNone(r); |
2650 User::WaitForRequest(reqStat); |
2646 User::WaitForRequest(reqStat); |
2651 test(reqStat==KErrNone); |
2647 test_KErrNone(reqStat.Int()); |
2652 r=TheFs.Volume(volInfo,driveNum); |
2648 r=TheFs.Volume(volInfo,driveNum); |
2653 test_KErrNone(r); |
2649 test_KErrNone(r); |
2654 test(volInfo.iName==currentVolName); |
2650 test(volInfo.iName==currentVolName); |
2655 } |
2651 } |
2656 |
2652 |
3003 fs.NotifyChange(ENotifyAttributes,reqStat4,path); |
2999 fs.NotifyChange(ENotifyAttributes,reqStat4,path); |
3004 fs.NotifyChange(ENotifyDir,reqStat5,path); |
3000 fs.NotifyChange(ENotifyDir,reqStat5,path); |
3005 fs.NotifyChange(ENotifyWrite,reqStat6,path); |
3001 fs.NotifyChange(ENotifyWrite,reqStat6,path); |
3006 fs.NotifyChange(ENotifyDisk,reqStat7,path); |
3002 fs.NotifyChange(ENotifyDisk,reqStat7,path); |
3007 |
3003 |
3008 test(reqStat==KRequestPending); |
3004 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3009 test(reqStat2==KRequestPending); |
3005 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3010 test(reqStat3==KRequestPending); |
3006 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3011 test(reqStat4==KRequestPending); |
3007 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3012 User::WaitForRequest(reqStat5); |
3008 User::WaitForRequest(reqStat5); |
3013 test(reqStat5==KErrArgument); |
3009 test_Value(reqStat5.Int(), reqStat5==KErrArgument); |
3014 test(reqStat6==KRequestPending); |
3010 test_Value(reqStat6.Int(), reqStat6==KRequestPending); |
3015 test(reqStat7==KRequestPending); |
3011 test_Value(reqStat7.Int(), reqStat7==KRequestPending); |
3016 |
3012 |
3017 test.Next(_L("RFile::SetAtt()")); |
3013 test.Next(_L("RFile::SetAtt()")); |
3018 r=file.SetAtt(KEntryAttSystem,KEntryAttNormal); |
3014 r=file.SetAtt(KEntryAttSystem,KEntryAttNormal); |
3019 test_KErrNone(r); |
3015 test_KErrNone(r); |
3020 User::WaitForRequest(reqStat); |
3016 User::WaitForRequest(reqStat); |
3021 User::WaitForRequest(reqStat4); |
3017 User::WaitForRequest(reqStat4); |
3022 test(reqStat==KErrNone); |
3018 test_KErrNone(reqStat.Int()); |
3023 test(reqStat2==KRequestPending); // Monitoring with ENotifyFile |
3019 test_Value(reqStat2.Int(), reqStat2==KRequestPending); // Monitoring with ENotifyFile |
3024 test(reqStat3==KRequestPending); // Monitoring with ENotifyEntry |
3020 test_Value(reqStat3.Int(), reqStat3==KRequestPending); // Monitoring with ENotifyEntry |
3025 test(reqStat4==KErrNone); // Monitoring a file - can't use ENotifyDir |
3021 test_KErrNone(reqStat4.Int()); // Monitoring a file - can't use ENotifyDir |
3026 test(reqStat6==KRequestPending); |
3022 test_Value(reqStat6.Int(), reqStat6==KRequestPending); |
3027 test(reqStat7==KRequestPending); |
3023 test_Value(reqStat7.Int(), reqStat7==KRequestPending); |
3028 |
3024 |
3029 fs.NotifyChange(ENotifyWrite,reqStat,path); |
3025 fs.NotifyChange(ENotifyWrite,reqStat,path); |
3030 test(reqStat==KRequestPending); |
3026 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3031 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3027 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3032 User::WaitForRequest(reqStat4); |
3028 User::WaitForRequest(reqStat4); |
3033 test(reqStat4==KErrArgument); |
3029 test_Value(reqStat4.Int(), reqStat4==KErrArgument); |
3034 r=file.SetAtt(KEntryAttNormal,KEntryAttSystem); |
3030 r=file.SetAtt(KEntryAttNormal,KEntryAttSystem); |
3035 test_KErrNone(r); |
3031 test_KErrNone(r); |
3036 test(reqStat==KRequestPending); // Monitoring with ENotifyWrite |
3032 test_Value(reqStat.Int(), reqStat==KRequestPending); // Monitoring with ENotifyWrite |
3037 fs.NotifyChangeCancel(); // Cancel outstanding notification request |
3033 fs.NotifyChangeCancel(); // Cancel outstanding notification request |
3038 |
3034 |
3039 User::WaitForRequest(reqStat); |
3035 User::WaitForRequest(reqStat); |
3040 test(reqStat==KErrCancel); |
3036 test_Value(reqStat.Int(), reqStat==KErrCancel); |
3041 User::WaitForRequest(reqStat2); |
3037 User::WaitForRequest(reqStat2); |
3042 test(reqStat2==KErrCancel); |
3038 test_Value(reqStat2.Int(), reqStat2==KErrCancel); |
3043 User::WaitForRequest(reqStat3); |
3039 User::WaitForRequest(reqStat3); |
3044 test(reqStat3==KErrCancel); |
3040 test_Value(reqStat3.Int(), reqStat3==KErrCancel); |
3045 User::WaitForRequest(reqStat6); |
3041 User::WaitForRequest(reqStat6); |
3046 test(reqStat6==KErrCancel); |
3042 test_Value(reqStat6.Int(), reqStat6==KErrCancel); |
3047 User::WaitForRequest(reqStat7); |
3043 User::WaitForRequest(reqStat7); |
3048 test(reqStat7==KErrCancel); |
3044 test_Value(reqStat7.Int(), reqStat7==KErrCancel); |
3049 |
3045 |
3050 fs.NotifyChange(ENotifyAll,reqStat,path); |
3046 fs.NotifyChange(ENotifyAll,reqStat,path); |
3051 fs.NotifyChange(ENotifyFile,reqStat2,path); |
3047 fs.NotifyChange(ENotifyFile,reqStat2,path); |
3052 fs.NotifyChange(ENotifyEntry,reqStat3,path); |
3048 fs.NotifyChange(ENotifyEntry,reqStat3,path); |
3053 fs.NotifyChange(ENotifyAttributes,reqStat4,path); |
3049 fs.NotifyChange(ENotifyAttributes,reqStat4,path); |
3054 |
3050 |
3055 test(reqStat==KRequestPending); |
3051 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3056 test(reqStat2==KRequestPending); |
3052 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3057 test(reqStat3==KRequestPending); |
3053 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3058 test(reqStat4==KRequestPending); |
3054 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3059 |
3055 |
3060 // RFile::SetSize() of a file within the monitored directory |
3056 // RFile::SetSize() of a file within the monitored directory |
3061 test.Next(_L("RFile::SetSize()")); |
3057 test.Next(_L("RFile::SetSize()")); |
3062 r=file.SetSize(256); |
3058 r=file.SetSize(256); |
3063 test_KErrNone(r); |
3059 test_KErrNone(r); |
3064 User::WaitForRequest(reqStat); |
3060 User::WaitForRequest(reqStat); |
3065 User::WaitForRequest(reqStat4); |
3061 User::WaitForRequest(reqStat4); |
3066 test(reqStat==KErrNone); |
3062 test_KErrNone(reqStat.Int()); |
3067 test(reqStat2==KRequestPending); // Monitoring with ENotifyFile |
3063 test_Value(reqStat2.Int(), reqStat2==KRequestPending); // Monitoring with ENotifyFile |
3068 test(reqStat3==KRequestPending); // Monitoring with ENotifyEntry |
3064 test_Value(reqStat3.Int(), reqStat3==KRequestPending); // Monitoring with ENotifyEntry |
3069 test(reqStat4==KErrNone); |
3065 test_KErrNone(reqStat4.Int()); |
3070 |
3066 |
3071 fs.NotifyChange(ENotifyWrite,reqStat,path); |
3067 fs.NotifyChange(ENotifyWrite,reqStat,path); |
3072 test(reqStat==KRequestPending); |
3068 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3073 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3069 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3074 User::WaitForRequest(reqStat4); |
3070 User::WaitForRequest(reqStat4); |
3075 test(reqStat4==KErrArgument); |
3071 test_Value(reqStat4.Int(), reqStat4==KErrArgument); |
3076 r=file.SetSize(200); |
3072 r=file.SetSize(200); |
3077 test_KErrNone(r); |
3073 test_KErrNone(r); |
3078 User::After(1000000); |
3074 User::After(1000000); |
3079 test(reqStat==KRequestPending); // Monitoring with ENotifyWrite |
3075 test_Value(reqStat.Int(), reqStat==KRequestPending); // Monitoring with ENotifyWrite |
3080 |
3076 |
3081 file.Close(); |
3077 file.Close(); |
3082 fs.NotifyChangeCancel(); // Cancels all outstanding notification requests |
3078 fs.NotifyChangeCancel(); // Cancels all outstanding notification requests |
3083 |
3079 |
3084 User::WaitForRequest(reqStat); |
3080 User::WaitForRequest(reqStat); |
3085 test(reqStat==KErrCancel); |
3081 test_Value(reqStat.Int(), reqStat==KErrCancel); |
3086 User::WaitForRequest(reqStat2); |
3082 User::WaitForRequest(reqStat2); |
3087 test(reqStat2==KErrCancel); |
3083 test_Value(reqStat2.Int(), reqStat2==KErrCancel); |
3088 User::WaitForRequest(reqStat3); |
3084 User::WaitForRequest(reqStat3); |
3089 test(reqStat3==KErrCancel); |
3085 test_Value(reqStat3.Int(), reqStat3==KErrCancel); |
3090 |
3086 |
3091 // RFile::Temp() to create a temp file within the monitored directory |
3087 // RFile::Temp() to create a temp file within the monitored directory |
3092 test.Next(_L("RFile::Temp()")); |
3088 test.Next(_L("RFile::Temp()")); |
3093 path=_L("\\F32-TST\\NOTIFY\\"); |
3089 path=_L("\\F32-TST\\NOTIFY\\"); |
3094 |
3090 |
3095 fs.NotifyChange(ENotifyAll,reqStat,path); |
3091 fs.NotifyChange(ENotifyAll,reqStat,path); |
3096 fs.NotifyChange(ENotifyDir,reqStat2,path); |
3092 fs.NotifyChange(ENotifyDir,reqStat2,path); |
3097 fs.NotifyChange(ENotifyEntry,reqStat3,path); |
3093 fs.NotifyChange(ENotifyEntry,reqStat3,path); |
3098 fs.NotifyChange(ENotifyAttributes,reqStat4,path); |
3094 fs.NotifyChange(ENotifyAttributes,reqStat4,path); |
3099 |
3095 |
3100 test(reqStat==KRequestPending); |
3096 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3101 test(reqStat2==KRequestPending); |
3097 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3102 test(reqStat3==KRequestPending); |
3098 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3103 test(reqStat4==KRequestPending); |
3099 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3104 |
3100 |
3105 TFileName fileName; |
3101 TFileName fileName; |
3106 r=file.Temp(TheFs,path,fileName,EFileWrite); |
3102 r=file.Temp(TheFs,path,fileName,EFileWrite); |
3107 test_KErrNone(r); |
3103 test_KErrNone(r); |
3108 User::WaitForRequest(reqStat); |
3104 User::WaitForRequest(reqStat); |
3109 test(reqStat==KErrNone); |
3105 test_KErrNone(reqStat.Int()); |
3110 test(reqStat2==KRequestPending); |
3106 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3111 test(reqStat3==KRequestPending); // Monitoring ENotifyEntry |
3107 test_Value(reqStat3.Int(), reqStat3==KRequestPending); // Monitoring ENotifyEntry |
3112 test(reqStat4==KRequestPending); // Monitoring ENotifyAttributes |
3108 test_Value(reqStat4.Int(), reqStat4==KRequestPending); // Monitoring ENotifyAttributes |
3113 file.Close(); |
3109 file.Close(); |
3114 fs.NotifyChangeCancel(); |
3110 fs.NotifyChangeCancel(); |
3115 |
3111 |
3116 User::WaitForRequest(reqStat2); |
3112 User::WaitForRequest(reqStat2); |
3117 test(reqStat2==KErrCancel); |
3113 test_Value(reqStat2.Int(), reqStat2==KErrCancel); |
3118 User::WaitForRequest(reqStat3); |
3114 User::WaitForRequest(reqStat3); |
3119 test(reqStat3==KErrCancel); |
3115 test_Value(reqStat3.Int(), reqStat3==KErrCancel); |
3120 User::WaitForRequest(reqStat4); |
3116 User::WaitForRequest(reqStat4); |
3121 test(reqStat4==KErrCancel); |
3117 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
3122 |
3118 |
3123 fs.NotifyChange(ENotifyFile,reqStat,path); |
3119 fs.NotifyChange(ENotifyFile,reqStat,path); |
3124 fs.NotifyChange(ENotifyDisk,reqStat2,path); |
3120 fs.NotifyChange(ENotifyDisk,reqStat2,path); |
3125 fs.NotifyChange(ENotifyWrite,reqStat3,path); |
3121 fs.NotifyChange(ENotifyWrite,reqStat3,path); |
3126 r=file.Temp(TheFs,path,fileName,EFileWrite); |
3122 r=file.Temp(TheFs,path,fileName,EFileWrite); |
3127 test_KErrNone(r); |
3123 test_KErrNone(r); |
3128 test(reqStat==KRequestPending); // Monitoring ENotifyFile |
3124 test_Value(reqStat.Int(), reqStat==KRequestPending); // Monitoring ENotifyFile |
3129 test(reqStat2==KRequestPending); // Monitoring ENotifyDisk |
3125 test_Value(reqStat2.Int(), reqStat2==KRequestPending); // Monitoring ENotifyDisk |
3130 test(reqStat3==KRequestPending); // Monitoring ENotifyWrite |
3126 test_Value(reqStat3.Int(), reqStat3==KRequestPending); // Monitoring ENotifyWrite |
3131 file.Close(); |
3127 file.Close(); |
3132 |
3128 |
3133 fs.NotifyChangeCancel(); // Cancels all outstanding notification requests |
3129 fs.NotifyChangeCancel(); // Cancels all outstanding notification requests |
3134 |
3130 |
3135 User::WaitForRequest(reqStat); |
3131 User::WaitForRequest(reqStat); |
3136 test(reqStat==KErrCancel); |
3132 test_Value(reqStat.Int(), reqStat==KErrCancel); |
3137 User::WaitForRequest(reqStat2); |
3133 User::WaitForRequest(reqStat2); |
3138 test(reqStat2==KErrCancel); |
3134 test_Value(reqStat2.Int(), reqStat2==KErrCancel); |
3139 User::WaitForRequest(reqStat3); |
3135 User::WaitForRequest(reqStat3); |
3140 test(reqStat3==KErrCancel); |
3136 test_Value(reqStat3.Int(), reqStat3==KErrCancel); |
3141 |
3137 |
3142 // RFile::SetModified() to change modification time of a file within monitored dir |
3138 // RFile::SetModified() to change modification time of a file within monitored dir |
3143 test.Next(_L("RFile::SetModified()")); |
3139 test.Next(_L("RFile::SetModified()")); |
3144 path=_L("\\F32-TST\\NOTIFY\\NewFile.txt"); |
3140 path=_L("\\F32-TST\\NOTIFY\\NewFile.txt"); |
3145 fs.NotifyChange(ENotifyAll,reqStat,path); |
3141 fs.NotifyChange(ENotifyAll,reqStat,path); |
3146 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3142 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3147 fs.NotifyChange(ENotifyAttributes,reqStat3,path); |
3143 fs.NotifyChange(ENotifyAttributes,reqStat3,path); |
3148 fs.NotifyChange(ENotifyFile,reqStat4,path); |
3144 fs.NotifyChange(ENotifyFile,reqStat4,path); |
3149 |
3145 |
3150 test(reqStat==KRequestPending); |
3146 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3151 test(reqStat2==KRequestPending); |
3147 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3152 test(reqStat3==KRequestPending); |
3148 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3153 test(reqStat4==KRequestPending); |
3149 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3154 |
3150 |
3155 TTime now; |
3151 TTime now; |
3156 now.HomeTime(); |
3152 now.HomeTime(); |
3157 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite); |
3153 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite); |
3158 test_KErrNone(r); |
3154 test_KErrNone(r); |
3159 test(reqStat==KRequestPending); |
3155 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3160 file.SetModified(now); |
3156 file.SetModified(now); |
3161 file.Close(); |
3157 file.Close(); |
3162 User::WaitForRequest(reqStat); |
3158 User::WaitForRequest(reqStat); |
3163 test(reqStat==KErrNone); |
3159 test_KErrNone(reqStat.Int()); |
3164 test(reqStat2==KRequestPending); |
3160 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3165 User::WaitForRequest(reqStat3); |
3161 User::WaitForRequest(reqStat3); |
3166 test(reqStat3==KErrNone); |
3162 test_KErrNone(reqStat3.Int()); |
3167 test(reqStat4==KRequestPending); |
3163 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3168 fs.NotifyChangeCancel(); |
3164 fs.NotifyChangeCancel(); |
3169 |
3165 |
3170 User::WaitForRequest(reqStat2); |
3166 User::WaitForRequest(reqStat2); |
3171 test(reqStat2==KErrCancel); |
3167 test_Value(reqStat2.Int(), reqStat2==KErrCancel); |
3172 User::WaitForRequest(reqStat4); |
3168 User::WaitForRequest(reqStat4); |
3173 test(reqStat4==KErrCancel); |
3169 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
3174 |
3170 |
3175 // RFs::SetEntry() to change a directory entry within the monitored directory |
3171 // RFs::SetEntry() to change a directory entry within the monitored directory |
3176 test.Next(_L("RFs::SetEntry()")); |
3172 test.Next(_L("RFs::SetEntry()")); |
3177 TEntry entry; |
3173 TEntry entry; |
3178 fs.NotifyChange(ENotifyAll,reqStat,path); |
3174 fs.NotifyChange(ENotifyAll,reqStat,path); |
3179 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3175 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3180 fs.NotifyChange(ENotifyAttributes,reqStat3,path); |
3176 fs.NotifyChange(ENotifyAttributes,reqStat3,path); |
3181 fs.NotifyChange(ENotifyDisk,reqStat4,path); |
3177 fs.NotifyChange(ENotifyDisk,reqStat4,path); |
3182 |
3178 |
3183 test(reqStat==KRequestPending); |
3179 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3184 test(reqStat2==KRequestPending); |
3180 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3185 test(reqStat3==KRequestPending); |
3181 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3186 test(reqStat4==KRequestPending); |
3182 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3187 |
3183 |
3188 r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\NewFile.txt"),entry); |
3184 r=TheFs.Entry(_L("\\F32-TST\\NOTIFY\\NewFile.txt"),entry); |
3189 test(reqStat==KRequestPending); |
3185 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3190 now.HomeTime(); |
3186 now.HomeTime(); |
3191 r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\NewFile.txt"),now,KEntryAttHidden,KEntryAttNormal); |
3187 r=TheFs.SetEntry(_L("\\F32-TST\\NOTIFY\\NewFile.txt"),now,KEntryAttHidden,KEntryAttNormal); |
3192 test_KErrNone(r); |
3188 test_KErrNone(r); |
3193 User::WaitForRequest(reqStat); |
3189 User::WaitForRequest(reqStat); |
3194 User::WaitForRequest(reqStat3); |
3190 User::WaitForRequest(reqStat3); |
3195 test(reqStat==KErrNone); |
3191 test_KErrNone(reqStat.Int()); |
3196 test(reqStat2==KRequestPending); |
3192 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3197 test(reqStat3==KErrNone); |
3193 test_KErrNone(reqStat3.Int()); |
3198 test(reqStat4==KRequestPending); |
3194 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3199 fs.NotifyChangeCancel(); |
3195 fs.NotifyChangeCancel(); |
3200 |
3196 |
3201 User::WaitForRequest(reqStat2); |
3197 User::WaitForRequest(reqStat2); |
3202 test(reqStat2==KErrCancel); |
3198 test_Value(reqStat2.Int(), reqStat2==KErrCancel); |
3203 User::WaitForRequest(reqStat4); |
3199 User::WaitForRequest(reqStat4); |
3204 test(reqStat4==KErrCancel); |
3200 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
3205 |
3201 |
3206 // RFile::Set() to change file's modification time and attributes |
3202 // RFile::Set() to change file's modification time and attributes |
3207 test.Next(_L("RFile::Set()")); |
3203 test.Next(_L("RFile::Set()")); |
3208 fs.NotifyChange(ENotifyAll,reqStat,path); |
3204 fs.NotifyChange(ENotifyAll,reqStat,path); |
3209 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3205 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3210 fs.NotifyChange(ENotifyAttributes,reqStat3,path); |
3206 fs.NotifyChange(ENotifyAttributes,reqStat3,path); |
3211 fs.NotifyChange(ENotifyWrite,reqStat4,path); |
3207 fs.NotifyChange(ENotifyWrite,reqStat4,path); |
3212 |
3208 |
3213 test(reqStat==KRequestPending); |
3209 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3214 test(reqStat2==KRequestPending); |
3210 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3215 test(reqStat3==KRequestPending); |
3211 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3216 test(reqStat4==KRequestPending); |
3212 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3217 |
3213 |
3218 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite); |
3214 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\NewFile.txt"),EFileRead|EFileWrite); |
3219 test_KErrNone(r); |
3215 test_KErrNone(r); |
3220 test(reqStat==KRequestPending); |
3216 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3221 now.HomeTime(); |
3217 now.HomeTime(); |
3222 r=file.Set(now,KEntryAttNormal,KEntryAttHidden); |
3218 r=file.Set(now,KEntryAttNormal,KEntryAttHidden); |
3223 file.Close(); |
3219 file.Close(); |
3224 User::WaitForRequest(reqStat); |
3220 User::WaitForRequest(reqStat); |
3225 User::WaitForRequest(reqStat3); |
3221 User::WaitForRequest(reqStat3); |
3226 test(reqStat==KErrNone); |
3222 test_KErrNone(reqStat.Int()); |
3227 test(reqStat2==KRequestPending); |
3223 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3228 test(reqStat3==KErrNone); |
3224 test_KErrNone(reqStat3.Int()); |
3229 test(reqStat4==KRequestPending); |
3225 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3230 fs.NotifyChangeCancel(); |
3226 fs.NotifyChangeCancel(); |
3231 |
3227 |
3232 User::WaitForRequest(reqStat2); |
3228 User::WaitForRequest(reqStat2); |
3233 test(reqStat2==KErrCancel); |
3229 test_Value(reqStat2.Int(), reqStat2==KErrCancel); |
3234 User::WaitForRequest(reqStat4); |
3230 User::WaitForRequest(reqStat4); |
3235 test(reqStat4==KErrCancel); |
3231 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
3236 |
3232 |
3237 // RFs::SetDriveName() |
3233 // RFs::SetDriveName() |
3238 |
3234 |
3239 test.Next(_L("RFs::SetDriveName()")); |
3235 test.Next(_L("RFs::SetDriveName()")); |
3240 fs.NotifyChange(ENotifyAll,reqStat,path); |
3236 fs.NotifyChange(ENotifyAll,reqStat,path); |
3241 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3237 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3242 fs.NotifyChange(ENotifyDisk,reqStat3,path); |
3238 fs.NotifyChange(ENotifyDisk,reqStat3,path); |
3243 fs.NotifyChange(ENotifyAttributes,reqStat4,path); |
3239 fs.NotifyChange(ENotifyAttributes,reqStat4,path); |
3244 |
3240 |
3245 test(reqStat==KRequestPending); |
3241 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3246 test(reqStat2==KRequestPending); |
3242 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3247 test(reqStat3==KRequestPending); |
3243 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3248 test(reqStat4==KRequestPending); |
3244 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3249 User::After(KNotifyChangeAfter); |
3245 User::After(KNotifyChangeAfter); |
3250 |
3246 |
3251 r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST")); |
3247 r=TheFs.SetDriveName(KDefaultDrive,_L("DRIVETEST")); |
3252 test_KErrNone(r); |
3248 test_KErrNone(r); |
3253 User::WaitForRequest(reqStat); |
3249 User::WaitForRequest(reqStat); |
3254 test(reqStat==KErrNone); |
3250 test_KErrNone(reqStat.Int()); |
3255 test(reqStat2==KRequestPending); |
3251 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3256 test(reqStat3==KRequestPending); |
3252 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3257 test(reqStat4==KRequestPending); |
3253 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3258 fs.NotifyChangeCancel(); |
3254 fs.NotifyChangeCancel(); |
3259 |
3255 |
3260 User::WaitForRequest(reqStat2); |
3256 User::WaitForRequest(reqStat2); |
3261 test(reqStat2==KErrCancel); |
3257 test_Value(reqStat2.Int(), reqStat2==KErrCancel); |
3262 User::WaitForRequest(reqStat3); |
3258 User::WaitForRequest(reqStat3); |
3263 test(reqStat3==KErrCancel); |
3259 test_Value(reqStat3.Int(), reqStat3==KErrCancel); |
3264 User::WaitForRequest(reqStat4); |
3260 User::WaitForRequest(reqStat4); |
3265 test(reqStat4==KErrCancel); |
3261 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
3266 |
3262 |
3267 // RFs::MkDir() |
3263 // RFs::MkDir() |
3268 test.Next(_L("RFs::MkDir()")); |
3264 test.Next(_L("RFs::MkDir()")); |
3269 path=_L("\\F32-TST\\NOTIFY\\"); |
3265 path=_L("\\F32-TST\\NOTIFY\\"); |
3270 |
3266 |
3271 fs.NotifyChange(ENotifyAll,reqStat,path); |
3267 fs.NotifyChange(ENotifyAll,reqStat,path); |
3272 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3268 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3273 fs.NotifyChange(ENotifyDir,reqStat3,path); |
3269 fs.NotifyChange(ENotifyDir,reqStat3,path); |
3274 fs.NotifyChange(ENotifyFile,reqStat4,path); |
3270 fs.NotifyChange(ENotifyFile,reqStat4,path); |
3275 |
3271 |
3276 test(reqStat==KRequestPending); |
3272 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3277 test(reqStat2==KRequestPending); |
3273 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3278 test(reqStat3==KRequestPending); |
3274 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3279 test(reqStat4==KRequestPending); |
3275 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3280 |
3276 |
3281 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\")); |
3277 r=TheFs.MkDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\")); |
3282 test_KErrNone(r); |
3278 test_KErrNone(r); |
3283 User::WaitForRequest(reqStat); |
3279 User::WaitForRequest(reqStat); |
3284 User::WaitForRequest(reqStat2); |
3280 User::WaitForRequest(reqStat2); |
3285 User::WaitForRequest(reqStat3); |
3281 User::WaitForRequest(reqStat3); |
3286 test(reqStat==KErrNone); |
3282 test_KErrNone(reqStat.Int()); |
3287 test(reqStat2==KErrNone); |
3283 test_KErrNone(reqStat2.Int()); |
3288 test(reqStat3==KErrNone); |
3284 test_KErrNone(reqStat3.Int()); |
3289 test(reqStat4==KRequestPending); |
3285 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3290 |
3286 |
3291 // RFs::RmDir() |
3287 // RFs::RmDir() |
3292 test.Next(_L("RFs::RmDir()")); |
3288 test.Next(_L("RFs::RmDir()")); |
3293 fs.NotifyChange(ENotifyAll,reqStat,path); |
3289 fs.NotifyChange(ENotifyAll,reqStat,path); |
3294 fs.NotifyChange(ENotifyDir,reqStat2,path); |
3290 fs.NotifyChange(ENotifyDir,reqStat2,path); |
3295 fs.NotifyChange(ENotifyWrite,reqStat3,path); |
3291 fs.NotifyChange(ENotifyWrite,reqStat3,path); |
3296 |
3292 |
3297 test(reqStat==KRequestPending); |
3293 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3298 test(reqStat2==KRequestPending); |
3294 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3299 test(reqStat3==KRequestPending); |
3295 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3300 |
3296 |
3301 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\")); |
3297 r=TheFs.RmDir(_L("\\F32-TST\\NOTIFY\\EMERALD_CITY\\")); |
3302 test_KErrNone(r); |
3298 test_KErrNone(r); |
3303 User::WaitForRequest(reqStat); |
3299 User::WaitForRequest(reqStat); |
3304 User::WaitForRequest(reqStat2); |
3300 User::WaitForRequest(reqStat2); |
3305 test(reqStat==KErrNone); |
3301 test_KErrNone(reqStat.Int()); |
3306 test(reqStat2==KErrNone); |
3302 test_KErrNone(reqStat2.Int()); |
3307 test(reqStat3==KRequestPending); |
3303 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3308 test(reqStat4==KRequestPending); |
3304 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3309 fs.NotifyChangeCancel(); |
3305 fs.NotifyChangeCancel(); |
3310 |
3306 |
3311 User::WaitForRequest(reqStat3); |
3307 User::WaitForRequest(reqStat3); |
3312 test(reqStat3==KErrCancel); |
3308 test_Value(reqStat3.Int(), reqStat3==KErrCancel); |
3313 User::WaitForRequest(reqStat4); |
3309 User::WaitForRequest(reqStat4); |
3314 test(reqStat4==KErrCancel); |
3310 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
3315 |
3311 |
3316 // RFile::Create() |
3312 // RFile::Create() |
3317 test.Next(_L("RFile::Create()")); |
3313 test.Next(_L("RFile::Create()")); |
3318 fs.NotifyChange(ENotifyAll,reqStat,path); |
3314 fs.NotifyChange(ENotifyAll,reqStat,path); |
3319 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3315 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3320 fs.NotifyChange(ENotifyDir,reqStat3,path); |
3316 fs.NotifyChange(ENotifyDir,reqStat3,path); |
3321 fs.NotifyChange(ENotifyFile,reqStat4,path); |
3317 fs.NotifyChange(ENotifyFile,reqStat4,path); |
3322 |
3318 |
3323 test(reqStat==KRequestPending); |
3319 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3324 test(reqStat2==KRequestPending); |
3320 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3325 test(reqStat3==KRequestPending); |
3321 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3326 test(reqStat4==KRequestPending); |
3322 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3327 |
3323 |
3328 r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"),EFileRead|EFileWrite); |
3324 r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"),EFileRead|EFileWrite); |
3329 test_KErrNone(r); |
3325 test_KErrNone(r); |
3330 User::WaitForRequest(reqStat); |
3326 User::WaitForRequest(reqStat); |
3331 User::WaitForRequest(reqStat2); |
3327 User::WaitForRequest(reqStat2); |
3332 User::WaitForRequest(reqStat4); |
3328 User::WaitForRequest(reqStat4); |
3333 test(reqStat==KErrNone); |
3329 test_KErrNone(reqStat.Int()); |
3334 test(reqStat2==KErrNone); |
3330 test_KErrNone(reqStat2.Int()); |
3335 test(reqStat3==KRequestPending); // Monitoring ENotifyDir |
3331 test_Value(reqStat3.Int(), reqStat3==KRequestPending); // Monitoring ENotifyDir |
3336 test(reqStat4==KErrNone); |
3332 test_KErrNone(reqStat4.Int()); |
3337 file.Close(); |
3333 file.Close(); |
3338 fs.NotifyChangeCancel(reqStat3); |
3334 fs.NotifyChangeCancel(reqStat3); |
3339 User::WaitForRequest(reqStat3); |
3335 User::WaitForRequest(reqStat3); |
3340 |
3336 |
3341 fs.NotifyChange(ENotifyAll,reqStat,path); |
3337 fs.NotifyChange(ENotifyAll,reqStat,path); |
3342 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3338 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3343 fs.NotifyChange(ENotifyDisk,reqStat3,path); |
3339 fs.NotifyChange(ENotifyDisk,reqStat3,path); |
3344 fs.NotifyChange(ENotifyWrite,reqStat4,path); |
3340 fs.NotifyChange(ENotifyWrite,reqStat4,path); |
3345 |
3341 |
3346 test(reqStat==KRequestPending); |
3342 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3347 test(reqStat2==KRequestPending); |
3343 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3348 test(reqStat3==KRequestPending); |
3344 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3349 test(reqStat4==KRequestPending); |
3345 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3350 |
3346 |
3351 r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Bad_Witch.bat"),EFileRead|EFileWrite); |
3347 r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Bad_Witch.bat"),EFileRead|EFileWrite); |
3352 test_KErrNone(r); |
3348 test_KErrNone(r); |
3353 User::WaitForRequest(reqStat); |
3349 User::WaitForRequest(reqStat); |
3354 User::WaitForRequest(reqStat2); |
3350 User::WaitForRequest(reqStat2); |
3355 test(reqStat==KErrNone); |
3351 test_KErrNone(reqStat.Int()); |
3356 test(reqStat2==KErrNone); |
3352 test_KErrNone(reqStat2.Int()); |
3357 test(reqStat3==KRequestPending); |
3353 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3358 test(reqStat4==KRequestPending); |
3354 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3359 file.Close(); |
3355 file.Close(); |
3360 fs.NotifyChangeCancel(); |
3356 fs.NotifyChangeCancel(); |
3361 |
3357 |
3362 User::WaitForRequest(reqStat3); |
3358 User::WaitForRequest(reqStat3); |
3363 test(reqStat3==KErrCancel); |
3359 test_Value(reqStat3.Int(), reqStat3==KErrCancel); |
3364 User::WaitForRequest(reqStat4); |
3360 User::WaitForRequest(reqStat4); |
3365 test(reqStat4==KErrCancel); |
3361 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
3366 |
3362 |
3367 // RFs::Delete() |
3363 // RFs::Delete() |
3368 test.Next(_L("RFs::Delete()")); |
3364 test.Next(_L("RFs::Delete()")); |
3369 fs.NotifyChange(ENotifyAll,reqStat,path); |
3365 fs.NotifyChange(ENotifyAll,reqStat,path); |
3370 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3366 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3371 fs.NotifyChange(ENotifyDir,reqStat3,path); |
3367 fs.NotifyChange(ENotifyDir,reqStat3,path); |
3372 fs.NotifyChange(ENotifyFile,reqStat4,path); |
3368 fs.NotifyChange(ENotifyFile,reqStat4,path); |
3373 |
3369 |
3374 test(reqStat==KRequestPending); |
3370 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3375 test(reqStat2==KRequestPending); |
3371 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3376 test(reqStat3==KRequestPending); |
3372 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3377 test(reqStat4==KRequestPending); |
3373 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3378 |
3374 |
3379 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Good_Witch.bat")); |
3375 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Good_Witch.bat")); |
3380 test_KErrNone(r); |
3376 test_KErrNone(r); |
3381 User::WaitForRequest(reqStat); |
3377 User::WaitForRequest(reqStat); |
3382 User::WaitForRequest(reqStat2); |
3378 User::WaitForRequest(reqStat2); |
3383 User::WaitForRequest(reqStat4); |
3379 User::WaitForRequest(reqStat4); |
3384 test(reqStat==KErrNone); |
3380 test_KErrNone(reqStat.Int()); |
3385 test(reqStat2==KErrNone); |
3381 test_KErrNone(reqStat2.Int()); |
3386 test(reqStat3==KRequestPending); // Monitoring ENotifyDir |
3382 test_Value(reqStat3.Int(), reqStat3==KRequestPending); // Monitoring ENotifyDir |
3387 test(reqStat4==KErrNone); |
3383 test_KErrNone(reqStat4.Int()); |
3388 fs.NotifyChangeCancel(reqStat3); |
3384 fs.NotifyChangeCancel(reqStat3); |
3389 User::WaitForRequest(reqStat3); |
3385 User::WaitForRequest(reqStat3); |
3390 test(reqStat3==KErrCancel); |
3386 test_Value(reqStat3.Int(), reqStat3==KErrCancel); |
3391 |
3387 |
3392 fs.NotifyChange(ENotifyAll,reqStat,path); |
3388 fs.NotifyChange(ENotifyAll,reqStat,path); |
3393 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3389 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3394 fs.NotifyChange(ENotifyAttributes,reqStat3,path); |
3390 fs.NotifyChange(ENotifyAttributes,reqStat3,path); |
3395 fs.NotifyChange(ENotifyAll,reqStat4,path); |
3391 fs.NotifyChange(ENotifyAll,reqStat4,path); |
3396 |
3392 |
3397 test(reqStat==KRequestPending); |
3393 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3398 test(reqStat2==KRequestPending); |
3394 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3399 test(reqStat3==KRequestPending); |
3395 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3400 test(reqStat4==KRequestPending); |
3396 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3401 |
3397 |
3402 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Bad_Witch.bat")); |
3398 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Bad_Witch.bat")); |
3403 test_KErrNone(r); |
3399 test_KErrNone(r); |
3404 User::WaitForRequest(reqStat); |
3400 User::WaitForRequest(reqStat); |
3405 User::WaitForRequest(reqStat2); |
3401 User::WaitForRequest(reqStat2); |
3406 User::WaitForRequest(reqStat4); |
3402 User::WaitForRequest(reqStat4); |
3407 test(reqStat==KErrNone); |
3403 test_KErrNone(reqStat.Int()); |
3408 test(reqStat2==KErrNone); |
3404 test_KErrNone(reqStat2.Int()); |
3409 test(reqStat3==KRequestPending); |
3405 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3410 test(reqStat4==KErrNone); |
3406 test_KErrNone(reqStat4.Int()); |
3411 fs.NotifyChangeCancel(reqStat3); |
3407 fs.NotifyChangeCancel(reqStat3); |
3412 User::WaitForRequest(reqStat3); |
3408 User::WaitForRequest(reqStat3); |
3413 test(reqStat3==KErrCancel); |
3409 test_Value(reqStat3.Int(), reqStat3==KErrCancel); |
3414 |
3410 |
3415 // RFile::Replace() |
3411 // RFile::Replace() |
3416 test.Next(_L("RFile::Replace()")); |
3412 test.Next(_L("RFile::Replace()")); |
3417 fs.NotifyChange(ENotifyAll,reqStat,path); |
3413 fs.NotifyChange(ENotifyAll,reqStat,path); |
3418 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3414 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3419 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3415 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3420 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3416 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3421 |
3417 |
3422 test(reqStat==KRequestPending); |
3418 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3423 test(reqStat2==KRequestPending); |
3419 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3424 test(reqStat3==KRequestPending); |
3420 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3425 test(reqStat4==KRequestPending); |
3421 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3426 |
3422 |
3427 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"),EFileRead|EFileWrite); |
3423 r=file.Replace(TheFs,_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"),EFileRead|EFileWrite); |
3428 test_KErrNone(r); |
3424 test_KErrNone(r); |
3429 User::WaitForRequest(reqStat); |
3425 User::WaitForRequest(reqStat); |
3430 User::WaitForRequest(reqStat2); |
3426 User::WaitForRequest(reqStat2); |
3431 User::WaitForRequest(reqStat3); |
3427 User::WaitForRequest(reqStat3); |
3432 test(reqStat==KErrNone); |
3428 test_KErrNone(reqStat.Int()); |
3433 test(reqStat2==KErrNone); |
3429 test_KErrNone(reqStat2.Int()); |
3434 test(reqStat3==KErrNone); |
3430 test_KErrNone(reqStat3.Int()); |
3435 test(reqStat4==KRequestPending); |
3431 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3436 file.Close(); |
3432 file.Close(); |
3437 fs.NotifyChangeCancel(); |
3433 fs.NotifyChangeCancel(); |
3438 |
3434 |
3439 test(reqStat==KErrNone); |
3435 test_KErrNone(reqStat.Int()); |
3440 test(reqStat2==KErrNone); |
3436 test_KErrNone(reqStat2.Int()); |
3441 test(reqStat3==KErrNone); |
3437 test_KErrNone(reqStat3.Int()); |
3442 User::WaitForRequest(reqStat4); |
3438 User::WaitForRequest(reqStat4); |
3443 test(reqStat4==KErrCancel); |
3439 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
3444 |
3440 |
3445 // RFs::Delete() |
3441 // RFs::Delete() |
3446 test.Next(_L("RFs::Delete()")); |
3442 test.Next(_L("RFs::Delete()")); |
3447 path=_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"); |
3443 path=_L("\\F32-TST\\NOTIFY\\Good_Witch.bat"); |
3448 fs.NotifyChange(ENotifyAll,reqStat,path); |
3444 fs.NotifyChange(ENotifyAll,reqStat,path); |
3449 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3445 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3450 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3446 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3451 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3447 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3452 |
3448 |
3453 test(reqStat==KRequestPending); |
3449 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3454 test(reqStat2==KRequestPending); |
3450 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3455 test(reqStat3==KRequestPending); |
3451 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3456 User::WaitForRequest(reqStat4); |
3452 User::WaitForRequest(reqStat4); |
3457 test(reqStat4==KErrArgument); |
3453 test_Value(reqStat4.Int(), reqStat4==KErrArgument); |
3458 |
3454 |
3459 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Good_Witch.bat")); |
3455 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Good_Witch.bat")); |
3460 test_KErrNone(r); |
3456 test_KErrNone(r); |
3461 User::WaitForRequest(reqStat); |
3457 User::WaitForRequest(reqStat); |
3462 User::WaitForRequest(reqStat2); |
3458 User::WaitForRequest(reqStat2); |
3463 User::WaitForRequest(reqStat3); |
3459 User::WaitForRequest(reqStat3); |
3464 test(reqStat==KErrNone); |
3460 test_KErrNone(reqStat.Int()); |
3465 test(reqStat2==KErrNone); |
3461 test_KErrNone(reqStat2.Int()); |
3466 test(reqStat3==KErrNone); |
3462 test_KErrNone(reqStat3.Int()); |
3467 test(reqStat4==KErrArgument); |
3463 test_Value(reqStat4.Int(), reqStat4==KErrArgument); |
3468 |
3464 |
3469 // RFs::SetVolumeLabel() |
3465 // RFs::SetVolumeLabel() |
3470 test.Next(_L("RFs::SetVolumeLabel()")); |
3466 test.Next(_L("RFs::SetVolumeLabel()")); |
3471 path=_L("\\F32-TST\\NOTIFY\\"); |
3467 path=_L("\\F32-TST\\NOTIFY\\"); |
3472 fs.NotifyChange(ENotifyAll,reqStat,path); |
3468 fs.NotifyChange(ENotifyAll,reqStat,path); |
3569 fs.NotifyChange(ENotifyAll,reqStat,path); |
3565 fs.NotifyChange(ENotifyAll,reqStat,path); |
3570 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3566 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3571 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3567 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3572 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3568 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3573 |
3569 |
3574 test(reqStat==KRequestPending); |
3570 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3575 test(reqStat2==KRequestPending); |
3571 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3576 test(reqStat3==KRequestPending); |
3572 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3577 test(reqStat4==KRequestPending); |
3573 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3578 |
3574 |
3579 r=file.Rename(_L("\\F32-TST\\NOTIFY\\OldFile.abc")); |
3575 r=file.Rename(_L("\\F32-TST\\NOTIFY\\OldFile.abc")); |
3580 test_Value(r, r == KErrNone||r==KErrAlreadyExists); |
3576 test_Value(r, r == KErrNone||r==KErrAlreadyExists); |
3581 User::WaitForRequest(reqStat); |
3577 User::WaitForRequest(reqStat); |
3582 User::WaitForRequest(reqStat2); |
3578 User::WaitForRequest(reqStat2); |
3583 User::WaitForRequest(reqStat3); |
3579 User::WaitForRequest(reqStat3); |
3584 test(reqStat==KErrNone); |
3580 test_KErrNone(reqStat.Int()); |
3585 test(reqStat2==KErrNone); |
3581 test_KErrNone(reqStat2.Int()); |
3586 test(reqStat3==KErrNone); |
3582 test_KErrNone(reqStat3.Int()); |
3587 test(reqStat4==KRequestPending); // Monitoring ENotifyDir |
3583 test_Value(reqStat4.Int(), reqStat4==KRequestPending); // Monitoring ENotifyDir |
3588 file.Close(); |
3584 file.Close(); |
3589 fs.NotifyChangeCancel(); |
3585 fs.NotifyChangeCancel(); |
3590 User::WaitForRequest(reqStat4); |
3586 User::WaitForRequest(reqStat4); |
3591 test(reqStat4==KErrCancel); |
3587 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
3592 |
3588 |
3593 path=_L("\\F32-TST\\NOTIFY\\OldFile.abc"); |
3589 path=_L("\\F32-TST\\NOTIFY\\OldFile.abc"); |
3594 |
3590 |
3595 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\OldFile.abc"),EFileShareExclusive|EFileWrite); |
3591 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\OldFile.abc"),EFileShareExclusive|EFileWrite); |
3596 test_KErrNone(r); |
3592 test_KErrNone(r); |
3597 fs.NotifyChange(ENotifyAll,reqStat,path); |
3593 fs.NotifyChange(ENotifyAll,reqStat,path); |
3598 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3594 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3599 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3595 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3600 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3596 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3601 |
3597 |
3602 test(reqStat==KRequestPending); |
3598 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3603 test(reqStat2==KRequestPending); |
3599 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3604 test(reqStat3==KRequestPending); |
3600 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3605 User::WaitForRequest(reqStat4); |
3601 User::WaitForRequest(reqStat4); |
3606 test(reqStat4==KErrArgument); |
3602 test_Value(reqStat4.Int(), reqStat4==KErrArgument); |
3607 |
3603 |
3608 r=file.Rename(_L("\\F32-TST\\NOTIFY\\NewFile.xyz")); |
3604 r=file.Rename(_L("\\F32-TST\\NOTIFY\\NewFile.xyz")); |
3609 test_KErrNone(r); |
3605 test_KErrNone(r); |
3610 User::WaitForRequest(reqStat); |
3606 User::WaitForRequest(reqStat); |
3611 User::WaitForRequest(reqStat2); |
3607 User::WaitForRequest(reqStat2); |
3612 User::WaitForRequest(reqStat3); |
3608 User::WaitForRequest(reqStat3); |
3613 test(reqStat==KErrNone); |
3609 test_KErrNone(reqStat.Int()); |
3614 test(reqStat2==KErrNone); |
3610 test_KErrNone(reqStat2.Int()); |
3615 test(reqStat3==KErrNone); |
3611 test_KErrNone(reqStat3.Int()); |
3616 test(reqStat4==KErrArgument); |
3612 test_Value(reqStat4.Int(), reqStat4==KErrArgument); |
3617 file.Close(); |
3613 file.Close(); |
3618 |
3614 |
3619 // RFs::Rename() |
3615 // RFs::Rename() |
3620 test.Next(_L("RFs::Rename()")); |
3616 test.Next(_L("RFs::Rename()")); |
3621 path=_L("\\F32-TST\\NOTIFY\\"); |
3617 path=_L("\\F32-TST\\NOTIFY\\"); |
3622 fs.NotifyChange(ENotifyAll,reqStat,path); |
3618 fs.NotifyChange(ENotifyAll,reqStat,path); |
3623 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3619 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3624 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3620 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3625 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3621 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3626 |
3622 |
3627 test(reqStat==KRequestPending); |
3623 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3628 test(reqStat2==KRequestPending); |
3624 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3629 test(reqStat3==KRequestPending); |
3625 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3630 test(reqStat4==KRequestPending); |
3626 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3631 |
3627 |
3632 r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\NewFile.xyz"),_L("\\F32-TST\\NOTIFY\\NewerFile.cat")); |
3628 r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\NewFile.xyz"),_L("\\F32-TST\\NOTIFY\\NewerFile.cat")); |
3633 test_KErrNone(r); |
3629 test_KErrNone(r); |
3634 User::WaitForRequest(reqStat); |
3630 User::WaitForRequest(reqStat); |
3635 User::WaitForRequest(reqStat2); |
3631 User::WaitForRequest(reqStat2); |
3636 User::WaitForRequest(reqStat3); |
3632 User::WaitForRequest(reqStat3); |
3637 test(reqStat==KErrNone); |
3633 test_KErrNone(reqStat.Int()); |
3638 test(reqStat2==KErrNone); |
3634 test_KErrNone(reqStat2.Int()); |
3639 test(reqStat3==KErrNone); |
3635 test_KErrNone(reqStat3.Int()); |
3640 test(reqStat4==KRequestPending); // Changed a file not a directory entry |
3636 test_Value(reqStat4.Int(), reqStat4==KRequestPending); // Changed a file not a directory entry |
3641 fs.NotifyChangeCancel(); |
3637 fs.NotifyChangeCancel(); |
3642 |
3638 |
3643 test(reqStat==KErrNone); |
3639 test_KErrNone(reqStat.Int()); |
3644 test(reqStat2==KErrNone); |
3640 test_KErrNone(reqStat2.Int()); |
3645 test(reqStat3==KErrNone); |
3641 test_KErrNone(reqStat3.Int()); |
3646 User::WaitForRequest(reqStat4); |
3642 User::WaitForRequest(reqStat4); |
3647 test(reqStat4==KErrCancel); |
3643 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
3648 |
3644 |
3649 path=_L("\\F32-TST\\NOTIFY\\NewerFile.cat"); |
3645 path=_L("\\F32-TST\\NOTIFY\\NewerFile.cat"); |
3650 fs.NotifyChange(ENotifyAll,reqStat,path); |
3646 fs.NotifyChange(ENotifyAll,reqStat,path); |
3651 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3647 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3652 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3648 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3653 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3649 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3654 |
3650 |
3655 test(reqStat==KRequestPending); |
3651 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3656 test(reqStat2==KRequestPending); |
3652 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3657 test(reqStat3==KRequestPending); |
3653 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3658 User::WaitForRequest(reqStat4); |
3654 User::WaitForRequest(reqStat4); |
3659 test(reqStat4==KErrArgument); |
3655 test_Value(reqStat4.Int(), reqStat4==KErrArgument); |
3660 |
3656 |
3661 r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\NewerFile.cat"),_L("\\F32-TST\\NOTIFY\\Original.dog")); |
3657 r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\NewerFile.cat"),_L("\\F32-TST\\NOTIFY\\Original.dog")); |
3662 test_KErrNone(r); |
3658 test_KErrNone(r); |
3663 User::WaitForRequest(reqStat); |
3659 User::WaitForRequest(reqStat); |
3664 User::WaitForRequest(reqStat2); |
3660 User::WaitForRequest(reqStat2); |
3665 User::WaitForRequest(reqStat3); |
3661 User::WaitForRequest(reqStat3); |
3666 test(reqStat==KErrNone); |
3662 test_KErrNone(reqStat.Int()); |
3667 test(reqStat2==KErrNone); |
3663 test_KErrNone(reqStat2.Int()); |
3668 test(reqStat3==KErrNone); |
3664 test_KErrNone(reqStat3.Int()); |
3669 |
3665 |
3670 path=_L("\\F32-TST\\NOTIFY\\"); |
3666 path=_L("\\F32-TST\\NOTIFY\\"); |
3671 fs.NotifyChange(ENotifyAll,reqStat,path); |
3667 fs.NotifyChange(ENotifyAll,reqStat,path); |
3672 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3668 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3673 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3669 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3674 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3670 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3675 |
3671 |
3676 test(reqStat==KRequestPending); |
3672 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3677 test(reqStat2==KRequestPending); |
3673 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3678 test(reqStat3==KRequestPending); |
3674 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3679 test(reqStat4==KRequestPending); |
3675 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3680 |
3676 |
3681 r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\"),_L("\\F32-TST\\NOTIFY_TEMP\\")); |
3677 r=TheFs.Rename(_L("\\F32-TST\\NOTIFY\\"),_L("\\F32-TST\\NOTIFY_TEMP\\")); |
3682 test_KErrNone(r); |
3678 test_KErrNone(r); |
3683 User::WaitForRequest(reqStat); |
3679 User::WaitForRequest(reqStat); |
3684 User::WaitForRequest(reqStat2); |
3680 User::WaitForRequest(reqStat2); |
3685 User::WaitForRequest(reqStat3); |
3681 User::WaitForRequest(reqStat3); |
3686 User::WaitForRequest(reqStat4); |
3682 User::WaitForRequest(reqStat4); |
3687 test(reqStat==KErrNone); |
3683 test_KErrNone(reqStat.Int()); |
3688 test(reqStat2==KErrNone); |
3684 test_KErrNone(reqStat2.Int()); |
3689 test(reqStat3==KErrNone); // Changed a directory entry but notified anyway despite |
3685 test_KErrNone(reqStat3.Int()); // Changed a directory entry but notified anyway despite |
3690 test(reqStat4==KErrNone); // requesting file notification only because the path we |
3686 test_KErrNone(reqStat4.Int()); // requesting file notification only because the path we |
3691 // were monitoring has changed |
3687 // were monitoring has changed |
3692 |
3688 |
3693 path=_L("\\F32-TST\\NOTIFY_TEMP\\Original.dog"); |
3689 path=_L("\\F32-TST\\NOTIFY_TEMP\\Original.dog"); |
3694 fs.NotifyChange(ENotifyAll,reqStat,path); |
3690 fs.NotifyChange(ENotifyAll,reqStat,path); |
3695 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3691 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3696 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3692 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3697 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3693 fs.NotifyChange(ENotifyDir,reqStat4,path); |
3698 |
3694 |
3699 test(reqStat==KRequestPending); |
3695 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3700 test(reqStat2==KRequestPending); |
3696 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3701 test(reqStat3==KRequestPending); |
3697 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3702 User::WaitForRequest(reqStat4); |
3698 User::WaitForRequest(reqStat4); |
3703 test(reqStat4==KErrArgument); |
3699 test_Value(reqStat4.Int(), reqStat4==KErrArgument); |
3704 |
3700 |
3705 r=TheFs.Rename(_L("\\F32-TST\\NOTIFY_TEMP\\"),_L("\\F32-TST\\NOTIFY\\")); |
3701 r=TheFs.Rename(_L("\\F32-TST\\NOTIFY_TEMP\\"),_L("\\F32-TST\\NOTIFY\\")); |
3706 test_KErrNone(r); |
3702 test_KErrNone(r); |
3707 User::WaitForRequest(reqStat); |
3703 User::WaitForRequest(reqStat); |
3708 User::WaitForRequest(reqStat2); |
3704 User::WaitForRequest(reqStat2); |
3709 User::WaitForRequest(reqStat3); |
3705 User::WaitForRequest(reqStat3); |
3710 test(reqStat==KErrNone); // Modified a directory above the level at which we |
3706 test_KErrNone(reqStat.Int()); // Modified a directory above the level at which we |
3711 test(reqStat2==KErrNone); // are monitoring for changes - we must be notified |
3707 test_KErrNone(reqStat2.Int()); // are monitoring for changes - we must be notified |
3712 test(reqStat3==KErrNone); // anyway because the path has changed |
3708 test_KErrNone(reqStat3.Int()); // anyway because the path has changed |
3713 |
3709 |
3714 fs.NotifyChange(ENotifyAll,reqStat,path); |
3710 fs.NotifyChange(ENotifyAll,reqStat,path); |
3715 test(reqStat==KRequestPending); |
3711 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3716 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3712 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3717 test(reqStat2==KRequestPending); |
3713 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3718 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3714 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3719 test(reqStat3==KRequestPending); |
3715 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3720 |
3716 |
3721 fs.NotifyChangeCancel(reqStat); |
3717 fs.NotifyChangeCancel(reqStat); |
3722 User::WaitForRequest(reqStat); |
3718 User::WaitForRequest(reqStat); |
3723 test(reqStat==KErrCancel); |
3719 test_Value(reqStat.Int(), reqStat==KErrCancel); |
3724 fs.NotifyChangeCancel(reqStat2); |
3720 fs.NotifyChangeCancel(reqStat2); |
3725 User::WaitForRequest(reqStat2); |
3721 User::WaitForRequest(reqStat2); |
3726 test(reqStat2==KErrCancel); |
3722 test_Value(reqStat2.Int(), reqStat2==KErrCancel); |
3727 fs.NotifyChangeCancel(reqStat3); |
3723 fs.NotifyChangeCancel(reqStat3); |
3728 User::WaitForRequest(reqStat3); |
3724 User::WaitForRequest(reqStat3); |
3729 test(reqStat3==KErrCancel); |
3725 test_Value(reqStat3.Int(), reqStat3==KErrCancel); |
3730 |
3726 |
3731 path=_L("\\F32-TST\\NOTIFY\\Original.dog"); |
3727 path=_L("\\F32-TST\\NOTIFY\\Original.dog"); |
3732 fs.NotifyChange(ENotifyAll,reqStat,path); |
3728 fs.NotifyChange(ENotifyAll,reqStat,path); |
3733 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3729 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3734 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3730 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3735 |
3731 |
3736 test(reqStat==KRequestPending); |
3732 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3737 test(reqStat2==KRequestPending); |
3733 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3738 test(reqStat3==KRequestPending); |
3734 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3739 |
3735 |
3740 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Original.dog")); |
3736 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Original.dog")); |
3741 test_KErrNone(r); |
3737 test_KErrNone(r); |
3742 User::WaitForRequest(reqStat); |
3738 User::WaitForRequest(reqStat); |
3743 User::WaitForRequest(reqStat2); |
3739 User::WaitForRequest(reqStat2); |
3744 User::WaitForRequest(reqStat3); |
3740 User::WaitForRequest(reqStat3); |
3745 test(reqStat==KErrNone); |
3741 test_KErrNone(reqStat.Int()); |
3746 test(reqStat2==KErrNone); |
3742 test_KErrNone(reqStat2.Int()); |
3747 test(reqStat3==KErrNone); |
3743 test_KErrNone(reqStat3.Int()); |
3748 |
3744 |
3749 path=_L("\\F32-TST\\NOTIFY\\"); |
3745 path=_L("\\F32-TST\\NOTIFY\\"); |
3750 fs.NotifyChange(ENotifyAll,reqStat,path); |
3746 fs.NotifyChange(ENotifyAll,reqStat,path); |
3751 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3747 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3752 fs.NotifyChange(ENotifyDir,reqStat3,path); |
3748 fs.NotifyChange(ENotifyDir,reqStat3,path); |
3753 |
3749 |
3754 test(reqStat==KRequestPending); |
3750 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3755 test(reqStat2==KRequestPending); |
3751 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3756 test(reqStat3==KRequestPending); |
3752 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3757 |
3753 |
3758 r=TheFs.Rename(_L("\\F32-TST\\"),_L("\\F32-TEST\\")); |
3754 r=TheFs.Rename(_L("\\F32-TST\\"),_L("\\F32-TEST\\")); |
3759 test_KErrNone(r); |
3755 test_KErrNone(r); |
3760 User::WaitForRequest(reqStat); |
3756 User::WaitForRequest(reqStat); |
3761 User::WaitForRequest(reqStat2); |
3757 User::WaitForRequest(reqStat2); |
3762 User::WaitForRequest(reqStat3); |
3758 User::WaitForRequest(reqStat3); |
3763 test(reqStat==KErrNone); // Modified a directory above the level at which we |
3759 test_KErrNone(reqStat.Int()); // Modified a directory above the level at which we |
3764 test(reqStat2==KErrNone); // are monitoring for changes but we receive notification |
3760 test_KErrNone(reqStat2.Int()); // are monitoring for changes but we receive notification |
3765 test(reqStat3==KErrNone); // because the notification path has been changed |
3761 test_KErrNone(reqStat3.Int()); // because the notification path has been changed |
3766 |
3762 |
3767 fs.NotifyChange(ENotifyAll,reqStat,path); |
3763 fs.NotifyChange(ENotifyAll,reqStat,path); |
3768 // Notification request is submitted, despite the subject's disappearance |
3764 // Notification request is submitted, despite the subject's disappearance |
3769 test(reqStat==KRequestPending); |
3765 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3770 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3766 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3771 // Notification request is submitted, despite the subject's disappearance |
3767 // Notification request is submitted, despite the subject's disappearance |
3772 test(reqStat2==KRequestPending); |
3768 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3773 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3769 fs.NotifyChange(ENotifyFile,reqStat3,path); |
3774 // Notification request is submitted, despite the subject's disappearance |
3770 // Notification request is submitted, despite the subject's disappearance |
3775 test(reqStat3==KRequestPending); |
3771 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3776 |
3772 |
3777 fs.NotifyChangeCancel(reqStat); |
3773 fs.NotifyChangeCancel(reqStat); |
3778 User::WaitForRequest(reqStat); |
3774 User::WaitForRequest(reqStat); |
3779 test(reqStat==KErrCancel); |
3775 test_Value(reqStat.Int(), reqStat==KErrCancel); |
3780 fs.NotifyChangeCancel(reqStat2); |
3776 fs.NotifyChangeCancel(reqStat2); |
3781 User::WaitForRequest(reqStat2); |
3777 User::WaitForRequest(reqStat2); |
3782 test(reqStat2==KErrCancel); |
3778 test_Value(reqStat2.Int(), reqStat2==KErrCancel); |
3783 fs.NotifyChangeCancel(reqStat3); |
3779 fs.NotifyChangeCancel(reqStat3); |
3784 User::WaitForRequest(reqStat3); |
3780 User::WaitForRequest(reqStat3); |
3785 test(reqStat3==KErrCancel); |
3781 test_Value(reqStat3.Int(), reqStat3==KErrCancel); |
3786 |
3782 |
3787 path=_L("\\F32-TEST\\NOTIFY\\"); |
3783 path=_L("\\F32-TEST\\NOTIFY\\"); |
3788 fs.NotifyChange(ENotifyAll,reqStat,path); |
3784 fs.NotifyChange(ENotifyAll,reqStat,path); |
3789 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3785 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3790 fs.NotifyChange(ENotifyDir,reqStat3,path); |
3786 fs.NotifyChange(ENotifyDir,reqStat3,path); |
3791 |
3787 |
3792 test(reqStat==KRequestPending); |
3788 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3793 test(reqStat2==KRequestPending); |
3789 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3794 test(reqStat3==KRequestPending); |
3790 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3795 |
3791 |
3796 r=TheFs.Rename(_L("\\F32-TEST\\NOTIFY\\"),_L("\\F32-TEST\\NOTIFY_CHANGED\\")); |
3792 r=TheFs.Rename(_L("\\F32-TEST\\NOTIFY\\"),_L("\\F32-TEST\\NOTIFY_CHANGED\\")); |
3797 test_KErrNone(r); |
3793 test_KErrNone(r); |
3798 |
3794 |
3799 User::WaitForRequest(reqStat); |
3795 User::WaitForRequest(reqStat); |
3800 User::WaitForRequest(reqStat2); |
3796 User::WaitForRequest(reqStat2); |
3801 User::WaitForRequest(reqStat3); |
3797 User::WaitForRequest(reqStat3); |
3802 |
3798 |
3803 test(reqStat==KErrNone); // Rename the directory we were monitoring |
3799 test_KErrNone(reqStat.Int()); // Rename the directory we were monitoring |
3804 test(reqStat2==KErrNone); |
3800 test_KErrNone(reqStat2.Int()); |
3805 test(reqStat3==KErrNone); |
3801 test_KErrNone(reqStat3.Int()); |
3806 |
3802 |
3807 // Tidy up the test directory before continuing (while testing notifications of renaming to the monitored directory) |
3803 // Tidy up the test directory before continuing (while testing notifications of renaming to the monitored directory) |
3808 |
3804 |
3809 path=_L("\\F32-TST\\NOTIFY_CHANGED\\"); |
3805 path=_L("\\F32-TST\\NOTIFY_CHANGED\\"); |
3810 fs.NotifyChange(ENotifyAll,reqStat,path); |
3806 fs.NotifyChange(ENotifyAll,reqStat,path); |
3811 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3807 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3812 fs.NotifyChange(ENotifyDir,reqStat3,path); |
3808 fs.NotifyChange(ENotifyDir,reqStat3,path); |
3813 fs.NotifyChange(ENotifyFile,reqStat4,path); |
3809 fs.NotifyChange(ENotifyFile,reqStat4,path); |
3814 |
3810 |
3815 test(reqStat==KRequestPending); |
3811 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3816 test(reqStat2==KRequestPending); |
3812 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3817 test(reqStat3==KRequestPending); |
3813 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3818 test(reqStat4==KRequestPending); |
3814 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3819 |
3815 |
3820 r=TheFs.Rename(_L("\\F32-TEST\\"),_L("\\F32-TST\\")); |
3816 r=TheFs.Rename(_L("\\F32-TEST\\"),_L("\\F32-TST\\")); |
3821 test_KErrNone(r); |
3817 test_KErrNone(r); |
3822 |
3818 |
3823 User::WaitForRequest(reqStat); |
3819 User::WaitForRequest(reqStat); |
3824 User::WaitForRequest(reqStat2); |
3820 User::WaitForRequest(reqStat2); |
3825 User::WaitForRequest(reqStat3); |
3821 User::WaitForRequest(reqStat3); |
3826 |
3822 |
3827 test(reqStat==KErrNone); // Renaming to (under) the directory we were monitoring |
3823 test_KErrNone(reqStat.Int()); // Renaming to (under) the directory we were monitoring |
3828 test(reqStat2==KErrNone); |
3824 test_KErrNone(reqStat2.Int()); |
3829 test(reqStat3==KErrNone); |
3825 test_KErrNone(reqStat3.Int()); |
3830 test(reqStat4==KRequestPending); |
3826 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3831 |
3827 |
3832 fs.NotifyChangeCancel(reqStat4); |
3828 fs.NotifyChangeCancel(reqStat4); |
3833 User::WaitForRequest(reqStat4); |
3829 User::WaitForRequest(reqStat4); |
3834 test(reqStat4==KErrCancel); |
3830 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
3835 |
3831 |
3836 path=_L("\\F32-TST\\NOTIFY\\"); |
3832 path=_L("\\F32-TST\\NOTIFY\\"); |
3837 fs.NotifyChange(ENotifyAll,reqStat,path); |
3833 fs.NotifyChange(ENotifyAll,reqStat,path); |
3838 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3834 fs.NotifyChange(ENotifyEntry,reqStat2,path); |
3839 fs.NotifyChange(ENotifyDir,reqStat3,path); |
3835 fs.NotifyChange(ENotifyDir,reqStat3,path); |
3840 fs.NotifyChange(ENotifyFile,reqStat4,path); |
3836 fs.NotifyChange(ENotifyFile,reqStat4,path); |
3841 |
3837 |
3842 test(reqStat==KRequestPending); |
3838 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3843 test(reqStat2==KRequestPending); |
3839 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3844 test(reqStat3==KRequestPending); |
3840 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3845 test(reqStat4==KRequestPending); |
3841 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3846 |
3842 |
3847 r=TheFs.Rename(_L("\\F32-TST\\NOTIFY_CHANGED\\"),_L("\\F32-TST\\NOTIFY\\")); |
3843 r=TheFs.Rename(_L("\\F32-TST\\NOTIFY_CHANGED\\"),_L("\\F32-TST\\NOTIFY\\")); |
3848 test_KErrNone(r); |
3844 test_KErrNone(r); |
3849 |
3845 |
3850 User::WaitForRequest(reqStat); |
3846 User::WaitForRequest(reqStat); |
3851 User::WaitForRequest(reqStat2); |
3847 User::WaitForRequest(reqStat2); |
3852 User::WaitForRequest(reqStat3); |
3848 User::WaitForRequest(reqStat3); |
3853 |
3849 |
3854 test(reqStat==KErrNone); // Renaming to the directory we were monitoring |
3850 test_KErrNone(reqStat.Int()); // Renaming to the directory we were monitoring |
3855 test(reqStat2==KErrNone); |
3851 test_KErrNone(reqStat2.Int()); |
3856 test(reqStat3==KErrNone); |
3852 test_KErrNone(reqStat3.Int()); |
3857 test(reqStat4==KRequestPending); |
3853 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3858 |
3854 |
3859 fs.NotifyChangeCancel(reqStat4); |
3855 fs.NotifyChangeCancel(reqStat4); |
3860 User::WaitForRequest(reqStat4); |
3856 User::WaitForRequest(reqStat4); |
3861 test(reqStat4==KErrCancel); |
3857 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
3862 |
3858 |
3863 // Test combinations of notify types |
3859 // Test combinations of notify types |
3864 test.Next(_L("Test combinations of notify types")); |
3860 test.Next(_L("Test combinations of notify types")); |
3865 |
3861 |
3866 path=_L("\\F32-TST\\NOTIFY\\"); |
3862 path=_L("\\F32-TST\\NOTIFY\\"); |
3867 fs.NotifyChange(ENotifyAll,reqStat,path); |
3863 fs.NotifyChange(ENotifyAll,reqStat,path); |
3868 fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path); |
3864 fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path); |
3869 fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyFile),reqStat3,path); |
3865 fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyFile),reqStat3,path); |
3870 fs.NotifyChange((TNotifyType)(ENotifyDisk|ENotifyAttributes),reqStat4,path); |
3866 fs.NotifyChange((TNotifyType)(ENotifyDisk|ENotifyAttributes),reqStat4,path); |
3871 |
3867 |
3872 test(reqStat==KRequestPending); |
3868 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3873 test(reqStat2==KRequestPending); |
3869 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3874 test(reqStat3==KRequestPending); |
3870 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3875 test(reqStat4==KRequestPending); |
3871 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3876 |
3872 |
3877 r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite); |
3873 r=file.Create(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite); |
3878 test_KErrNone(r); |
3874 test_KErrNone(r); |
3879 User::WaitForRequest(reqStat); |
3875 User::WaitForRequest(reqStat); |
3880 User::WaitForRequest(reqStat2); |
3876 User::WaitForRequest(reqStat2); |
3881 User::WaitForRequest(reqStat3); |
3877 User::WaitForRequest(reqStat3); |
3882 test(reqStat==KErrNone); |
3878 test_KErrNone(reqStat.Int()); |
3883 test(reqStat2==KErrNone); |
3879 test_KErrNone(reqStat2.Int()); |
3884 test(reqStat3==KErrNone); |
3880 test_KErrNone(reqStat3.Int()); |
3885 test(reqStat4==KRequestPending); // Monitoring ENotifyAttributes|ENotifyDisk |
3881 test_Value(reqStat4.Int(), reqStat4==KRequestPending); // Monitoring ENotifyAttributes|ENotifyDisk |
3886 file.Close(); |
3882 file.Close(); |
3887 fs.NotifyChangeCancel(reqStat4); |
3883 fs.NotifyChangeCancel(reqStat4); |
3888 User::WaitForRequest(reqStat4); |
3884 User::WaitForRequest(reqStat4); |
3889 test(reqStat4==KErrCancel); |
3885 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
3890 |
3886 |
3891 // RFile::SetModified() |
3887 // RFile::SetModified() |
3892 fs.NotifyChange(ENotifyAll,reqStat,path); |
3888 fs.NotifyChange(ENotifyAll,reqStat,path); |
3893 fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path); |
3889 fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path); |
3894 fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyFile),reqStat3,path); |
3890 fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyFile),reqStat3,path); |
3895 fs.NotifyChange((TNotifyType)(ENotifyDisk|ENotifyAttributes),reqStat4,path); |
3891 fs.NotifyChange((TNotifyType)(ENotifyDisk|ENotifyAttributes),reqStat4,path); |
3896 |
3892 |
3897 test(reqStat==KRequestPending); |
3893 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3898 test(reqStat2==KRequestPending); |
3894 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3899 test(reqStat3==KRequestPending); |
3895 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3900 test(reqStat4==KRequestPending); |
3896 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3901 |
3897 |
3902 TTime nowTime; |
3898 TTime nowTime; |
3903 nowTime.HomeTime(); |
3899 nowTime.HomeTime(); |
3904 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite); |
3900 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite); |
3905 test_KErrNone(r); |
3901 test_KErrNone(r); |
3906 test(reqStat==KRequestPending); |
3902 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3907 file.SetModified(now); |
3903 file.SetModified(now); |
3908 file.Close(); |
3904 file.Close(); |
3909 User::WaitForRequest(reqStat); |
3905 User::WaitForRequest(reqStat); |
3910 User::WaitForRequest(reqStat2); |
3906 User::WaitForRequest(reqStat2); |
3911 User::WaitForRequest(reqStat4); |
3907 User::WaitForRequest(reqStat4); |
3912 test(reqStat==KErrNone); |
3908 test_KErrNone(reqStat.Int()); |
3913 test(reqStat2==KErrNone); |
3909 test_KErrNone(reqStat2.Int()); |
3914 test(reqStat3==KRequestPending); |
3910 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3915 test(reqStat4==KErrNone); |
3911 test_KErrNone(reqStat4.Int()); |
3916 fs.NotifyChangeCancel(); |
3912 fs.NotifyChangeCancel(); |
3917 User::WaitForRequest(reqStat3); |
3913 User::WaitForRequest(reqStat3); |
3918 test(reqStat3==KErrCancel); |
3914 test_Value(reqStat3.Int(), reqStat3==KErrCancel); |
3919 |
3915 |
3920 // RFile::Write() |
3916 // RFile::Write() |
3921 fs.NotifyChange(ENotifyAll,reqStat,path); |
3917 fs.NotifyChange(ENotifyAll,reqStat,path); |
3922 fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path); |
3918 fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path); |
3923 fs.NotifyChange((TNotifyType)(ENotifyFile|ENotifyWrite),reqStat3,path); |
3919 fs.NotifyChange((TNotifyType)(ENotifyFile|ENotifyWrite),reqStat3,path); |
3924 fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyWrite),reqStat4,path); |
3920 fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyWrite),reqStat4,path); |
3925 |
3921 |
3926 test(reqStat==KRequestPending); |
3922 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3927 test(reqStat2==KRequestPending); |
3923 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3928 test(reqStat3==KRequestPending); |
3924 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3929 test(reqStat4==KRequestPending); |
3925 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3930 |
3926 |
3931 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite); |
3927 r=file.Open(TheFs,_L("\\F32-TST\\NOTIFY\\Munchkin.msg"),EFileRead|EFileWrite); |
3932 test_KErrNone(r); |
3928 test_KErrNone(r); |
3933 r=file.Write(0,_L8("Pay no attention to the man behind the curtain")); |
3929 r=file.Write(0,_L8("Pay no attention to the man behind the curtain")); |
3934 file.Close(); |
3930 file.Close(); |
3935 User::WaitForRequest(reqStat); |
3931 User::WaitForRequest(reqStat); |
3936 User::WaitForRequest(reqStat3); |
3932 User::WaitForRequest(reqStat3); |
3937 User::WaitForRequest(reqStat4); |
3933 User::WaitForRequest(reqStat4); |
3938 test(reqStat==KErrNone); |
3934 test_KErrNone(reqStat.Int()); |
3939 test(reqStat2==KRequestPending); |
3935 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3940 test(reqStat3==KErrNone); |
3936 test_KErrNone(reqStat3.Int()); |
3941 test(reqStat4==KErrNone); |
3937 test_KErrNone(reqStat4.Int()); |
3942 fs.NotifyChangeCancel(reqStat2); // Cancels all outstanding notification requests |
3938 fs.NotifyChangeCancel(reqStat2); // Cancels all outstanding notification requests |
3943 User::WaitForRequest(reqStat2); |
3939 User::WaitForRequest(reqStat2); |
3944 test(reqStat2==KErrCancel); |
3940 test_Value(reqStat2.Int(), reqStat2==KErrCancel); |
3945 |
3941 |
3946 // RFs::Delete() |
3942 // RFs::Delete() |
3947 test.Next(_L("RFs::Delete()")); |
3943 test.Next(_L("RFs::Delete()")); |
3948 fs.NotifyChange(ENotifyAll,reqStat,path); |
3944 fs.NotifyChange(ENotifyAll,reqStat,path); |
3949 fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path); |
3945 fs.NotifyChange((TNotifyType)(KGenericEntryChange|ENotifyAttributes),reqStat2,path); |
3950 fs.NotifyChange((TNotifyType)(ENotifyFile|ENotifyWrite),reqStat3,path); |
3946 fs.NotifyChange((TNotifyType)(ENotifyFile|ENotifyWrite),reqStat3,path); |
3951 fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyWrite),reqStat4,path); |
3947 fs.NotifyChange((TNotifyType)(ENotifyDir|ENotifyWrite),reqStat4,path); |
3952 |
3948 |
3953 test(reqStat==KRequestPending); |
3949 test_Value(reqStat.Int(), reqStat==KRequestPending); |
3954 test(reqStat2==KRequestPending); |
3950 test_Value(reqStat2.Int(), reqStat2==KRequestPending); |
3955 test(reqStat3==KRequestPending); |
3951 test_Value(reqStat3.Int(), reqStat3==KRequestPending); |
3956 test(reqStat4==KRequestPending); |
3952 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3957 |
3953 |
3958 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Munchkin.msg")); |
3954 r=TheFs.Delete(_L("\\F32-TST\\NOTIFY\\Munchkin.msg")); |
3959 test_KErrNone(r); |
3955 test_KErrNone(r); |
3960 User::WaitForRequest(reqStat); |
3956 User::WaitForRequest(reqStat); |
3961 User::WaitForRequest(reqStat2); |
3957 User::WaitForRequest(reqStat2); |
3962 User::WaitForRequest(reqStat3); |
3958 User::WaitForRequest(reqStat3); |
3963 test(reqStat==KErrNone); |
3959 test_KErrNone(reqStat.Int()); |
3964 test(reqStat2==KErrNone); |
3960 test_KErrNone(reqStat2.Int()); |
3965 test(reqStat3==KErrNone); |
3961 test_KErrNone(reqStat3.Int()); |
3966 test(reqStat4==KRequestPending); |
3962 test_Value(reqStat4.Int(), reqStat4==KRequestPending); |
3967 fs.NotifyChangeCancel(reqStat4); |
3963 fs.NotifyChangeCancel(reqStat4); |
3968 User::WaitForRequest(reqStat4); |
3964 User::WaitForRequest(reqStat4); |
3969 test(reqStat4==KErrCancel); |
3965 test_Value(reqStat4.Int(), reqStat4==KErrCancel); |
3970 |
3966 |
3971 fs.Close(); |
3967 fs.Close(); |
3972 } |
3968 } |
3973 |
3969 |
3974 #if defined __EPOC32__ && defined __INCLUDE_MANUAL_TESTS__ |
3970 #if defined __EPOC32__ && defined __INCLUDE_MANUAL_TESTS__ |