From 3094dd9456d0dea9c58cd5c7baeb70b446aaa8df Mon Sep 17 00:00:00 2001 From: Trent Lloyd Date: Sun, 21 Aug 2005 21:23:14 +0000 Subject: [PATCH] * Add a simple entry group reset/change/commit to client-test git-svn-id: file:///home/lennart/svn/public/avahi/trunk@389 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-client/client-test.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/avahi-client/client-test.c b/avahi-client/client-test.c index a91e6af..5f7f030 100644 --- a/avahi-client/client-test.c +++ b/avahi-client/client-test.c @@ -78,6 +78,18 @@ static void test_free_entry_group (AvahiTimeout *timeout, void* userdata) avahi_entry_group_free (g); } +static void test_entry_group_reset (AvahiTimeout *timeout, void* userdata) +{ + AvahiEntryGroup *g = userdata; + + printf ("XXX: resetting entry group\n"); + avahi_entry_group_reset (g); + + avahi_entry_group_add_service (g, AVAHI_IF_UNSPEC, AF_UNSPEC, "Lathiat's Site", "_http._tcp", "", "", 80, "foo=bar2", NULL); + + avahi_entry_group_commit (g); +} + static void terminate(AvahiTimeout *timeout, void *userdata) { avahi_simple_poll_quit(simple_poll); @@ -146,12 +158,14 @@ int main (int argc, char *argv[]) { printf ("Sucessfully created service browser, path %s\n", avahi_service_browser_get_dbus_path (sb)); - avahi_elapse_time(&tv, 5000, 0); - poll_api->timeout_new(poll_api, &tv, test_free_entry_group, group); avahi_elapse_time(&tv, 8000, 0); + poll_api->timeout_new(poll_api, &tv, test_entry_group_reset, group); + avahi_elapse_time(&tv, 20000, 0); + poll_api->timeout_new(poll_api, &tv, test_free_entry_group, group); + avahi_elapse_time(&tv, 25000, 0); poll_api->timeout_new(poll_api, &tv, test_free_domain_browser, sb); - avahi_elapse_time(&tv, 20000, 0); + avahi_elapse_time(&tv, 30000, 0); poll_api->timeout_new(poll_api, &tv, terminate, NULL); for (;;) -- 2.39.5