Index: /pjproject/trunk/build.symbian/00.bat
===================================================================
--- /pjproject/trunk/build.symbian/00.bat	(revision 1237)
+++ /pjproject/trunk/build.symbian/00.bat	(revision 1238)
@@ -1,4 +1,5 @@
 rem set MWSym2Libraries=1
-set EPOCROOT=\Symbian\9.1\S60_3rd_MR_2\
+set EPOCROOT=\Symbian\9.1\S60_3rd\
+rem set EPOCROOT=\Symbian\9.1\S60_3rd_MR_2\
 rem set EPOCROOT=\Symbian\UIQ3SDK\
 bldmake bldfiles
Index: /pjproject/trunk/build.symbian/01.bat
===================================================================
--- /pjproject/trunk/build.symbian/01.bat	(revision 1237)
+++ /pjproject/trunk/build.symbian/01.bat	(revision 1238)
@@ -2,4 +2,5 @@
 rem set MWSym2Libraries=\Symbian\9.1\S60_3rd\Epoc32\release\winscw\udeb
 
-set EPOCROOT=\Symbian\9.1\S60_3rd_MR_2\
+set EPOCROOT=\Symbian\9.1\S60_3rd\
+rem set EPOCROOT=\Symbian\9.1\S60_3rd_MR_2\
 call abld build -v vs6 udeb
Index: /pjproject/trunk/build.symbian/pjlib_test.mmp
===================================================================
--- /pjproject/trunk/build.symbian/pjlib_test.mmp	(revision 1237)
+++ /pjproject/trunk/build.symbian/pjlib_test.mmp	(revision 1238)
@@ -46,4 +46,5 @@
 SOURCE	main_symbian.cpp
 
+DOCUMENT test.h
 
 SYSTEMINCLUDE	..\pjlib\include
Index: /pjproject/trunk/pjlib/src/pjlib-test/errno.c
===================================================================
--- /pjproject/trunk/pjlib/src/pjlib-test/errno.c	(revision 1237)
+++ /pjproject/trunk/pjlib/src/pjlib-test/errno.c	(revision 1238)
@@ -103,5 +103,5 @@
      * Unix errors
      */
-#   ifdef EINVAL
+#   if defined(EINVAL) && !defined(PJ_SYMBIAN)
     rc = PJ_STATUS_FROM_OS(EINVAL);
     pj_set_os_error(rc);
Index: /pjproject/trunk/pjlib/src/pjlib-test/ioq_tcp.c
===================================================================
--- /pjproject/trunk/pjlib/src/pjlib-test/ioq_tcp.c	(revision 1237)
+++ /pjproject/trunk/pjlib/src/pjlib-test/ioq_tcp.c	(revision 1238)
@@ -537,5 +537,9 @@
 static int compliance_test_2(void)
 {
+#if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
+    enum { MAX_PAIR = 1, TEST_LOOP = 2 };
+#else
     enum { MAX_PAIR = 4, TEST_LOOP = 2 };
+#endif
 
     struct listener
Index: /pjproject/trunk/pjlib/src/pjlib-test/pool_perf.c
===================================================================
--- /pjproject/trunk/pjlib/src/pjlib-test/pool_perf.c	(revision 1237)
+++ /pjproject/trunk/pjlib/src/pjlib-test/pool_perf.c	(revision 1238)
@@ -61,4 +61,33 @@
 }
 
+/* Symbian doesn't have malloc()/free(), so we use new/delete instead */
+#if defined(PJ_SYMBIAN) && PJ_SYMBIAN != 0
+
+static int pool_test_malloc_free()
+{
+    int i; /* must be signed */
+
+    for (i=0; i<COUNT; ++i) {
+	p[i] = new char[sizes[i]];
+	if (!p[i]) {
+	    PJ_LOG(3,(THIS_FILE,"   error: malloc failed to allocate %d bytes",
+		      sizes[i]));
+	    --i;
+	    while (i >= 0)
+		delete [] p[i], --i;
+	    return -1;
+	}
+	*p[i] = '\0';
+    }
+
+    for (i=0; i<COUNT; ++i) {
+	delete [] p[i];
+    }
+
+    return 0;
+}
+
+#else	/* PJ_SYMBIAN */
+
 static int pool_test_malloc_free()
 {
@@ -84,4 +113,6 @@
     return 0;
 }
+
+#endif /* PJ_SYMBIAN */
 
 int pool_perf_test()
@@ -141,4 +172,8 @@
     else
 	best = pool_time2, worst = pool_time;
+    
+    /* avoid division by zero */
+    if (best==0) best=1;
+    if (worst==0) worst=1;
 
     PJ_LOG(3, (THIS_FILE, "..pool speedup over malloc best=%dx, worst=%dx", 
Index: /pjproject/trunk/pjlib/src/pjlib-test/sock.c
===================================================================
--- /pjproject/trunk/pjlib/src/pjlib-test/sock.c	(revision 1237)
+++ /pjproject/trunk/pjlib/src/pjlib-test/sock.c	(revision 1238)
@@ -370,6 +370,9 @@
 	goto on_error;
 
-// This test will fail on S60 3rd Edition MR2
-#if 0
+    /* Disable this test on Symbian since UDP connect()/send() failed
+     * with S60 3rd edition (including MR2).
+     * See http://www.pjsip.org/trac/ticket/264
+     */    
+#if !defined(PJ_SYMBIAN) || PJ_SYMBIAN==0
     /* connect() the sockets. */
     rc = pj_sock_connect(cs, &dstaddr, sizeof(dstaddr));
Index: /pjproject/trunk/pjlib/src/pjlib-test/sock_perf.c
===================================================================
--- /pjproject/trunk/pjlib/src/pjlib-test/sock_perf.c	(revision 1237)
+++ /pjproject/trunk/pjlib/src/pjlib-test/sock_perf.c	(revision 1238)
@@ -159,9 +159,15 @@
     PJ_LOG(3,("", "...benchmarking socket "
                   "(2 sockets, packet=512, single threaded):"));
-    
+
+    /* Disable this test on Symbian since UDP connect()/send() failed
+     * with S60 3rd edition (including MR2).
+     * See http://www.pjsip.org/trac/ticket/264
+     */    
+#if !defined(PJ_SYMBIAN) || PJ_SYMBIAN==0
     /* Benchmarking UDP */
     rc = sock_producer_consumer(PJ_SOCK_DGRAM, 512, LOOP, &bandwidth);
     if (rc != 0) return rc;
     PJ_LOG(3,("", "....bandwidth UDP = %d KB/s", bandwidth));
+#endif
 
     /* Benchmarking TCP */
Index: /pjproject/trunk/pjlib/src/pjlib-test/test.h
===================================================================
--- /pjproject/trunk/pjlib/src/pjlib-test/test.h	(revision 1237)
+++ /pjproject/trunk/pjlib/src/pjlib-test/test.h	(revision 1238)
@@ -22,7 +22,7 @@
 #include <pj/types.h>
 
-#define GROUP_LIBC                  0
-#define GROUP_OS                    0
-#define GROUP_DATA_STRUCTURE        0
+#define GROUP_LIBC                  1
+#define GROUP_OS                    1
+#define GROUP_DATA_STRUCTURE        1
 #define GROUP_NETWORK               1
 #if defined(PJ_SYMBIAN)
@@ -32,9 +32,5 @@
 #endif
 
-#if defined(PJ_SYMBIAN)
-#   define INCLUDE_ERRNO_TEST       0
-#else
-#   define INCLUDE_ERRNO_TEST       GROUP_LIBC
-#endif
+#define INCLUDE_ERRNO_TEST          GROUP_LIBC
 #define INCLUDE_TIMESTAMP_TEST      GROUP_OS
 #define INCLUDE_EXCEPTION_TEST	    GROUP_LIBC
@@ -42,5 +38,5 @@
 #define INCLUDE_LIST_TEST	    GROUP_DATA_STRUCTURE
 #define INCLUDE_POOL_TEST	    GROUP_LIBC
-#define INCLUDE_POOL_PERF_TEST	    (PJ_HAS_MALLOC && GROUP_LIBC)
+#define INCLUDE_POOL_PERF_TEST	    GROUP_LIBC
 #define INCLUDE_STRING_TEST	    GROUP_DATA_STRUCTURE
 #define INCLUDE_FIFOBUF_TEST	    0	// GROUP_DATA_STRUCTURE
@@ -52,9 +48,5 @@
 #define INCLUDE_THREAD_TEST         (PJ_HAS_THREADS && GROUP_OS)
 #define INCLUDE_SOCK_TEST	    GROUP_NETWORK
-#if defined(PJ_SYMBIAN)
-#   define INCLUDE_SOCK_PERF_TEST   0
-#else
-#   define INCLUDE_SOCK_PERF_TEST   GROUP_NETWORK
-#endif
+#define INCLUDE_SOCK_PERF_TEST	    GROUP_NETWORK
 #define INCLUDE_SELECT_TEST	    GROUP_NETWORK
 #define INCLUDE_UDP_IOQUEUE_TEST    GROUP_NETWORK
