Example #1
0
int init_comms(EMBX_FACTORY *pFact,EMBX_TRANSPORT *pTrans,EMBX_PORT *pPort)
{
	EMBX_ERROR err;
	EMBX_TPINFO tpinfo;

	*pFact  = 0;
	*pTrans = 0;
	*pPort  = 0;

	/*
	 * Register the transport factory for the shared memory
	 * transport configuration we require. 
	 */
	err = EMBX_RegisterTransport(EMBXSHM_mailbox_factory,
				     &config, sizeof(config), pFact);

	if(err != EMBX_SUCCESS) {
		printf("Factory registration failed err = %d\n",err);
		return -1;
	}

	/*
	 * Initialise the EMBX library, this will attempt to create
	 * a transport based on the factory we just registered.
	 */
	if((err = EMBX_Init()) != EMBX_SUCCESS) {
		printf("EMBX initialisation failed err = %d\n",err);
		return -1;
	}

	/*
	 * Try and get the information structure for the transport
	 * we hope has just been created. If this returns an error
	 * no transports were created during EMBX_Init, which means
	 * something went wrong in the transport factory we registered.
	 */
	if((err = EMBX_GetFirstTransport(&tpinfo)) != EMBX_SUCCESS) {
		printf("Querying transport failed err = %d\n",err);
		return -1;
	}

	return 0;
}
int run_test(void)
{
EMBX_ERROR     res;
EMBX_TPINFO    tpinfo1;
EMBX_BOOL      bFailed;
EMBX_TRANSPORT tp;
EMBX_PORT      localPort,remotePort;
EMBX_VOID     *buffer1,*buffer2;
EMBX_FACTORY   factory;

    bFailed = EMBX_FALSE;
    tp      = EMBX_INVALID_HANDLE_VALUE;
    buffer1 = buffer2 = 0;

    /* Test 1 */
    res = EMBX_SendMessage(EMBX_INVALID_HANDLE_VALUE, buffer1, 0);
    if(res != EMBX_INVALID_PORT)
    {
        EMBX_Info(EMBX_TRUE, ("Test1 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    res = EMBX_RegisterTransport(EMBXLB_loopback_factory,&loopback_config,sizeof(EMBXLB_Config_t),&factory);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Transport Registration failed, res = %s, exiting\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 2 */
    res = EMBX_Init();
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test2 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 3 */
    res = EMBX_GetFirstTransport(&tpinfo1);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test3 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 4 */
    res = EMBX_OpenTransport(tpinfo1.name, &tp);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test4 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 5 */
    res = EMBX_CreatePort(tp, "testport", &localPort);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test5 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }
    
    /* Test 6 */
    res = EMBX_Connect(tp, "testport", &remotePort);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test6 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }
    
    /* Test 7 */
    res = EMBX_Alloc(tp, BUFFER_SIZE, &buffer1);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test7 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 8 */
    res = EMBX_SendMessage(tp, buffer1, 0);
    if(res != EMBX_INVALID_PORT)
    {
        EMBX_Info(EMBX_TRUE, ("Test8 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    /* Test 9 */
    res = EMBX_SendMessage(localPort, buffer1, 0);
    if(res != EMBX_INVALID_PORT)
    {
        EMBX_Info(EMBX_TRUE, ("Test9 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    /* Test 10 */
    res = EMBX_SendMessage(remotePort, 0, 0);
    if(res != EMBX_INVALID_ARGUMENT)
    {
        EMBX_Info(EMBX_TRUE, ("Test10 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    /* Test 11 */
    res = EMBX_SendMessage(remotePort, buffer1, BUFFER_SIZE+1);
    if(res != EMBX_INVALID_ARGUMENT)
    {
        EMBX_Info(EMBX_TRUE, ("Test11 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 12 */
    res = EMBX_SendMessage(remotePort, buffer1, BUFFER_SIZE);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test12 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 13 - Ensure this allocation happens before buffer1 gets free'd
     * when the port is closed, so buffer1 and buffer2 will not point to
     * the same memory which is important for later tests.
     */
    res = EMBX_Alloc(tp, BUFFER_SIZE, &buffer2);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test13 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 14 */
    res = EMBX_ClosePort(localPort);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test14 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 15 - buffer1 has been freed by test14 so should be garbage */
    res = EMBX_SendMessage(remotePort, buffer1, 0);
    if(res != EMBX_INVALID_ARGUMENT)
    {
        EMBX_Info(EMBX_TRUE, ("Test15 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    /* Test 16 */
    res = EMBX_SendMessage(remotePort, buffer2, BUFFER_SIZE);
    if(res != EMBX_INVALID_PORT)
    {
        EMBX_Info(EMBX_TRUE, ("Test16 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 17 */
    res = EMBX_ClosePort(remotePort);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test17 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 18 */
    res = EMBX_CloseTransport(tp);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test18 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }
    
    /* Test 19 */
    res = EMBX_Deinit();
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test19 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* These test a different code path to the identical tests done before
     * EMBX_Init.
     */

    /* Test 20 - Depends on buffer2 not having been freed so we get through
     * to checking the state of the driver.
     */
    res = EMBX_SendMessage(remotePort, buffer2, 0);
    if(res != EMBX_INVALID_PORT)
    {
        EMBX_Info(EMBX_TRUE, ("Test20 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    /* Test 21 */
    res = EMBX_UnregisterTransport(factory);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test21 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    return bFailed?-1:0;

skip_remaining_tests:
    EMBX_Info(EMBX_TRUE, ("Skipping Remaining Tests\n"));
    return -1;
}
Example #3
0
static int embx_read_procmem(char *buf, char **start, off_t offset,
                             int count, int *eof, void *data)
{
    char tmp[935];
    EMBX_TPINFO tpinfo;
    EMBX_ERROR res;

    int i, len = 0;

    i = sprintf(tmp,"EMBX Driver\n-----------\n");

    if(len+i >= count)
        goto exit;

    len += sprintf(buf,tmp);

    res = EMBX_GetFirstTransport(&tpinfo);
    switch (res)
    {
    case EMBX_DRIVER_NOT_INITIALIZED:
    {
        i = sprintf(tmp,"Driver Not Initialized\n");
        if(len+i >= count)
            goto exit;

        len += sprintf(buf+len,tmp);
        goto exit;
        } /* EMBX_DRIVER_NOT_INITIALIZED */
    case EMBX_INVALID_STATUS:
    {
        i = sprintf(tmp,"No registered transports\n");
        if(len+i >= count)
            goto exit;

        len += sprintf(buf+len,tmp);
        goto exit;
        } /* EMBX_INVALID_STATUS */
    case EMBX_SUCCESS:
    {
        break;  /* Fall through to work loop */
        } /* EMBX_SUCCESS */
    default:
    {
        i = sprintf(tmp,"No registered transports\n");
        if(len+i >= count)
            goto exit;

        len += sprintf(buf+len,tmp);
        goto exit;
        } /* default */
    }

    do
    {
        if (tpinfo.isInitialized)
        {
            i = sprintf(tmp, "\n%s:\n Zero copy : %s\n Allows pointer translations : %s\n",
                        tpinfo.name, (tpinfo.usesZeroCopy ? "yes" : "no"), (tpinfo.allowsPointerTranslation ? "yes" : "no"));

            if (len+i >= count)
                goto exit;

            len += sprintf(buf+len,tmp);

            i = sprintf(tmp," Allows multiple connections : %s\n Max Ports : %d\n Open handles : %d\n",
                        (tpinfo.allowsMultipleConnections ? "yes" : "no"), tpinfo.maxPorts, tpinfo.nrOpenHandles);

            if (len+i >= count)
                goto exit;

            len += sprintf(buf+len,tmp);

            i = sprintf(tmp, " Ports in use : %d\n Mem start : 0x%08x\n Mem end   : 0x%08x\n\n",
                        tpinfo.nrPortsInUse, (EMBX_UINT)tpinfo.memStart, (EMBX_UINT)tpinfo.memEnd);
        }
        else
        {
            i = sprintf(tmp,"\n%s: Uninitialized\n\n", tpinfo.name);
        }

        if (len+i >= count)
            goto exit;

        len += sprintf(buf+len,tmp);

        res = EMBX_GetNextTransport(&tpinfo);

    } while (res == EMBX_SUCCESS);

exit:
    *eof = 1;
    return len;
}
int run_test(void)
{
EMBX_UINT    i;
EMBX_ERROR   res;
EMBX_TPINFO  tpinfo1;
EMBX_BOOL    bFailed;
EMBX_PORT    localPort,remotePort;
EMBX_VOID   *buffer1;
EMBX_FACTORY factory;

EMBX_RECEIVE_EVENT ev;

    bFailed = EMBX_FALSE;
    buffer1 = 0;

    /* Test 1 */
    res = EMBX_ReceiveBlock(EMBX_INVALID_HANDLE_VALUE, &ev);
    if(res != EMBX_INVALID_PORT)
    {
        EMBX_Info(EMBX_TRUE, ("Test1 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    res = EMBX_RegisterTransport(EMBXLB_loopback_factory, &loopback_config, sizeof(EMBXLB_Config_t), &factory);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Transport Registration failed, res = %s, exiting\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 2 */
    res = EMBX_Init();
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test2 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 3 */
    res = EMBX_GetFirstTransport(&tpinfo1);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test3 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }


    /* Test 4 */
    res = EMBX_OpenTransport(tpinfo1.name, &tp);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test4 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }


    /* Test 5 */
    res = EMBX_CreatePort(tp, "testport", &localPort);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test5 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    
    /* Test 6 */
    res = EMBX_Connect(tp, "testport", &remotePort);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test6 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 7 */
    res = EMBX_ReceiveBlock(tp, &ev);
    if(res != EMBX_INVALID_PORT)
    {
        EMBX_Info(EMBX_TRUE, ("Test7 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }
        
    /* Test 8 */
    res = EMBX_ReceiveBlock(remotePort, &ev);
    if(res != EMBX_INVALID_PORT)
    {
        EMBX_Info(EMBX_TRUE, ("Test8 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    /* Test 9 */
    res = EMBX_ReceiveBlock(localPort, 0);
    if(res != EMBX_INVALID_ARGUMENT)
    {
        EMBX_Info(EMBX_TRUE, ("Test9 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }


    /* Test 10 */
    res = EMBX_Alloc(tp, BUFFER_SIZE, &buffer1);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test10 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    for(i=0;i<BUFFER_SIZE;i++)
    {
        ((unsigned char *)buffer1)[i] = (unsigned char)i;
    }

    /* Test 11 */
    res = EMBX_SendMessage(remotePort, buffer1, BUFFER_SIZE);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test11 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }


    /* Test 12 */
    res = EMBX_ReceiveBlock(localPort, &ev);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test12 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    if(ev.handle != EMBX_INVALID_HANDLE_VALUE ||
       ev.offset != 0 ||
       ev.type   != EMBX_REC_MESSAGE ||
       ev.size   != BUFFER_SIZE)
    {
        EMBX_Info(EMBX_TRUE, ("Test13 failed, event structure incorrect\n"));
        goto skip_remaining_tests;
    }

    for(i=0;i<ev.size;i++)
    {
        if( ((unsigned char *)ev.data)[i] != (unsigned char)i )
        {
            EMBX_Info(EMBX_TRUE, ("Test13 failed, buffer contents incorrect\n"));
            bFailed = EMBX_TRUE;
            break;
        }
    }

    /* Test 13 */
    res = EMBX_Free(ev.data);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test13 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    if(!EMBX_OS_ThreadCreate(send_thread, (void *)remotePort, EMBX_DEFAULT_THREAD_PRIORITY, "send"))
    {
        EMBX_Info(EMBX_TRUE, ("Unable to create thread\n"));
        goto skip_remaining_tests;
    }

    /* Test 14 */
    res = EMBX_ReceiveBlock(localPort, &ev);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test14 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    if(ev.handle != EMBX_INVALID_HANDLE_VALUE ||
       ev.offset != 0 ||
       ev.type   != EMBX_REC_MESSAGE ||
       ev.size   != BUFFER_SIZE)
    {
        EMBX_Info(EMBX_TRUE, ("Test15 failed, event structure incorrect\n"));
        goto skip_remaining_tests;
    }

    /* Test 15 */
    res = EMBX_Free(ev.data);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test15 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    /* Test 16 */
    res = EMBX_ClosePort(remotePort);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test16 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 17 */
    res = EMBX_ClosePort(localPort);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test17 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 18 */
    res = EMBX_CloseTransport(tp);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test18 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }
    
    /* Test 19 */
    res = EMBX_Deinit();
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test19 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* These test a different code path to the identical tests done before
     * EMBX_Init
     */

    /* Test 20 */
    res = EMBX_ReceiveBlock(localPort, &ev);
    if(res != EMBX_INVALID_PORT)
    {
        EMBX_Info(EMBX_TRUE, ("Test20 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    /* Test 21 */
    res = EMBX_UnregisterTransport(factory);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test21 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    return bFailed?-1:0;

skip_remaining_tests:
    EMBX_Info(EMBX_TRUE, ("Skipping Remaining Tests\n"));
    return -1;
}
int run_test(void)
{
EMBX_UINT      i;
EMBX_ERROR     res;
EMBX_TPINFO    tpinfo1;
EMBX_BOOL      bFailed;
EMBX_TRANSPORT tp;
EMBX_PORT      localPort,remotePort;
EMBX_HANDLE    hObj;
EMBX_FACTORY   factory;

EMBX_RECEIVE_EVENT ev;

    bFailed = EMBX_FALSE;
    tp      = EMBX_INVALID_HANDLE_VALUE;
    hObj    = EMBX_INVALID_HANDLE_VALUE;

    /* Test 1 */
    res = EMBX_Receive(EMBX_INVALID_HANDLE_VALUE, &ev);
    if(res != EMBX_INVALID_PORT)
    {
        EMBX_Info(EMBX_TRUE, ("Test1 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    res = EMBX_RegisterTransport(EMBXLB_loopback_factory, &loopback_config, sizeof(EMBXLB_Config_t), &factory);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Transport Registration failed, res = %s, exiting\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 2 */
    res = EMBX_Init();
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test2 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 3 */
    res = EMBX_GetFirstTransport(&tpinfo1);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test3 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 4 */
    res = EMBX_OpenTransport(tpinfo1.name, &tp);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test4 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 5 */
    res = EMBX_CreatePort(tp, "testport", &localPort);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test5 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }
    
    /* Test 6 */
    res = EMBX_Connect(tp, "testport", &remotePort);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test6 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 7 */
    res = EMBX_RegisterObject(tp, object, BUFFER_SIZE, &hObj);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test7 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    for(i=0;i<BUFFER_SIZE;i++)
    {
        ((unsigned char *)object)[i] = (unsigned char)i;
    }

    /* Test 8 */
    res = EMBX_SendObject(remotePort, hObj, 0, BUFFER_SIZE);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test8 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    /* Test 9 */
    res = EMBX_Receive(localPort, &ev);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test9 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    if(ev.handle != hObj || /* This is a specific quirk of the loopback transport */
       ev.offset != 0 ||
       ev.type   != EMBX_REC_OBJECT ||
       ev.size   != BUFFER_SIZE)
    {
        EMBX_Info(EMBX_TRUE, ("Test9 failed, event structure incorrect\n"));
        goto skip_remaining_tests;
    }

    for(i=0;i<ev.size;i++)
    {
        if( ((unsigned char *)ev.data)[i] != (unsigned char)i )
        {
            EMBX_Info(EMBX_TRUE, ("Test9 failed, buffer contents incorrect\n"));
            bFailed = EMBX_TRUE;
            break;
        }
    }

    /* Test 10 */
    res = EMBX_UpdateObject(remotePort, hObj, 0, BUFFER_SIZE);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test10 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 11 */
    res = EMBX_Receive(localPort, &ev);
    if(res != EMBX_INVALID_STATUS)
    {
        EMBX_Info(EMBX_TRUE, ("Test11 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 12 */
    res = EMBX_DeregisterObject(tp, hObj);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test12 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    /* Test 13 */
    res = EMBX_ClosePort(remotePort);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test13 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 14 */
    res = EMBX_ClosePort(localPort);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test14 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 15 */
    res = EMBX_CloseTransport(tp);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test15 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }
    
    /* Test 16 */
    res = EMBX_Deinit();
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test16 failed, res = %s\n",error_strings[res]));
        goto skip_remaining_tests;
    }

    /* Test 17 */
    res = EMBX_UnregisterTransport(factory);
    if(res != EMBX_SUCCESS)
    {
        EMBX_Info(EMBX_TRUE, ("Test17 failed, res = %s\n",error_strings[res]));
        bFailed = EMBX_TRUE;
    }

    return bFailed?-1:0;

skip_remaining_tests:
    EMBX_Info(EMBX_TRUE, ("Skipping Remaining Tests\n"));
    return -1;
}