Author: tretiakov Date: Thu Apr 20 20:00:36 2006 New Revision: 21673
URL: http://svn.reactos.ru/svn/reactos?rev=21673&view=rev Log: Update tests
Modified: trunk/reactos/base/applications/testsets/rpcrt4/context_handles/client.c trunk/reactos/base/applications/testsets/rpcrt4/context_handles/server.c
Modified: trunk/reactos/base/applications/testsets/rpcrt4/context_handles/client.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/testsets/r... ============================================================================== --- trunk/reactos/base/applications/testsets/rpcrt4/context_handles/client.c (original) +++ trunk/reactos/base/applications/testsets/rpcrt4/context_handles/client.c Thu Apr 20 20:00:36 2006 @@ -337,26 +337,42 @@
}
+int interactive = 0; +void interact() +{ + if(interactive) + { + printf("\nPress any key to continue..."); + getch(); + printf("\n\n"); + } +} + void main(int argc, char **argv) { RPC_STATUS status; unsigned long ulCode; PCTXTYPE hContext; char *pszStringBinding = NULL; - int test_num = 0; RPC_BINDING_HANDLE Handle = 0; char buffer[255]; + int test_num = 0; + int test_value = 31337; + if(argc<2) { - printf("USAGE: client.exe <test_number>\n" + printf("USAGE: client.exe <test_number> [test_value] [interactive]\n" "Available tests:\n" "0. General test\n" - "1. NULL pointer test\n"); + "1. NULL pointer test\n" + "2. Context rundown routine"); return; } test_num = atoi(argv[1]); + if(argc>2) test_value = atoi(argv[2]); + if(argc>3) interactive = 1;
status = RpcStringBindingCompose(NULL, "ncacn_np", @@ -384,9 +400,10 @@ switch(test_num) { case 0: - m_CtxOpen(&hContext, 31337); + m_CtxOpen(&hContext, test_value); RpcBindingFree(&hBinding); m_CtxHello(hContext); + interact(); m_CtxClose(&hContext); break; case 1: @@ -402,7 +419,7 @@ } RpcEndExcept - m_CtxOpen2(&hContext, 31337); + m_CtxOpen2(&hContext, test_value); ///////////////////////////////////////////////////////////////////////////////////////// RpcTryExcept @@ -415,9 +432,12 @@ printf("NDRCContextMarshall(NULL) reported exception = %d\n", RpcExceptionCode()); } RpcEndExcept - - ///////////////////////////////////////////////////////////////////////////////////////// + break; + case 2: + CtxOpen(&hContext, test_value); + interact(); + ExitProcess(0); break; default: printf("Unknown test %d\n", test_num);
Modified: trunk/reactos/base/applications/testsets/rpcrt4/context_handles/server.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/testsets/r... ============================================================================== --- trunk/reactos/base/applications/testsets/rpcrt4/context_handles/server.c (original) +++ trunk/reactos/base/applications/testsets/rpcrt4/context_handles/server.c Thu Apr 20 20:00:36 2006 @@ -6,19 +6,19 @@ void CtxOpen( PCTXTYPE *pphContext, long Value) { - printf("CtxOpen()\n"); + printf("CtxOpen(): Value=%d\n",Value); *pphContext = (PCTXTYPE)midl_user_allocate( sizeof(CTXTYPE) ); **pphContext = Value; }
void CtxHello( PCTXTYPE phContext ) { - printf("Hello, World! Context value: %d\n", *phContext); + printf("CtxHello(): Hello, World! Context value: %d\n", *phContext); }
void CtxClose(PCTXTYPE *pphContext ) { - printf("CtxClose()\n"); + printf("CtxClose(): %d\n", **pphContext); midl_user_free(*pphContext); *pphContext = NULL; } @@ -62,7 +62,8 @@ void __RPC_USER PCTXTYPE_rundown( PCTXTYPE hContext) { - printf("Context rundown \n"); + PCTXTYPE pCtx = (PCTXTYPE)hContext; + printf("Context rundown: Value=%d \n", *pCtx); midl_user_free(hContext); }