From d0a5273abc27488ddd1f4419e2b13b5872745618 Mon Sep 17 00:00:00 2001 From: Vic Lee Date: Sun, 10 Jul 2011 22:24:47 +0800 Subject: [PATCH] cunit/chanman: perform tests on channel data. --- CMakeLists.txt | 2 +- cunit/test_chanman.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ae4bf5..c2d1458 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,5 +87,5 @@ add_subdirectory(libfreerdp-kbd) add_subdirectory(libfreerdp-gdi) add_subdirectory(libfreerdp-chanman) add_subdirectory(libfreerdp-core) - +add_subdirectory(channels) add_subdirectory(freerdp-ui) diff --git a/cunit/test_chanman.c b/cunit/test_chanman.c index 931da8d..882368f 100644 --- a/cunit/test_chanman.c +++ b/cunit/test_chanman.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "test_chanman.h" @@ -46,13 +47,31 @@ int add_chanman_suite(void) return 0; } +static int test_rdp_channel_data(rdpInst* inst, int chan_id, char* data, int data_size) +{ + printf("chan_id %d data_size %d\n", chan_id, data_size); +} + void test_chanman(void) { rdpChanMan* chan_man; rdpSettings settings = { 0 }; + rdpInst inst = { 0 }; + + settings.hostname = "testhost"; + inst.settings = &settings; + inst.rdp_channel_data = test_rdp_channel_data; chan_man = freerdp_chanman_new(); + freerdp_chanman_load_plugin(chan_man, &settings, "../channels/rdpdbg/rdpdbg.so", NULL); + freerdp_chanman_pre_connect(chan_man, &inst); + freerdp_chanman_post_connect(chan_man, &inst); + + freerdp_chanman_data(&inst, 0, "testdata", 8, CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST, 8); + + freerdp_chanman_check_fds(chan_man, &inst); + freerdp_chanman_close(chan_man, NULL); freerdp_chanman_free(chan_man); } -- 2.7.4