Index: /pjproject/trunk/pjsip/src/test-pjsip/test.c
===================================================================
--- /pjproject/trunk/pjsip/src/test-pjsip/test.c	(revision 554)
+++ /pjproject/trunk/pjsip/src/test-pjsip/test.c	(revision 555)
@@ -126,13 +126,31 @@
     }
 
+#if INCLUDE_URI_TEST
     DO_TEST(uri_test());
+#endif
+
+#if INCLUDE_MSG_TEST
     DO_TEST(msg_test());
     DO_TEST(msg_err_test());
+#endif
+
+#if INCLUDE_TXDATA_TEST
     DO_TEST(txdata_test());
+#endif
+
+#if INCLUDE_UDP_TEST
     DO_TEST(transport_udp_test());
+#endif
+
+#if INCLUDE_LOOP_TEST
     DO_TEST(transport_loop_test());
+#endif
+
+#if INCLUDE_TSX_TEST
     DO_TEST(tsx_basic_test());
     DO_TEST(tsx_uac_test());
     DO_TEST(tsx_uas_test());
+#endif
+
 
 on_return:
Index: /pjproject/trunk/pjsip/src/test-pjsip/test.h
===================================================================
--- /pjproject/trunk/pjsip/src/test-pjsip/test.h	(revision 554)
+++ /pjproject/trunk/pjsip/src/test-pjsip/test.h	(revision 555)
@@ -26,4 +26,20 @@
 #define TEST_UDP_PORT	    15060
 #define TEST_UDP_PORT_STR   "15060"
+
+
+#define INCLUDE_MESSAGING_GROUP	    1
+#define INCLUDE_TRANSPORT_GROUP	    1
+#define INCLUDE_TSX_GROUP	    1
+
+
+
+#define INCLUDE_URI_TEST	INCLUDE_MESSAGING_GROUP
+#define INCLUDE_MSG_TEST	INCLUDE_MESSAGING_GROUP
+#define INCLUDE_TXDATA_TEST	INCLUDE_MESSAGING_GROUP
+#define INCLUDE_UDP_TEST	INCLUDE_TRANSPORT_GROUP
+#define INCLUDE_LOOP_TEST	INCLUDE_TRANSPORT_GROUP
+#define INCLUDE_TSX_TEST	INCLUDE_TSX_GROUP
+
+
 
 /* The tests */
Index: /pjproject/trunk/pjsip/src/test-pjsip/tsx_uac_test.c
===================================================================
--- /pjproject/trunk/pjsip/src/test-pjsip/tsx_uac_test.c	(revision 554)
+++ /pjproject/trunk/pjsip/src/test-pjsip/tsx_uac_test.c	(revision 555)
@@ -947,9 +947,9 @@
     // Ignore send result. Some tests do deliberately triggers error
     // when sending message.
-    //if (status != PJ_SUCCESS) {
-    //	app_perror("   Error: unable to send request", status);
-    //  pjsip_tx_data_dec_ref(tdata);
-    //	return -120;
-    //}
+    if (status != PJ_SUCCESS) {
+	// app_perror("   Error: unable to send request", status);
+        pjsip_tx_data_dec_ref(tdata);
+	// return -120;
+    }
 
 
Index: /pjproject/trunk/pjsip/src/test-pjsip/tsx_uas_test.c
===================================================================
--- /pjproject/trunk/pjsip/src/test-pjsip/tsx_uas_test.c	(revision 554)
+++ /pjproject/trunk/pjsip/src/test-pjsip/tsx_uas_test.c	(revision 555)
@@ -445,9 +445,14 @@
 	 * TEST4_BRANCH_ID tests receiving retransmissions in TRYING state.
 	 */
-	if (tsx->state == PJSIP_TSX_STATE_TERMINATED) {
+	if (tsx->state == PJSIP_TSX_STATE_TRYING) {
+	    /* Request is received. */
+	} else if (tsx->state == PJSIP_TSX_STATE_TERMINATED) {
 
 	    /* Check that status code is status_code. */
 	    if (tsx->status_code != TEST4_STATUS_CODE) {
-		PJ_LOG(3,(THIS_FILE, "    error: incorrect status code"));
+		PJ_LOG(3,(THIS_FILE, 
+			  "    error: incorrect status code %d "
+			  "(expecting %d)", tsx->status_code,
+			  TEST4_STATUS_CODE));
 		test_complete = -120;
 	    }
@@ -461,5 +466,6 @@
 	} else if (tsx->state != PJSIP_TSX_STATE_DESTROYED) 
 	{
-	    PJ_LOG(3,(THIS_FILE, "    error: unexpected state"));
+	    PJ_LOG(3,(THIS_FILE, "    error: unexpected state %s (122)",
+		      pjsip_tsx_state_str(tsx->state)));
 	    test_complete = -122;
 
@@ -472,5 +478,8 @@
 	 * TEST5_BRANCH_ID tests receiving retransmissions in PROCEEDING state
 	 */
-	if (tsx->state == PJSIP_TSX_STATE_TERMINATED) {
+	if (tsx->state == PJSIP_TSX_STATE_TRYING) {
+	    /* Request is received. */
+
+	} else if (tsx->state == PJSIP_TSX_STATE_TERMINATED) {
 
 	    /* Check that status code is status_code. */
@@ -495,5 +504,6 @@
 
 	} else if (tsx->state != PJSIP_TSX_STATE_DESTROYED) {
-	    PJ_LOG(3,(THIS_FILE, "    error: unexpected state"));
+	    PJ_LOG(3,(THIS_FILE, "    error: unexpected state %s (133)",
+		      pjsip_tsx_state_str(tsx->state)));
 	    test_complete = -133;
 
@@ -505,5 +515,8 @@
 	 * TEST6_BRANCH_ID tests receiving retransmissions in COMPLETED state
 	 */
-	if (tsx->state == PJSIP_TSX_STATE_TERMINATED) {
+	if (tsx->state == PJSIP_TSX_STATE_TRYING) {
+	    /* Request is received. */
+
+	} else if (tsx->state == PJSIP_TSX_STATE_TERMINATED) {
 
 	    /* Check that status code is status_code. */
@@ -523,5 +536,6 @@
 		   tsx->state != PJSIP_TSX_STATE_DESTROYED) 
 	{
-	    PJ_LOG(3,(THIS_FILE, "    error: unexpected state"));
+	    PJ_LOG(3,(THIS_FILE, "    error: unexpected state %s (142)",
+		      pjsip_tsx_state_str(tsx->state)));
 	    test_complete = -142;
 
@@ -544,5 +558,8 @@
 	    code = TEST8_STATUS_CODE;
 
-	if (tsx->state == PJSIP_TSX_STATE_TERMINATED) {
+	if (tsx->state == PJSIP_TSX_STATE_TRYING) {
+	    /* Request is received. */
+
+	} else if (tsx->state == PJSIP_TSX_STATE_TERMINATED) {
 
 	    if (test_complete == 0)
@@ -577,5 +594,5 @@
 	} else if (tsx->state != PJSIP_TSX_STATE_DESTROYED)  {
 
-	    PJ_LOG(3,(THIS_FILE, "    error: unexpected state"));
+	    PJ_LOG(3,(THIS_FILE, "    error: unexpected state (154)"));
 	    test_complete = -154;
 
@@ -590,5 +607,8 @@
 	 */
 
-	if (tsx->state == PJSIP_TSX_STATE_TERMINATED) {
+	if (tsx->state == PJSIP_TSX_STATE_TRYING) {
+	    /* Request is received. */
+
+	} else if (tsx->state == PJSIP_TSX_STATE_TERMINATED) {
 
 	    if (test_complete == 0)
@@ -638,5 +658,5 @@
 	} else if (tsx->state != PJSIP_TSX_STATE_DESTROYED)  {
 
-	    PJ_LOG(3,(THIS_FILE, "    error: unexpected state"));
+	    PJ_LOG(3,(THIS_FILE, "    error: unexpected state (166)"));
 	    test_complete = -166;
 
@@ -746,5 +766,5 @@
 	    if (status != PJ_SUCCESS) {
 		app_perror("    error: unable to create transaction", status);
-		test_complete = -120;
+		test_complete = -116;
 		return PJ_TRUE;
 	    }
@@ -1272,5 +1292,5 @@
     int status;
 
-    PJ_LOG(3,(THIS_FILE,"  test1: basic sending 2xx final response"));
+    PJ_LOG(3,(THIS_FILE,"  test3: basic sending 2xx final response"));
 
     status = perform_test("sip:129.0.0.1;transport=loop-dgram",
