kerneltest/f32test/filesystem/fat/t_scn32dr1.cpp
branchRCL_3
changeset 42 a179b74831c9
parent 21 e7d2d738d3c2
child 43 c1f20ce4abcf
--- a/kerneltest/f32test/filesystem/fat/t_scn32dr1.cpp	Thu Jul 15 20:11:42 2010 +0300
+++ b/kerneltest/f32test/filesystem/fat/t_scn32dr1.cpp	Thu Aug 19 11:14:22 2010 +0300
@@ -580,6 +580,18 @@
     aName.SetLength(i);
     }
 
+TDes& MakePrintable(TDes& aDes)
+	{
+	TInt len = aDes.Length();
+
+	for (TInt i=0; i<len; i++)
+		{
+		if ((TUint8) aDes[i] < 0x20)
+			aDes[i] = '?';
+		}
+	return aDes;
+	}
+
 GLDEF_C TBool DumpDirEntry(TInt aNum, const TUint8* aEntry)
 //
 // Dump a single directory entry to the log.  Return false if it was end of
@@ -603,9 +615,9 @@
         ExtractNameString(name, aEntry);
         TInt ord = aEntry[0];
         if (ord & KDirLastLongEntry)
-            RDebug::Print(_L("%5d: %-15S #%-2d LAST"), aNum, &name, ord & ~KDirLastLongEntry);
+            RDebug::Print(_L("%5d: %-15S #%-2d LAST"), aNum, &MakePrintable(name), ord & ~KDirLastLongEntry);
         else
-            RDebug::Print(_L("%5d: %-15S #%-2d"), aNum, &name, ord & ~KDirLastLongEntry);
+            RDebug::Print(_L("%5d: %-15S #%-2d"), aNum, &MakePrintable(name), ord & ~KDirLastLongEntry);
         }
     else if (!IsValidDirEntry(d))
         {
@@ -618,7 +630,7 @@
         TBuf<11> name;
         name.Copy(d->Name());
         RDebug::Print(_L("%5d: '%S'   %S  start %-5d size %d"),
-                      aNum, &name, DirAttributes(d->Attributes()), d->StartCluster(), d->Size());
+                      aNum, &MakePrintable(name), DirAttributes(d->Attributes()), d->StartCluster(), d->Size());
         }
     return ETrue;
     }