Index: pjproject/trunk/pjlib/src/pjlib-test/main_symbian.cpp
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/main_symbian.cpp	(revision 2768)
+++ pjproject/trunk/pjlib/src/pjlib-test/main_symbian.cpp	(revision 2769)
@@ -45,19 +45,4 @@
 
 
-//  Local Functions
-
-LOCAL_C void MainL()
-{
-    //
-    // add your program code here, example code below
-    //
-    test_main();
-
-    console->Printf(_L(" [press any key]\n"));
-    console->Getch();
-
-    CActiveScheduler::Stop();
-}
-
 class MyScheduler : public CActiveScheduler
 {
@@ -74,65 +59,4 @@
 }
 
-class ProgramStarter : public CActive
-{
-public:
-    static ProgramStarter *NewL();
-    void Start();
-
-protected:
-    ProgramStarter();
-    void ConstructL();
-    virtual void RunL();
-    virtual void DoCancel();
-    TInt RunError(TInt aError);
-
-private:
-    RTimer timer_;
-};
-
-ProgramStarter::ProgramStarter()
-: CActive(EPriorityNormal)
-{
-}
-
-void ProgramStarter::ConstructL()
-{
-    timer_.CreateLocal();
-    CActiveScheduler::Add(this);
-}
-
-ProgramStarter *ProgramStarter::NewL()
-{
-    ProgramStarter *self = new (ELeave) ProgramStarter;
-    CleanupStack::PushL(self);
-
-    self->ConstructL();
-
-    CleanupStack::Pop(self);
-    return self;
-}
-
-void ProgramStarter::Start()
-{
-    timer_.After(iStatus, 0);
-    SetActive();
-}
-
-void ProgramStarter::RunL()
-{
-    MainL();
-}
-
-void ProgramStarter::DoCancel()
-{
-}
-
-TInt ProgramStarter::RunError(TInt aError)
-{
-    PJ_UNUSED_ARG(aError);
-    return KErrNone;
-}
-
-
 LOCAL_C void DoStartL()
     {
@@ -142,23 +66,34 @@
     CActiveScheduler::Install(scheduler);
 
-    ProgramStarter *starter = ProgramStarter::NewL();
-    starter->Start();
+    test_main();
 
-    CActiveScheduler::Start();
+    CActiveScheduler::Install(NULL);
+    CleanupStack::Pop(scheduler);
+    delete scheduler;
     }
 
+#define WRITE_TO_DEBUG_CONSOLE
+
+#ifdef WRITE_TO_DEBUG_CONSOLE
+#include<e32debug.h>
+#endif
 
 //  Global Functions
-
 static void log_writer(int level, const char *buf, int len)
 {
-    wchar_t buf16[PJ_LOG_MAX_SIZE];
+    static wchar_t buf16[PJ_LOG_MAX_SIZE];
 
     PJ_UNUSED_ARG(level);
     
     pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16));
-
+    buf16[len] = 0;
+    buf16[len+1] = 0;
+    
     TPtrC16 aBuf((const TUint16*)buf16, (TInt)len);
     console->Write(aBuf);
+    
+#ifdef WRITE_TO_DEBUG_CONSOLE
+    RDebug::Print(aBuf);
+#endif
 }
 
@@ -181,4 +116,5 @@
     if (mainError)
         console->Printf(_L(" failed, leave code = %d"), mainError);
+    
     console->Printf(_L(" [press any key]\n"));
     console->Getch();
@@ -186,5 +122,9 @@
     delete console;
     delete cleanup;
+    
+    CloseSTDLIB(); 
+    
     __UHEAP_MARKEND;
+    
     return KErrNone;
     }
Index: pjproject/trunk/pjlib/src/pjlib-test/string.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/string.c	(revision 2768)
+++ pjproject/trunk/pjlib/src/pjlib-test/string.c	(revision 2769)
@@ -66,5 +66,7 @@
 
 #define HELLO_WORLD	"Hello World"
+#define HELLO_WORLD_LEN	11
 #define JUST_HELLO	"Hello"
+#define JUST_HELLO_LEN	5
 #define UL_VALUE	3456789012UL
 
@@ -291,6 +293,6 @@
 int string_test(void)
 {
-    const pj_str_t hello_world = { HELLO_WORLD, strlen(HELLO_WORLD) };
-    const pj_str_t just_hello = { JUST_HELLO, strlen(JUST_HELLO) };
+    const pj_str_t hello_world = { HELLO_WORLD, HELLO_WORLD_LEN };
+    const pj_str_t just_hello = { JUST_HELLO, JUST_HELLO_LEN };
     pj_str_t s1, s2, s3, s4, s5;
     enum { RCOUNT = 10, RLEN = 16 };
Index: pjproject/trunk/pjlib/src/pjlib-test/test.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/test.c	(revision 2768)
+++ pjproject/trunk/pjlib/src/pjlib-test/test.c	(revision 2769)
@@ -198,4 +198,7 @@
     else
 	PJ_LOG(3,("test", "Test completed with error(s)"));
+    
+    pj_shutdown();
+    
     return 0;
 }
