Changeset 555

Show
Ignore:
Timestamp:
08/18/08 11:57:03 (3 months ago)
Author:
bellmich
Message:

If the test is not executed as root
then the used port should be greter than 1024.
The default OBEX port is 650.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tests/check_obex.c

    r550 r555  
    8383        fail_unless(smlTransportSetConnectionType(tsp, SML_TRANSPORT_CONNECTION_TYPE_NET, &error), NULL); 
    8484        fail_unless(error == NULL, NULL); 
    85          
    86         fail_unless(smlTransportInitialize(tsp, &error), NULL); 
    87         fail_unless(error == NULL, NULL); 
    88          
    89         fail_unless(smlTransportFinalize(tsp, &error), NULL); 
     85 
     86        /* Don't use the default port 650 here because this is a reserved port in Unix. 
     87         * Therefore the port is usually only allowed for the root user. 
     88         */ 
     89        fail_unless(smlTransportSetConfigOption(tsp, "PORT", "10104", &error), NULL); 
     90 
     91        fail_unless(smlTransportInitialize(tsp, &error), smlErrorPrint(&error)); 
     92        fail_unless(error == NULL, NULL); 
     93         
     94        fail_unless(smlTransportFinalize(tsp, &error), smlErrorPrint(&error)); 
    9095        fail_unless(error == NULL, NULL); 
    9196         
     
    185190                        g_atomic_int_inc(&client_disconnect_done); 
    186191                        break; 
     192                case SML_TRANSPORT_EVENT_ERROR: 
     193                        fail(smlErrorPrint(&error)); 
     194                        break; 
    187195                default: 
    188                         fail(NULL); 
     196                        fail(g_strdup_printf("Unknown event %d.", type)); 
    189197        } 
    190198