stif/TestInterface/src/TestModuleIf.cpp
branchRCL_3
changeset 11 cfe32394fcd5
parent 0 a03f92240627
child 25 9aaae25af322
--- a/stif/TestInterface/src/TestModuleIf.cpp	Mon Mar 15 12:46:13 2010 +0200
+++ b/stif/TestInterface/src/TestModuleIf.cpp	Thu Apr 01 00:00:49 2010 +0300
@@ -279,6 +279,13 @@
     VA_LIST list;
     VA_START(list,aFmt);
     TName aBuf;
+    RBuf buf;
+    TInt ret = buf.Create(1024);
+    if(ret != KErrNone)
+        {
+        __RDEBUG((_L("STF: Printf: Buffer creation failed [%d]"), ret));
+        return;
+        }
 
     // Cut the description length
     TInt len = aDefinition.Length();
@@ -293,9 +300,17 @@
     TDesOverflowHandler overFlowHandler (this, aPriority, shortDescription);
 
     // Parse parameters
-    aBuf.AppendFormatList(aFmt,list, &overFlowHandler);        
+    buf.AppendFormatList(aFmt, list, &overFlowHandler);
+    
+    if(buf.Length() == 0)
+        {
+        __RDEBUG((_L("STF: Printf: Unable to prepare print buffer (probably printed string is too long)")));
+        }
 
     // Print
+    aBuf.Copy(buf.Left(aBuf.MaxLength()));
+    buf.Close();
+
     iTestExecution->DoNotifyPrint( aPriority, shortDescription, aBuf );
 
     }