src/test/irc_conn.h
branchnew-transport
changeset 168 a58ad50911fc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/test/irc_conn.h	Mon May 04 20:55:04 2009 +0300
@@ -0,0 +1,29 @@
+#ifndef TEST_IRC_CONN_H
+#define TEST_IRC_CONN_H
+
+/**
+ * @file
+ *
+ * Utility test functions for irc_conn related tests
+ */
+#include "../irc_conn.h"
+#include "transport.h"
+
+/**
+ * Callback flags
+ */
+struct test_conn_ctx {
+    /** Callback flags */
+    bool on_registered, on_TEST, on_error, on_quit;
+};
+
+/**
+ * Create and return a new irc_conn with the given ctx (will be initialized to zero).
+ *
+ * The returned irc_conn will be in the registered state.
+ *
+ * Use irc_conn_destroy to clean up the returned irc_conn.
+ */
+struct irc_conn* setup_irc_conn (struct transport_test *tp, bool noisy, struct test_conn_ctx *ctx);
+
+#endif /* TEST_IRC_CONN_H */