void test_license(void)
{
- STREAM* s;
-
- s = stream_new(0);
+ STREAM _s, *s;
+ s = &_s;
memcpy(license->client_random, client_random, sizeof(client_random));
memcpy(license->premaster_secret, premaster_secret, sizeof(premaster_secret));
void test_license_generate_keys(void)
{
- STREAM* s;
- s = stream_new(0);
+ STREAM _s, *s;
+ s = &_s;
memcpy(license->client_random, client_random, sizeof(client_random));
memcpy(license->server_random, test_server_random, sizeof(test_server_random));
memcpy(license->premaster_secret, premaster_secret, sizeof(premaster_secret));
void test_license_encrypt_premaster_secret(void)
{
- STREAM* s;
- s = stream_new(0);
+ STREAM _s, *s;
+ s = &_s;
memcpy(license->premaster_secret, premaster_secret, sizeof(premaster_secret));
memcpy(license->certificate->cert_info.exponent, test_exponent, sizeof(test_exponent));
memcpy(license->certificate->cert_info.modulus.data, test_modulus, sizeof(test_modulus));
void test_license_decrypt_platform_challenge(void)
{
- STREAM* s;
- s = stream_new(0);
+ STREAM _s, *s;
+ s = &_s;
memcpy(license->licensing_encryption_key, test_licensing_encryption_key,
sizeof(test_licensing_encryption_key));
s->data = license->platform_challenge->data;
s->p = s->data + sizeof(test_platform_challenge);
+
ASSERT_STREAM(s, test_platform_challenge, sizeof(test_platform_challenge));
}
int init_orders_suite(void)
{
- orderInfo = (ORDER_INFO*) malloc(sizeof(orderInfo));
+ orderInfo = (ORDER_INFO*) malloc(sizeof(ORDER_INFO));
return 0;
}
void test_read_dstblt_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
DSTBLT_ORDER dstblt;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = dstblt_order;
memset(orderInfo, 0, sizeof(ORDER_INFO));
void test_read_patblt_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
PATBLT_ORDER patblt;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = patblt_order;
memset(orderInfo, 0, sizeof(ORDER_INFO));
void test_read_scrblt_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
SCRBLT_ORDER scrblt;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = scrblt_order;
memset(orderInfo, 0, sizeof(ORDER_INFO));
void test_read_opaque_rect_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
OPAQUE_RECT_ORDER opaque_rect;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = opaque_rect_order;
memset(orderInfo, 0, sizeof(ORDER_INFO));
void test_read_draw_nine_grid_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
DRAW_NINE_GRID_ORDER draw_nine_grid;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = draw_nine_grid_order;
memset(orderInfo, 0, sizeof(ORDER_INFO));
void test_read_multi_opaque_rect_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
MULTI_OPAQUE_RECT_ORDER multi_opaque_rect;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = multi_opaque_rect_order;
memset(orderInfo, 0, sizeof(ORDER_INFO));
void test_read_line_to_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
LINE_TO_ORDER line_to;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = line_to_order;
memset(orderInfo, 0, sizeof(ORDER_INFO));
void test_read_polyline_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
POLYLINE_ORDER polyline;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = polyline_order;
memset(orderInfo, 0, sizeof(ORDER_INFO));
void test_read_glyph_index_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
GLYPH_INDEX_ORDER glyph_index;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = glyph_index_order_1;
memset(orderInfo, 0, sizeof(ORDER_INFO));
void test_read_fast_index_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
FAST_INDEX_ORDER fast_index;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = fast_index_order;
memset(orderInfo, 0, sizeof(ORDER_INFO));
CU_ASSERT(fast_index.bkTop == 113);
CU_ASSERT(fast_index.bkRight == 66);
CU_ASSERT(fast_index.bkBottom == 126);
- CU_ASSERT(fast_index.opLeft == 377);
- CU_ASSERT(fast_index.opTop == 3);
- CU_ASSERT(fast_index.opRight == 1278);
- CU_ASSERT(fast_index.opBottom == 0);
+ CU_ASSERT(fast_index.opLeft == 0);
+ CU_ASSERT(fast_index.opTop == 0);
+ CU_ASSERT(fast_index.opRight == 0);
+ CU_ASSERT(fast_index.opBottom == 524);
CU_ASSERT(fast_index.x == -32768);
CU_ASSERT(fast_index.y == 124);
void test_read_fast_glyph_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
FAST_GLYPH_ORDER fast_glyph;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = fast_glyph_order;
memset(orderInfo, 0, sizeof(ORDER_INFO));
void test_read_polygon_cb_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
POLYGON_CB_ORDER polygon_cb;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = polygon_cb_order;
memset(orderInfo, 0, sizeof(ORDER_INFO));
void test_read_cache_bitmap_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
uint16 extraFlags;
CACHE_BITMAP_ORDER cache_bitmap;
- s = stream_new(0);
+ s = &_s;
extraFlags = 0x0400;
s->p = s->data = cache_bitmap_order;
void test_read_cache_bitmap_v2_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
uint16 extraFlags;
CACHE_BITMAP_V2_ORDER cache_bitmap_v2;
- s = stream_new(0);
+ s = &_s;
extraFlags = 0x0CA1;
s->p = s->data = cache_bitmap_v2_order;
void test_read_cache_bitmap_v3_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
uint16 extraFlags;
CACHE_BITMAP_V3_ORDER cache_bitmap_v3;
- s = stream_new(0);
+ s = &_s;
extraFlags = 0x0C30;
s->p = s->data = cache_bitmap_v3_order;
void test_read_cache_brush_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
CACHE_BRUSH_ORDER cache_brush;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = cache_brush_order;
memset(&cache_brush, 0, sizeof(CACHE_BRUSH_ORDER));
void test_read_create_offscreen_bitmap_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
OFFSCREEN_DELETE_LIST* deleteList;
CREATE_OFFSCREEN_BITMAP_ORDER create_offscreen_bitmap;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = create_offscreen_bitmap_order;
memset(&create_offscreen_bitmap, 0, sizeof(CREATE_OFFSCREEN_BITMAP_ORDER));
void test_read_switch_surface_order(void)
{
- STREAM* s;
+ STREAM _s, *s;
SWITCH_SURFACE_ORDER switch_surface;
- s = stream_new(0);
+ s = &_s;
s->p = s->data = switch_surface_order;
memset(&switch_surface, 0, sizeof(SWITCH_SURFACE_ORDER));
void test_update_recv_orders(void)
{
- STREAM* s;
+ rdpRdp* rdp;
+ STREAM _s, *s;
rdpUpdate* update;
- s = stream_new(0);
- update = update_new(NULL);
+ s = &_s;
+ rdp = rdp_new(NULL);
+ update = update_new(rdp);
+
+ update->context = malloc(sizeof(rdpContext));
+ update->context->rdp = rdp;
opaque_rect_count = 0;
polyline_count = 0;
update->primary->PatBlt = test_patblt;
s->p = s->data = orders_update_1;
+ s->size = sizeof(orders_update_1);
update_recv(update, s);
update->primary->order_info.orderType = ORDER_TYPE_PATBLT;
s->p = s->data = orders_update_2;
+ s->size = sizeof(orders_update_2);
update_recv(update, s);
CU_ASSERT(patblt_count == 3);
+
+ free(update->context);
}