[X2Go-Commits] [libx2goclient] 22/44: src/test/sshtest.c: test connection status getter and setter.
git-admin at x2go.org
git-admin at x2go.org
Fri Sep 18 01:55:38 CEST 2020
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository libx2goclient.
commit 9e9d174d4b834506665ae52881a6c16685012697
Author: Mihai Moldovan <ionic at ionic.de>
Date: Mon Aug 3 12:48:47 2020 +0200
src/test/sshtest.c: test connection status getter and setter.
---
src/test/sshtest.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/test/sshtest.c b/src/test/sshtest.c
index 1e5c21d..fca6bf5 100644
--- a/src/test/sshtest.c
+++ b/src/test/sshtest.c
@@ -82,8 +82,26 @@ int main (const int argc, const char * const * const argv) {
g_free (session_path);
session_path = NULL;
+ /*
+ * Check connection status fetching and setting.
+ *
+ * The latter should fail.
+ */
+ g_printf ("Trying to get connection status...\n");
+ gboolean conn_ret = TRUE;
+ g_object_get (G_OBJECT (net_ssh), "connected", &conn_ret, NULL);
+ g_printf ("Current connection status: %d\n", (int) (conn_ret));
+
+ g_printf ("Trying to set connection status (should fail)...\n");
+ conn_ret = TRUE;
+ g_object_set (G_OBJECT (net_ssh), "connected", &conn_ret, NULL);
+
+ g_printf ("Trying to get connection status again...\n");
+ g_object_get (G_OBJECT (net_ssh), "connected", &conn_ret, NULL);
+ g_printf ("Current connection status (again): %d\n", (int) (conn_ret));
+
g_printf ("Trying to connect...\n");
- gboolean conn_ret = x2goclient_network_ssh_connect (net_ssh, NULL);
+ conn_ret = x2goclient_network_ssh_connect (net_ssh, NULL);
g_printf ("Connection status: %s.\n", (conn_ret) ? "true" : "false");
g_clear_object (&net_ssh);
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
More information about the x2go-commits
mailing list