summaryrefslogtreecommitdiff
path: root/tests/oauth-async.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/oauth-async.c')
-rw-r--r--tests/oauth-async.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/oauth-async.c b/tests/oauth-async.c
index 51c8546..c7f77b8 100644
--- a/tests/oauth-async.c
+++ b/tests/oauth-async.c
@@ -23,6 +23,7 @@
#include <rest/oauth-proxy.h>
#include <rest/oauth-proxy-private.h>
#include <stdio.h>
+#include <stdlib.h>
static GMainLoop *loop;
@@ -97,6 +98,14 @@ request_token_cb (OAuthProxy *proxy,
g_assert_no_error (err);
}
+static gboolean
+on_timeout (gpointer data)
+{
+ g_message ("timed out!");
+ exit (1);
+ return FALSE;
+}
+
int
main (int argc, char **argv)
{
@@ -107,6 +116,9 @@ main (int argc, char **argv)
g_thread_init (NULL);
g_type_init ();
+ /* Install a timeout so that we don't hang or infinite loop */
+ g_timeout_add_seconds (10, on_timeout, NULL);
+
loop = g_main_loop_new (NULL, TRUE);
/* Create the proxy */