ReactOS 0.4.15-dev-7906-g1b85a5f
rpc_async.c
Go to the documentation of this file.
1/*
2 * Unit test suite for rpc functions
3 *
4 * Copyright 2008 Robert Shearman (for CodeWeavers)
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include <stdarg.h>
22
23#include "wine/test.h"
24
25#include <rpc.h>
26#include <rpcasync.h>
27
29{
30 char buffer[256];
31 RPC_ASYNC_STATE async;
33 int i;
34 void *unset_ptr;
35
37 ok(status == ERROR_INVALID_PARAMETER, "RpcAsyncInitializeHandle with large Size should have returned ERROR_INVALID_PARAMETER instead of %d\n", status);
38
39 status = RpcAsyncInitializeHandle(&async, sizeof(async) - 1);
40 ok(status == ERROR_INVALID_PARAMETER, "RpcAsyncInitializeHandle with small Size should have returned ERROR_INVALID_PARAMETER instead of %d\n", status);
41
42 memset(&async, 0xcc, sizeof(async));
43 memset(&unset_ptr, 0xcc, sizeof(unset_ptr));
44 status = RpcAsyncInitializeHandle(&async, sizeof(async));
45 ok(status == RPC_S_OK, "RpcAsyncInitializeHandle failed with error %d\n", status);
46
47 ok(async.Size == sizeof(async), "async.Size wrong: %d\n", async.Size);
48 ok(async.Signature == 0x43595341, "async.Signature should be 0x43595341, but is 0x%x instead\n", async.Signature);
49 ok(async.Lock == 0, "async.Lock should be 0, but is %d instead\n", async.Lock);
50 ok(async.Flags == 0, "async.Flags should be 0, but is %d instead\n", async.Flags);
51 ok(async.StubInfo == NULL, "async.StubInfo should be NULL, not %p\n", async.StubInfo);
52 ok(async.UserInfo == unset_ptr, "async.UserInfo should be unset, not %p\n", async.UserInfo);
53 ok(async.RuntimeInfo == NULL, "async.RuntimeInfo should be NULL, not %p\n", async.RuntimeInfo);
54 ok(async.Event == 0xcccccccc, "async.Event should be unset, not %d\n", async.Event);
55 ok(async.NotificationType == 0xcccccccc, "async.NotificationType should be unset, not %d\n", async.NotificationType);
56 for (i = 0; i < 4; i++)
57 ok(async.Reserved[i] == 0x0, "async.Reserved[%d] should be 0x0, not 0x%lx\n", i, async.Reserved[i]);
58}
59
61{
62 RPC_ASYNC_STATE async;
64
65 status = RpcAsyncInitializeHandle(&async, sizeof(async));
66 ok(status == RPC_S_OK, "RpcAsyncInitializeHandle failed with error %d\n", status);
67
70 ok(status == RPC_S_INVALID_BINDING, "RpcAsyncGetCallStatus should have returned RPC_S_INVALID_BINDING instead of %d\n", status);
71
72 memset(&async, 0, sizeof(async));
75 ok(status == RPC_S_INVALID_BINDING, "RpcAsyncGetCallStatus should have returned RPC_S_INVALID_BINDING instead of %d\n", status);
76}
77
78START_TEST( rpc_async )
79{
82}
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define NULL
Definition: types.h:112
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
RPC_STATUS WINAPI RpcAsyncInitializeHandle(PRPC_ASYNC_STATE pAsync, unsigned int Size)
Definition: rpc_async.c:57
RPC_STATUS WINAPI RpcAsyncGetCallStatus(PRPC_ASYNC_STATE pAsync)
Definition: rpc_async.c:92
GLuint buffer
Definition: glext.h:5915
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define todo_wine
Definition: custom.c:79
static void test_RpcAsyncGetCallStatus(void)
Definition: rpc_async.c:60
static void test_RpcAsyncInitializeHandle(void)
Definition: rpc_async.c:28
#define RPC_S_OK
Definition: rpcnterr.h:22
long RPC_STATUS
Definition: rpc.h:52
#define memset(x, y, z)
Definition: compat.h:39
void * StubInfo
Definition: rpcasync.h:150
void * UserInfo
Definition: rpcasync.h:151
RPC_NOTIFICATION_TYPES NotificationType
Definition: rpcasync.h:154
LONG_PTR Reserved[4]
Definition: rpcasync.h:156
RPC_ASYNC_EVENT Event
Definition: rpcasync.h:153
unsigned int Size
Definition: rpcasync.h:146
void * RuntimeInfo
Definition: rpcasync.h:152
Definition: ps.c:97
#define RPC_S_INVALID_BINDING
Definition: winerror.h:1013