Mon, 18 Mar 2019 20:45:14 -0500
remove the dbus-server header that was removed
| 39484 | 1 | /* |
| 2 | * Purple | |
| 3 | * | |
| 4 | * Purple is the legal property of its developers, whose names are too | |
| 5 | * numerous to list here. Please refer to the COPYRIGHT file distributed | |
| 6 | * with this source distribution | |
| 7 | * | |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or (at | |
| 11 | * your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, but | |
| 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 16 | * General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | |
| 21 | */ | |
| 22 | ||
| 23 | #include <glib.h> | |
| 24 | #include <string.h> | |
| 25 | ||
| 26 | #include <purple.h> | |
| 27 | ||
| 28 | /****************************************************************************** | |
| 29 | * Helpers | |
| 30 | *****************************************************************************/ | |
| 31 | static void | |
| 32 | _test_purple_protocol_action_callback(PurpleProtocolAction *action) { | |
| 33 | ||
| 34 | } | |
| 35 | ||
| 36 | /****************************************************************************** | |
| 37 | * Tests | |
| 38 | *****************************************************************************/ | |
| 39 | static void | |
| 40 | test_purple_protocol_action_new(void) { | |
| 41 | PurpleProtocolAction *action = NULL; | |
| 42 | ||
| 43 | action = purple_protocol_action_new( | |
| 44 | "label", | |
| 45 | _test_purple_protocol_action_callback | |
| 46 | ); | |
| 47 | g_assert_nonnull(action); | |
| 48 | ||
| 49 | g_assert_cmpstr(action->label, ==, "label"); | |
| 50 | g_assert(action->callback == _test_purple_protocol_action_callback); | |
| 51 | ||
| 52 | purple_protocol_action_free(action); | |
| 53 | } | |
| 54 | ||
| 55 | static void | |
| 56 | test_purple_protocol_action_copy(void) { | |
| 57 | PurpleProtocolAction *orig = NULL, *copy = NULL; | |
| 58 | ||
| 59 | orig = purple_protocol_action_new( | |
| 60 | "label", | |
| 61 | _test_purple_protocol_action_callback | |
| 62 | ); | |
| 63 | g_assert_nonnull(orig); | |
| 64 | ||
| 65 | copy = purple_protocol_action_copy(orig); | |
| 66 | purple_protocol_action_free(orig); | |
| 67 | ||
| 68 | g_assert_cmpstr(copy->label, ==, "label"); | |
| 69 | g_assert(copy->callback == _test_purple_protocol_action_callback); | |
| 70 | ||
| 71 | purple_protocol_action_free(copy); | |
| 72 | } | |
| 73 | ||
| 74 | /****************************************************************************** | |
| 75 | * Main | |
| 76 | *****************************************************************************/ | |
| 77 | gint | |
| 78 | main(gint argc, gchar **argv) { | |
| 79 | gint res = 0; | |
| 80 | ||
| 81 | g_test_init(&argc, &argv, NULL); | |
| 82 | ||
| 83 | g_test_set_nonfatal_assertions(); | |
| 84 | ||
| 85 | g_test_add_func( | |
| 86 | "/protocol-action/new", | |
| 87 | test_purple_protocol_action_new | |
| 88 | ); | |
| 89 | ||
| 90 | g_test_add_func( | |
| 91 | "/protocol-action/copy", | |
| 92 | test_purple_protocol_action_copy | |
| 93 | ); | |
| 94 | ||
| 95 | res = g_test_run(); | |
| 96 | ||
| 97 | return res; | |
| 98 | } |