Sun, 10 Aug 2025 23:44:08 +0800
Add Purple.Conversation.find_message_by_id
The method was added so that a protocol or plugin could easily lookup
for the reference for a message. This will be especially useful when a
protocol received a quoted message but only with an id.
| 43293 | 1 | /* |
| 2 | * Purple - Internet Messaging Library | |
| 3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> | |
| 4 | * | |
| 5 | * This library is free software; you can redistribute it and/or | |
| 6 | * modify it under the terms of the GNU Lesser General Public | |
| 7 | * License as published by the Free Software Foundation; either | |
| 8 | * version 2 of the License, or (at your option) any later version. | |
| 9 | * | |
| 10 | * This library is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | * Lesser General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU Lesser General Public | |
| 16 | * License along with this library; if not, see <https://www.gnu.org/licenses/>. | |
| 17 | */ | |
| 18 | ||
| 19 | #include <glib.h> | |
| 20 | ||
| 21 | #include <birb.h> | |
| 22 | ||
| 23 | #include <purple.h> | |
| 24 | ||
| 25 | /****************************************************************************** | |
| 26 | * Tests | |
| 27 | *****************************************************************************/ | |
| 28 | static void | |
| 29 | test_purple_scheduler_new(void) { | |
| 30 | PurpleScheduler *scheduler = NULL; | |
| 31 | ||
| 32 | scheduler = purple_scheduler_new(); | |
| 33 | birb_assert_type(scheduler, PURPLE_TYPE_SCHEDULER); | |
| 34 | g_assert_true(G_IS_LIST_MODEL(scheduler)); | |
| 35 | ||
| 36 | g_assert_finalize_object(scheduler); | |
| 37 | } | |
| 38 | ||
| 39 | static void | |
| 40 | test_purple_scheduler_properties(void) { | |
| 41 | PurpleScheduler *scheduler = NULL; | |
| 42 | GType item_type = G_TYPE_INVALID; | |
| 43 | guint n_items = 0; | |
| 44 | ||
| 45 | scheduler = g_object_new( | |
| 46 | PURPLE_TYPE_SCHEDULER, | |
| 47 | NULL); | |
| 48 | ||
| 49 | g_object_get( | |
| 50 | G_OBJECT(scheduler), | |
| 51 | "item-type", &item_type, | |
| 52 | "n-items", &n_items, | |
| 53 | NULL); | |
| 54 | ||
| 55 | g_assert_cmpuint(item_type, ==, PURPLE_TYPE_SCHEDULED_TASK); | |
| 56 | ||
| 57 | g_assert_cmpuint(n_items, ==, 0); | |
| 58 | ||
| 59 | g_assert_finalize_object(scheduler); | |
| 60 | } | |
| 61 | ||
| 62 | static void | |
| 63 | test_purple_scheduler_add_remove(void) { | |
| 64 | PurpleScheduledTask *task = NULL; | |
| 65 | PurpleScheduledTaskState state = PURPLE_SCHEDULED_TASK_STATE_UNSCHEDULED; | |
| 66 | PurpleScheduler *scheduler = NULL; | |
| 67 | GDateTime *execute_at = NULL; | |
| 68 | GDateTime *now = NULL; | |
| 69 | GError *error = NULL; | |
| 70 | guint counter = 0; | |
| 71 | gboolean result = FALSE; | |
| 72 | ||
| 73 | scheduler = purple_scheduler_new(); | |
| 74 | birb_assert_type(scheduler, PURPLE_TYPE_SCHEDULER); | |
| 75 | g_assert_true(G_IS_LIST_MODEL(scheduler)); | |
| 76 | ||
| 77 | /* Create our execute_at time. */ | |
| 78 | now = g_date_time_new_now_local(); | |
| 79 | execute_at = g_date_time_add(now, 10 * G_TIME_SPAN_MINUTE); | |
| 80 | g_clear_pointer(&now, g_date_time_unref); | |
| 81 | ||
| 82 | /* Wire up our signals. */ | |
| 83 | birb_count_list_model_items_changed(G_LIST_MODEL(scheduler), &counter); | |
| 84 | ||
| 85 | /* Create the task. */ | |
| 86 | task = purple_scheduled_task_new("test-scheduler", "Scheduler Tests", | |
| 87 | TRUE); | |
| 88 | birb_assert_type(task, PURPLE_TYPE_SCHEDULED_TASK); | |
| 89 | ||
| 90 | /* Make sure the task is unscheduled. */ | |
| 91 | state = purple_scheduled_task_get_state(task); | |
| 92 | g_assert_cmpuint(state, ==, PURPLE_SCHEDULED_TASK_STATE_UNSCHEDULED); | |
| 93 | ||
| 94 | /* Add the task to the scheduler. */ | |
| 95 | counter = 0; | |
| 96 | result = purple_scheduler_add_task(scheduler, task, execute_at, &error); | |
| 97 | ||
| 98 | g_assert_no_error(error); | |
| 99 | g_assert_true(result); | |
| 100 | ||
| 101 | /* Make sure items changed was called once and that we have 1 item in the | |
| 102 | * list model. | |
| 103 | */ | |
| 104 | g_assert_cmpuint(counter, ==, 1); | |
| 105 | birb_assert_list_model_n_items(scheduler, 1); | |
| 106 | ||
| 107 | /* Make sure that the task got scheduled. */ | |
| 108 | state = purple_scheduled_task_get_state(task); | |
| 109 | g_assert_cmpuint(state, ==, PURPLE_SCHEDULED_TASK_STATE_SCHEDULED); | |
| 110 | ||
| 111 | /* Remove the task. */ | |
| 112 | counter = 0; | |
| 113 | ||
| 114 | result = purple_scheduler_remove_task(scheduler, | |
| 115 | purple_scheduled_task_get_id(task)); | |
| 116 | g_assert_true(result); | |
| 117 | ||
| 118 | /* Make sure items changed was called once and that the model empty. */ | |
| 119 | g_assert_cmpuint(counter, ==, 1); | |
| 120 | birb_assert_list_model_n_items(scheduler, 0); | |
| 121 | ||
| 122 | /* Make sure the that the task got cancelled. */ | |
| 123 | state = purple_scheduled_task_get_state(task); | |
| 124 | g_assert_cmpuint(state, ==, PURPLE_SCHEDULED_TASK_STATE_CANCELLED); | |
| 125 | ||
| 126 | /* After removal from the scheduler, only our reference should exist. */ | |
| 127 | g_assert_finalize_object(task); | |
| 128 | ||
| 129 | /* Clean up the scheduler. */ | |
| 130 | g_assert_finalize_object(scheduler); | |
| 131 | ||
| 132 | g_clear_pointer(&execute_at, g_date_time_unref); | |
| 133 | } | |
| 134 | ||
| 135 | static void | |
| 136 | test_purple_scheduler_add_already_scheduled(void) { | |
| 137 | PurpleScheduledTask *task = NULL; | |
| 138 | PurpleScheduler *scheduler = NULL; | |
| 139 | GDateTime *original_execute_at = NULL; | |
| 140 | GDateTime *updated_execute_at = NULL; | |
| 141 | GError *error = NULL; | |
| 142 | gboolean result = FALSE; | |
| 143 | ||
| 144 | scheduler = purple_scheduler_new(); | |
| 145 | ||
| 146 | /* Create the task. */ | |
| 147 | task = purple_scheduled_task_new("test-scheduler", "Scheduler Tests", | |
| 148 | TRUE); | |
| 149 | ||
| 150 | /* Schedule the task and store the original execute_at. */ | |
| 151 | result = purple_scheduled_task_schedule_relative(task, | |
| 152 | 10 * G_TIME_SPAN_MILLISECOND, | |
| 153 | &error); | |
| 154 | g_assert_no_error(error); | |
| 155 | g_assert_true(result); | |
| 156 | ||
| 157 | original_execute_at = purple_scheduled_task_get_execute_at(task); | |
| 158 | if(original_execute_at != NULL) { | |
| 159 | g_date_time_ref(original_execute_at); | |
| 160 | } | |
| 161 | ||
| 162 | /* Add the task to the scheduler. */ | |
| 163 | result = purple_scheduler_add_task_relative(scheduler, | |
| 164 | task, | |
| 165 | 100 * G_TIME_SPAN_MILLISECOND, | |
| 166 | &error); | |
| 167 | g_assert_no_error(error); | |
| 168 | g_assert_true(result); | |
| 169 | ||
| 170 | /* Get the execute time of the task and verify that it is not the same as | |
| 171 | * the original time. | |
| 172 | */ | |
| 173 | updated_execute_at = purple_scheduled_task_get_execute_at(task); | |
| 174 | g_assert_false(birb_date_time_equal(original_execute_at, | |
| 175 | updated_execute_at)); | |
| 176 | ||
| 177 | /* Clean up everything. */ | |
| 178 | g_assert_finalize_object(scheduler); | |
| 179 | g_assert_finalize_object(task); | |
| 180 | g_clear_pointer(&original_execute_at, g_date_time_unref); | |
| 181 | } | |
| 182 | ||
| 183 | static void | |
| 184 | test_purple_scheduler_double_add(void) { | |
| 185 | PurpleScheduledTask *task = NULL; | |
| 186 | PurpleScheduledTaskState state = PURPLE_SCHEDULED_TASK_STATE_UNSCHEDULED; | |
| 187 | PurpleScheduler *scheduler = NULL; | |
| 188 | GDateTime *execute_at = NULL; | |
| 189 | GDateTime *now = NULL; | |
| 190 | GError *error = NULL; | |
| 191 | guint counter = 0; | |
| 192 | gboolean result = FALSE; | |
| 193 | ||
| 194 | scheduler = purple_scheduler_new(); | |
| 195 | birb_assert_type(scheduler, PURPLE_TYPE_SCHEDULER); | |
| 196 | g_assert_true(G_IS_LIST_MODEL(scheduler)); | |
| 197 | ||
| 198 | /* Create our execute_at time. */ | |
| 199 | now = g_date_time_new_now_local(); | |
| 200 | execute_at = g_date_time_add(now, 10 * G_TIME_SPAN_MINUTE); | |
| 201 | g_clear_pointer(&now, g_date_time_unref); | |
| 202 | ||
| 203 | /* Wire up our signals. */ | |
| 204 | birb_count_list_model_items_changed(G_LIST_MODEL(scheduler), &counter); | |
| 205 | ||
| 206 | /* Create the task. */ | |
| 207 | task = purple_scheduled_task_new("test-scheduler", "Scheduler Tests", | |
| 208 | TRUE); | |
| 209 | birb_assert_type(task, PURPLE_TYPE_SCHEDULED_TASK); | |
| 210 | ||
| 211 | /* Make sure the task is unscheduled. */ | |
| 212 | state = purple_scheduled_task_get_state(task); | |
| 213 | g_assert_cmpuint(state, ==, PURPLE_SCHEDULED_TASK_STATE_UNSCHEDULED); | |
| 214 | ||
| 215 | /* Add the task to the scheduler. */ | |
| 216 | counter = 0; | |
| 217 | result = purple_scheduler_add_task(scheduler, task, execute_at, &error); | |
| 218 | ||
| 219 | g_assert_no_error(error); | |
| 220 | g_assert_true(result); | |
| 221 | ||
| 222 | /* Make sure items changed was called once and that we have 1 item in the | |
| 223 | * list model. | |
| 224 | */ | |
| 225 | g_assert_cmpuint(counter, ==, 1); | |
| 226 | birb_assert_list_model_n_items(scheduler, 1); | |
| 227 | ||
| 228 | /* Make sure that the task got scheduled. */ | |
| 229 | state = purple_scheduled_task_get_state(task); | |
| 230 | g_assert_cmpuint(state, ==, PURPLE_SCHEDULED_TASK_STATE_SCHEDULED); | |
| 231 | ||
| 232 | /* Now add the task again. */ | |
| 233 | counter = 0; | |
| 234 | result = purple_scheduler_add_task(scheduler, task, execute_at, &error); | |
| 235 | g_assert_error(error, | |
| 236 | PURPLE_SCHEDULER_ERROR, | |
| 237 | PURPLE_SCHEDULER_ERROR_TASK_EXISTS); | |
| 238 | g_clear_error(&error); | |
| 239 | g_assert_false(result); | |
| 240 | ||
| 241 | /* Make sure the items-changed signal wasn't called and that we still only | |
| 242 | * have one item in the list. | |
| 243 | */ | |
| 244 | g_assert_cmpuint(counter, ==, 0); | |
| 245 | birb_assert_list_model_n_items(scheduler, 1); | |
| 246 | ||
| 247 | /* Cleanup. We don't remove the task because we want to make sure the | |
| 248 | * scheduler will cancel it when it shuts down. Also the task is last as | |
| 249 | * it's still known to the scheduler. | |
| 250 | */ | |
| 251 | g_assert_finalize_object(scheduler); | |
| 252 | ||
| 253 | state = purple_scheduled_task_get_state(task); | |
| 254 | g_assert_cmpuint(state, ==, PURPLE_SCHEDULED_TASK_STATE_CANCELLED); | |
| 255 | ||
| 256 | g_assert_finalize_object(task); | |
| 257 | ||
| 258 | g_clear_pointer(&execute_at, g_date_time_unref); | |
| 259 | } | |
| 260 | ||
| 261 | static void | |
| 262 | test_purple_scheduler_double_remove(void) { | |
| 263 | PurpleScheduledTask *task = NULL; | |
| 264 | PurpleScheduledTaskState state = PURPLE_SCHEDULED_TASK_STATE_UNSCHEDULED; | |
| 265 | PurpleScheduler *scheduler = NULL; | |
| 266 | GDateTime *execute_at = NULL; | |
| 267 | GDateTime *now = NULL; | |
| 268 | GError *error = NULL; | |
| 269 | guint counter = 0; | |
| 270 | gboolean result = FALSE; | |
| 271 | ||
| 272 | scheduler = purple_scheduler_new(); | |
| 273 | birb_assert_type(scheduler, PURPLE_TYPE_SCHEDULER); | |
| 274 | g_assert_true(G_IS_LIST_MODEL(scheduler)); | |
| 275 | ||
| 276 | /* Create our execute_at time. */ | |
| 277 | now = g_date_time_new_now_local(); | |
| 278 | execute_at = g_date_time_add(now, 10 * G_TIME_SPAN_MINUTE); | |
| 279 | g_clear_pointer(&now, g_date_time_unref); | |
| 280 | ||
| 281 | /* Wire up our signals. */ | |
| 282 | birb_count_list_model_items_changed(G_LIST_MODEL(scheduler), &counter); | |
| 283 | ||
| 284 | /* Create the task. */ | |
| 285 | task = purple_scheduled_task_new("test-scheduler", "Scheduler Tests", | |
| 286 | TRUE); | |
| 287 | birb_assert_type(task, PURPLE_TYPE_SCHEDULED_TASK); | |
| 288 | ||
| 289 | /* Make sure the task is unscheduled. */ | |
| 290 | state = purple_scheduled_task_get_state(task); | |
| 291 | g_assert_cmpuint(state, ==, PURPLE_SCHEDULED_TASK_STATE_UNSCHEDULED); | |
| 292 | ||
| 293 | /* Add the task to the scheduler. */ | |
| 294 | counter = 0; | |
| 295 | result = purple_scheduler_add_task(scheduler, task, execute_at, &error); | |
| 296 | ||
| 297 | g_assert_no_error(error); | |
| 298 | g_assert_true(result); | |
| 299 | ||
| 300 | /* Make sure items changed was called once and that we have 1 item in the | |
| 301 | * list model. | |
| 302 | */ | |
| 303 | g_assert_cmpuint(counter, ==, 1); | |
| 304 | birb_assert_list_model_n_items(scheduler, 1); | |
| 305 | ||
| 306 | /* Make sure that the task got scheduled. */ | |
| 307 | state = purple_scheduled_task_get_state(task); | |
| 308 | g_assert_cmpuint(state, ==, PURPLE_SCHEDULED_TASK_STATE_SCHEDULED); | |
| 309 | ||
| 310 | /* Remove the task. */ | |
| 311 | counter = 0; | |
| 312 | result = purple_scheduler_remove_task(scheduler, | |
| 313 | purple_scheduled_task_get_id(task)); | |
| 314 | g_assert_true(result); | |
| 315 | ||
| 316 | /* Make sure the items-changed signal got called once and that we no longer | |
| 317 | * have any items in the model. | |
| 318 | */ | |
| 319 | g_assert_cmpuint(counter, ==, 1); | |
| 320 | birb_assert_list_model_n_items(scheduler, 0); | |
| 321 | ||
| 322 | /* Attempt to remove the task again. */ | |
| 323 | counter = 0; | |
| 324 | result = purple_scheduler_remove_task(scheduler, | |
| 325 | purple_scheduled_task_get_id(task)); | |
| 326 | g_assert_false(result); | |
| 327 | ||
| 328 | /* Make sure the items-changed signal wasn't called and that we still don't | |
| 329 | * have any items in the model. | |
| 330 | */ | |
| 331 | g_assert_cmpuint(counter, ==, 0); | |
| 332 | birb_assert_list_model_n_items(scheduler, 0); | |
| 333 | ||
| 334 | /* Cleanup. We remove task first because the scheduler shouldn't know about | |
| 335 | * it anymore. | |
| 336 | */ | |
| 337 | g_assert_finalize_object(task); | |
| 338 | g_assert_finalize_object(scheduler); | |
| 339 | ||
| 340 | g_clear_pointer(&execute_at, g_date_time_unref); | |
| 341 | } | |
| 342 | ||
| 343 | /****************************************************************************** | |
| 344 | * Main | |
| 345 | *****************************************************************************/ | |
| 346 | static void | |
| 347 | test_purple_scheduler_execute_task_cb(PurpleScheduler *scheduler, | |
| 348 | PurpleScheduledTask *task, | |
| 349 | const char *task_type, | |
| 350 | gpointer data) | |
| 351 | { | |
| 352 | PurpleScheduledTaskState state = PURPLE_SCHEDULED_TASK_STATE_UNSCHEDULED; | |
| 353 | const char *actual_task_type = NULL; | |
| 354 | guint *counter = data; | |
| 355 | ||
| 356 | birb_assert_type(scheduler, PURPLE_TYPE_SCHEDULER); | |
| 357 | ||
| 358 | state = purple_scheduled_task_get_state(task); | |
| 359 | g_assert_cmpuint(state, ==, PURPLE_SCHEDULED_TASK_STATE_EXECUTING); | |
| 360 | ||
| 361 | actual_task_type = purple_scheduled_task_get_task_type(task); | |
| 362 | g_assert_cmpstr(actual_task_type, ==, task_type); | |
| 363 | ||
| 364 | *counter = *counter + 1; | |
| 365 | } | |
| 366 | ||
| 367 | static void | |
| 368 | test_purple_scheduler_signals_quit_cb(G_GNUC_UNUSED PurpleScheduler *scheduler, | |
| 369 | G_GNUC_UNUSED PurpleScheduledTask *task, | |
| 370 | G_GNUC_UNUSED const char *task_type, | |
| 371 | gpointer data) | |
| 372 | { | |
| 373 | g_main_loop_quit(data); | |
| 374 | } | |
| 375 | ||
| 376 | static void | |
| 377 | test_purple_scheduler_signals_timeout_cb(gpointer data) { | |
| 378 | g_main_loop_quit(data); | |
| 379 | ||
| 380 | g_assert_not_reached(); | |
| 381 | } | |
| 382 | ||
| 383 | static void | |
| 384 | test_purple_scheduler_signals(void) { | |
| 385 | PurpleScheduledTask *task1 = NULL; | |
| 386 | PurpleScheduledTask *task2 = NULL; | |
| 387 | PurpleScheduler *scheduler = NULL; | |
| 388 | GError *error = NULL; | |
| 389 | GMainLoop *loop = NULL; | |
| 390 | guint all_counter = 0; | |
| 391 | guint detailed_counter = 0; | |
| 392 | gboolean result = FALSE; | |
| 393 | ||
| 394 | /* This test creates 2 tasks, one for 10ms from now and the second for 20ms | |
| 395 | * from now. When the 20ms task is executed the main loop will be quit and | |
| 396 | * allow the rest of the test to finish. | |
| 397 | * | |
| 398 | * There is a 2 second timeout to make sure we don't hang the unit tests if | |
| 399 | * something unexpected happens. We use 2 seconds because internally the | |
| 400 | * tasks are scheduled with g_timeout_add_seconds which tries to schedule | |
| 401 | * timeouts together to avoid excessive CPU wake ups, so 2 seconds should | |
| 402 | * cover that. | |
| 403 | */ | |
| 404 | ||
| 405 | /* Create the counter and add our signal handlers with and without the | |
| 406 | * detail. | |
| 407 | */ | |
| 408 | scheduler = purple_scheduler_new(); | |
| 409 | g_signal_connect(scheduler, | |
| 410 | "execute-task", | |
| 411 | G_CALLBACK(test_purple_scheduler_execute_task_cb), | |
| 412 | &all_counter); | |
| 413 | g_signal_connect(scheduler, | |
| 414 | "execute-task::scheduler-test-2", | |
| 415 | G_CALLBACK(test_purple_scheduler_execute_task_cb), | |
| 416 | &detailed_counter); | |
| 417 | ||
| 418 | /* Add the first task. */ | |
| 419 | task1 = purple_scheduled_task_new("scheduler-test-1", "Scheduler Test 1", | |
| 420 | TRUE); | |
| 421 | result = purple_scheduler_add_task_relative(scheduler, | |
| 422 | task1, | |
| 423 | 10 * G_TIME_SPAN_MILLISECOND, | |
| 424 | &error); | |
| 425 | g_assert_no_error(error); | |
| 426 | g_assert_true(result); | |
| 427 | ||
| 428 | /* Add the second task. */ | |
| 429 | task2 = purple_scheduled_task_new("scheduler-test-2", "Scheduler Test 2", | |
| 430 | FALSE); | |
| 431 | result = purple_scheduler_add_task_relative(scheduler, | |
| 432 | task2, | |
| 433 | 20 * G_TIME_SPAN_MILLISECOND, | |
| 434 | &error); | |
| 435 | g_assert_no_error(error); | |
| 436 | g_assert_true(result); | |
| 437 | ||
| 438 | /* Create the main loop to run the tasks. */ | |
| 439 | loop = g_main_loop_new(NULL, FALSE); | |
| 440 | ||
| 441 | /* Add a handler to quit the main loop when the second task is executed. */ | |
| 442 | g_signal_connect(scheduler, | |
| 443 | "execute-task::scheduler-test-2", | |
| 444 | G_CALLBACK(test_purple_scheduler_signals_quit_cb), | |
| 445 | loop); | |
| 446 | ||
| 447 | /* Add a timeout to avoid hangs on unexpected behavior. */ | |
| 448 | g_timeout_add_seconds_once(2, test_purple_scheduler_signals_timeout_cb, | |
| 449 | loop); | |
| 450 | ||
| 451 | /* Run the main loop. */ | |
| 452 | g_main_loop_run(loop); | |
| 453 | ||
| 454 | g_clear_pointer(&loop, g_main_loop_unref); | |
| 455 | ||
| 456 | /* Make sure the counters are correct. */ | |
| 457 | g_assert_cmpuint(all_counter, ==, 2); | |
| 458 | g_assert_cmpuint(detailed_counter, ==, 1); | |
| 459 | ||
| 460 | /* Make sure the scheduler is empty. */ | |
| 461 | birb_assert_list_model_n_items(scheduler, 0); | |
| 462 | ||
| 463 | g_assert_finalize_object(scheduler); | |
| 464 | g_assert_finalize_object(task1); | |
| 465 | g_assert_finalize_object(task2); | |
| 466 | } | |
| 467 | ||
| 468 | /****************************************************************************** | |
| 469 | * Main | |
| 470 | *****************************************************************************/ | |
| 471 | int | |
| 472 | main(int argc, char *argv[]) { | |
| 473 | g_test_init(&argc, &argv, NULL); | |
| 474 | g_test_set_nonfatal_assertions(); | |
| 475 | ||
| 476 | g_test_add_func("/scheduler/new", test_purple_scheduler_new); | |
| 477 | g_test_add_func("/scheduler/properties", test_purple_scheduler_properties); | |
| 478 | ||
| 479 | g_test_add_func("/scheduler/add-remove", test_purple_scheduler_add_remove); | |
| 480 | g_test_add_func("/scheduler/add-already-scheduled", | |
| 481 | test_purple_scheduler_add_already_scheduled); | |
| 482 | g_test_add_func("/scheduler/double-add", test_purple_scheduler_double_add); | |
| 483 | g_test_add_func("/scheduler/double-remove", | |
| 484 | test_purple_scheduler_double_remove); | |
| 485 | ||
| 486 | g_test_add_func("/scheduler/signals", test_purple_scheduler_signals); | |
| 487 | ||
| 488 | return g_test_run(); | |
| 489 | } |