kerneltest/f32test/loader/t_ldrtst.cpp
changeset 285 ff5437e4337c
parent 189 a5496987b1da
equal deleted inserted replaced
280:2bfb1feef9de 285:ff5437e4337c
  1156 	hashDir[0] = (TUint8) RFs::GetSystemDriveChar();
  1156 	hashDir[0] = (TUint8) RFs::GetSystemDriveChar();
  1157 
  1157 
  1158 	TInt r = Fs.MkDirAll(hashDir);
  1158 	TInt r = Fs.MkDirAll(hashDir);
  1159 	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
  1159 	test_Value(r, r == KErrNone || r == KErrAlreadyExists);
  1160 
  1160 
       
  1161 	TBool removableDrivePresent = EFalse;
       
  1162 
  1161 	for (TInt d = 0; d <= (TInt)sizeof(SpecialDriveList); ++d)
  1163 	for (TInt d = 0; d <= (TInt)sizeof(SpecialDriveList); ++d)
  1162 		{
  1164 		{
  1163 		TInt dr = SpecialDriveList[d];
  1165 		TInt dr = SpecialDriveList[d];
  1164 		TDriveInfo di;
  1166 		TDriveInfo di;
  1165 		test.Printf(_L("Drive %d\n"), dr);
  1167 		test.Printf(_L("Drive %d\n"), dr);
  1166 		test(Fs.Drive(di, dr) == KErrNone);
  1168 		test(Fs.Drive(di, dr) == KErrNone);
       
  1169 
       
  1170 		if (di.iDriveAtt & KDriveAttRemovable)
       
  1171 			removableDrivePresent = ETrue;
  1167 		if (di.iType == EMediaNotPresent)
  1172 		if (di.iType == EMediaNotPresent)
  1168 			continue;
  1173 			continue;
  1169 		
  1174 		
  1170 		TChar ch0;
  1175 		TChar ch0;
  1171 		test(RFs::DriveToChar(dr, ch0) == KErrNone);
  1176 		test(RFs::DriveToChar(dr, ch0) == KErrNone);
  1192 		fn.Append(ch);
  1197 		fn.Append(ch);
  1193 		fn.Append(_L(":\\sys\\bin\\"));
  1198 		fn.Append(_L(":\\sys\\bin\\"));
  1194 		r = Fs.MkDirAll(fn);
  1199 		r = Fs.MkDirAll(fn);
  1195 		test.Printf(_L("MkDirAll %S returns %d\n"), &fn, r);
  1200 		test.Printf(_L("MkDirAll %S returns %d\n"), &fn, r);
  1196 		test_Value(r, r == KErrNone || r == KErrAlreadyExists);
  1201 		test_Value(r, r == KErrNone || r == KErrAlreadyExists);
       
  1202 		}
       
  1203 
       
  1204 	if (removableDrivePresent)
       
  1205 		{
       
  1206 		if (!NoRemovable && SpecialDrives[1] == '!')
       
  1207 			{
       
  1208 			test.Printf(_L("Removable drive present but empty - please insert a card...\n"));
       
  1209 			test(0);
       
  1210 			}
       
  1211 		}
       
  1212 	else
       
  1213 		{
       
  1214 		if (!NoRemovable)
       
  1215 			{
       
  1216 			NoRemovable = ETrue;
       
  1217 			test.Printf(_L("Updated NoRemovable=1 due to having no removable drives\n"));
       
  1218 			}
  1197 		}
  1219 		}
  1198 	}
  1220 	}
  1199 
  1221 
  1200 void GetNonZFileName(const TDesC& aOrigName, TDes& aNonZName)
  1222 void GetNonZFileName(const TDesC& aOrigName, TDes& aNonZName)
  1201 /**
  1223 /**