qtest: enable vnc-display test on win32

Now that qtest_qmp_add_client() works on win32, we can enable the VNC
test.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230306122751.2355515-11-marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2023-03-06 16:27:50 +04:00
parent 61683d278b
commit f02b2c1917
1 changed files with 7 additions and 5 deletions

View File

@ -19,7 +19,7 @@ typedef struct Test {
GMainLoop *loop;
} Test;
#if !defined(WIN32) && !defined(CONFIG_DARWIN)
#if !defined(CONFIG_DARWIN)
static void on_vnc_error(VncConnection* self,
const char* msg)
@ -38,10 +38,7 @@ static void on_vnc_auth_failure(VncConnection *self,
static bool
test_setup(Test *test)
{
#ifdef WIN32
g_test_skip("Not supported on Windows yet");
return false;
#elif defined(CONFIG_DARWIN)
#if defined(CONFIG_DARWIN)
g_test_skip("Broken on Darwin");
return false;
#else
@ -59,7 +56,12 @@ test_setup(Test *test)
g_signal_connect(test->conn, "vnc-auth-failure",
G_CALLBACK(on_vnc_auth_failure), NULL);
vnc_connection_set_auth_type(test->conn, VNC_CONNECTION_AUTH_NONE);
#ifdef WIN32
vnc_connection_open_fd(test->conn, _get_osfhandle(pair[0]));
#else
vnc_connection_open_fd(test->conn, pair[0]);
#endif
test->loop = g_main_loop_new(NULL, FALSE);
return true;