[svn r360] Removed a lot of GStaticMutex references.
1 #include <glib-object.h>
4 #include "gmyth_backendinfo.h"
5 #include "gmyth_socket.h"
6 #include "gmyth_query.h"
9 test_backend_connection1 (GMythBackendInfo *backend_info)
11 GMythSocket *socket = gmyth_socket_new ();
12 if (gmyth_socket_connect_with_timeout (socket,
13 gmyth_backend_info_get_hostname (backend_info),
14 gmyth_backend_info_get_port (backend_info), 4) == TRUE) {
15 g_debug ("Socket connection success");
18 g_debug ("Connection failed");
24 test_backend_connection2 (GMythBackendInfo *backend_info)
26 GMythSocket *socket = gmyth_socket_new ();
27 if (gmyth_socket_connect_to_backend (socket,
28 gmyth_backend_info_get_hostname (backend_info),
29 gmyth_backend_info_get_port (backend_info), TRUE) == TRUE) {
32 g_debug ("Backend socket connection success");
35 g_debug ("Connection failed");
41 test_mysql_connection1 (GMythBackendInfo *backend_info)
43 GMythQuery *query = gmyth_query_new ();
45 if (gmyth_query_connect_with_timeout (query, backend_info, 3) == TRUE) {
46 g_debug ("Mysql connection success");
49 g_debug ("Mysql connection failed");
57 main (int args, const char **argv)
59 const char* uri = argv[1];
61 GMythBackendInfo *backend_info;
63 //g_thread_init (NULL);
65 backend_info = gmyth_backend_info_new_with_uri (argv[1]);
67 test_backend_connection1 (backend_info);
68 test_backend_connection2 (backend_info);
69 test_mysql_connection1 (backend_info);