--- a/libpurple/tests/Makefile.am Thu Sep 07 22:55:03 2017 -0500
+++ b/libpurple/tests/Makefile.am Thu Sep 07 22:55:20 2017 -0500
@@ -7,6 +7,7 @@
@@ -16,6 +17,9 @@
test_image_SOURCES=test_image.c
test_image_LDADD=$(COMMON_LIBS)
+test_protocol_xfer_SOURCES=test_protocol_xfer.c +test_protocol_xfer_LDADD=$(COMMON_LIBS) test_smiley_SOURCES=test_smiley.c
test_smiley_LDADD=$(COMMON_LIBS)
--- a/libpurple/tests/meson.build Thu Sep 07 22:55:03 2017 -0500
+++ b/libpurple/tests/meson.build Thu Sep 07 22:55:20 2017 -0500
@@ -1,5 +1,6 @@
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/tests/test_protocol_xfer.c Thu Sep 07 22:55:20 2017 -0500
@@ -0,0 +1,116 @@
+ * Purple is the legal property of its developers, whose names are too + * numerous to list here. Please refer to the COPYRIGHT file distributed + * with this source distribution + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA +/****************************************************************************** + * PurpleProtcolXfer Implementations + *****************************************************************************/ +static GType test_purple_protocol_xfer_get_type(void); +} TestPurpleProtocolXfer; +} TestPurpleProtocolXferClass; +test_purple_protocol_xfer_can_receive(PurpleProtocolXferInterface *iface, PurpleConnection *c, const gchar *who) { + TestPurpleProtocolXfer *xfer = (TestPurpleProtocolXfer *)iface; +test_purple_protocol_xfer_iface_init(PurpleProtocolXferInterface *iface) { + iface->can_receive = test_purple_protocol_xfer_can_receive; + iface->new_xfer = NULL; +G_DEFINE_TYPE_WITH_CODE( + TestPurpleProtocolXfer, + test_purple_protocol_xfer, + PURPLE_TYPE_PROTOCOL_XFER, + test_purple_protocol_xfer_iface_init +test_purple_protocol_xfer_init(TestPurpleProtocolXfer *self) { +test_purple_protocol_xfer_class_init(TestPurpleProtocolXferClass *klass){ +/****************************************************************************** + *****************************************************************************/ +test_purple_protocol_xfer_can_receive_func(void) { + TestPurpleProtocolXfer *xfer = g_object_new(test_purple_protocol_xfer_get_type(), NULL); + PurpleConnection *c = g_object_new(PURPLE_TYPE_CONNECTION, NULL); + gboolean actual = FALSE; + xfer->can_send = FALSE; + actual = purple_protocol_xfer_can_receive( + PURPLE_PROTOCOL_XFER(xfer), + g_assert_false(actual); + actual = purple_protocol_xfer_can_receive( + PURPLE_PROTOCOL_XFER(xfer), +/****************************************************************************** + *****************************************************************************/ +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + #if GLIB_CHECK_VERSION(2, 38, 0) + g_test_set_nonfatal_assertions(); + #endif /* GLIB_CHECK_VERSION(2, 38, 0) */ + g_test_add_func("/protocol-xfer/can-receive", test_purple_protocol_xfer_can_receive_func);