diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-09-05 21:18:45 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-09-05 21:18:45 +0000 |
commit | 563b71afee70ac213a8bb28ce0697fcbae06aac3 (patch) | |
tree | 122d6a25630f68a9845651ba2295ef68f7d2af09 /src/include/gnunet_testing_lib.h | |
parent | cf6e2bdb1b9a5aedc4f090df853814b9df817e03 (diff) | |
download | gnunet-563b71afee70ac213a8bb28ce0697fcbae06aac3.tar.gz gnunet-563b71afee70ac213a8bb28ce0697fcbae06aac3.zip |
fixing API and clean up issues in testing
Diffstat (limited to 'src/include/gnunet_testing_lib.h')
-rw-r--r-- | src/include/gnunet_testing_lib.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index 945a3900b..39bc9d161 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h | |||
@@ -432,6 +432,7 @@ typedef void (*GNUNET_TESTING_NotifyConnection) (void *cls, | |||
432 | second_daemon, | 432 | second_daemon, |
433 | const char *emsg); | 433 | const char *emsg); |
434 | 434 | ||
435 | |||
435 | /** | 436 | /** |
436 | * Prototype of a callback function indicating that two peers | 437 | * Prototype of a callback function indicating that two peers |
437 | * are currently connected. | 438 | * are currently connected. |
@@ -497,12 +498,11 @@ GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon *daemon); | |||
497 | * Check whether the given daemon is running. | 498 | * Check whether the given daemon is running. |
498 | * | 499 | * |
499 | * @param daemon the daemon to check | 500 | * @param daemon the daemon to check |
500 | * | ||
501 | * @return GNUNET_YES if the daemon is up, GNUNET_NO if the | 501 | * @return GNUNET_YES if the daemon is up, GNUNET_NO if the |
502 | * daemon is down, GNUNET_SYSERR on error. | 502 | * daemon is down, GNUNET_SYSERR on error. |
503 | */ | 503 | */ |
504 | int | 504 | int |
505 | GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); | 505 | GNUNET_TESTING_test_daemon_running (struct GNUNET_TESTING_Daemon *daemon); |
506 | 506 | ||
507 | 507 | ||
508 | /** | 508 | /** |
@@ -545,7 +545,7 @@ GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon, | |||
545 | */ | 545 | */ |
546 | void | 546 | void |
547 | GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, | 547 | GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, |
548 | char *service, | 548 | const char *service, |
549 | struct GNUNET_TIME_Relative timeout, | 549 | struct GNUNET_TIME_Relative timeout, |
550 | GNUNET_TESTING_NotifyDaemonRunning cb, | 550 | GNUNET_TESTING_NotifyDaemonRunning cb, |
551 | void *cb_cls); | 551 | void *cb_cls); |
@@ -643,7 +643,7 @@ GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, | |||
643 | */ | 643 | */ |
644 | void | 644 | void |
645 | GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, | 645 | GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, |
646 | char *service, | 646 | const char *service, |
647 | struct GNUNET_TIME_Relative timeout, | 647 | struct GNUNET_TIME_Relative timeout, |
648 | GNUNET_TESTING_NotifyCompletion cb, | 648 | GNUNET_TESTING_NotifyCompletion cb, |
649 | void *cb_cls); | 649 | void *cb_cls); |
@@ -715,7 +715,16 @@ GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup *pg); | |||
715 | 715 | ||
716 | 716 | ||
717 | /** | 717 | /** |
718 | * Establish a connection between two GNUnet daemons. | 718 | * Handle for an active request to connect two peers. |
719 | */ | ||
720 | struct GNUNET_TESTING_ConnectContext; | ||
721 | |||
722 | |||
723 | /** | ||
724 | * Establish a connection between two GNUnet daemons. The daemons | ||
725 | * must both be running and not be stopped until either the | ||
726 | * 'cb' callback is called OR the connection request has been | ||
727 | * explicitly cancelled. | ||
719 | * | 728 | * |
720 | * @param d1 handle for the first daemon | 729 | * @param d1 handle for the first daemon |
721 | * @param d2 handle for the second daemon | 730 | * @param d2 handle for the second daemon |
@@ -727,8 +736,9 @@ GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup *pg); | |||
727 | * the HELLO has already been exchanged | 736 | * the HELLO has already been exchanged |
728 | * @param cb function to call at the end | 737 | * @param cb function to call at the end |
729 | * @param cb_cls closure for cb | 738 | * @param cb_cls closure for cb |
739 | * @return handle to cancel the request, NULL on error | ||
730 | */ | 740 | */ |
731 | void /* struct GNUNET_TESTING_ConnectContext * */ | 741 | struct GNUNET_TESTING_ConnectContext * |
732 | GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, | 742 | GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, |
733 | struct GNUNET_TESTING_Daemon *d2, | 743 | struct GNUNET_TESTING_Daemon *d2, |
734 | struct GNUNET_TIME_Relative timeout, | 744 | struct GNUNET_TIME_Relative timeout, |
@@ -738,7 +748,7 @@ GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, | |||
738 | void *cb_cls); | 748 | void *cb_cls); |
739 | 749 | ||
740 | 750 | ||
741 | #if 0 | 751 | |
742 | /** | 752 | /** |
743 | * Cancel an attempt to connect two daemons. | 753 | * Cancel an attempt to connect two daemons. |
744 | * | 754 | * |
@@ -747,7 +757,7 @@ GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, | |||
747 | void | 757 | void |
748 | GNUNET_TESTING_daemons_connect_cancel (struct GNUNET_TESTING_ConnectContext | 758 | GNUNET_TESTING_daemons_connect_cancel (struct GNUNET_TESTING_ConnectContext |
749 | *cc); | 759 | *cc); |
750 | #endif | 760 | |
751 | 761 | ||
752 | 762 | ||
753 | /** | 763 | /** |