Blame unit/util.h

Packit 34410b
/*
Packit 34410b
 *
Packit 34410b
 *  OBEX library with GLib integration
Packit 34410b
 *
Packit 34410b
 *  Copyright (C) 2011  Intel Corporation. All rights reserved.
Packit 34410b
 *
Packit 34410b
 *  This program is free software; you can redistribute it and/or modify
Packit 34410b
 *  it under the terms of the GNU General Public License version 2 as
Packit 34410b
 *  published by the Free Software Foundation.
Packit 34410b
 *
Packit 34410b
 *  This program is distributed in the hope that it will be useful,
Packit 34410b
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 34410b
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 34410b
 *  GNU General Public License for more details.
Packit 34410b
 *
Packit 34410b
 *  You should have received a copy of the GNU General Public License
Packit 34410b
 *  along with this program; if not, write to the Free Software
Packit 34410b
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
Packit 34410b
 *
Packit 34410b
 */
Packit 34410b
Packit 34410b
#define TEST_BUF_MAX 5
Packit 34410b
Packit 34410b
enum {
Packit 34410b
	TEST_ERROR_TIMEOUT,
Packit 34410b
	TEST_ERROR_UNEXPECTED,
Packit 34410b
};
Packit 34410b
Packit 34410b
struct test_buf {
Packit 34410b
	const void *data;
Packit 34410b
	gssize len;
Packit 34410b
};
Packit 34410b
Packit 34410b
struct test_data {
Packit 34410b
	guint count;
Packit 34410b
	GError *err;
Packit 34410b
	struct test_buf recv[TEST_BUF_MAX];
Packit 34410b
	struct test_buf send[TEST_BUF_MAX];
Packit 34410b
	guint provide_delay;
Packit 34410b
	GObex *obex;
Packit 34410b
	guint id;
Packit 34410b
	gsize total;
Packit 34410b
	GMainLoop *mainloop;
Packit 34410b
	gboolean io_completed;
Packit 34410b
};
Packit 34410b
Packit 34410b
#define TEST_ERROR test_error_quark()
Packit 34410b
GQuark test_error_quark(void);
Packit 34410b
Packit 34410b
void dump_bufs(const void *mem1, size_t len1, const void *mem2, size_t len2);
Packit 34410b
void assert_memequal(const void *mem1, size_t len1,
Packit 34410b
						const void *mem2, size_t len2);
Packit 34410b
Packit 34410b
GObex *create_gobex(int fd, GObexTransportType transport_type,
Packit 34410b
						gboolean close_on_unref);
Packit 34410b
void create_endpoints(GObex **obex, GIOChannel **io, int sock_type);
Packit 34410b
Packit 34410b
gboolean test_io_cb(GIOChannel *io, GIOCondition cond, gpointer user_data);
Packit 34410b
gboolean test_timeout(gpointer user_data);