Skip to content

Commit

Permalink
[mDNS] - Uncommented tc_cache_add_record
Browse files Browse the repository at this point in the history
  • Loading branch information
jelledevleeschouwer committed May 21, 2015
1 parent 85ea494 commit 1b338a6
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions test/unit/modunit_pico_mdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -1984,28 +1984,28 @@ END_TEST
/* MARK: Cache functions */
START_TEST(tc_mdns_cache_add_record)
{
// struct pico_mdns_record *record = NULL, *found = NULL;
// struct pico_ip4 rdata = {long_be(0x00FFFFFF)};
// const char *url = "foo.local";
// int ret = 0;
//
// printf("*********************** starting %s * \n", __func__);
//
// /* Create an A record with URL */
// record = pico_mdns_record_create(url, &rdata, 4, PICO_DNS_TYPE_A, 80,
// PICO_MDNS_RECORD_UNIQUE);
// fail_if(!record, "Record could not be created!\n");
//
// ret = pico_mdns_cache_add_record(record);
// fail_unless(0 == ret,
// "mdns_cache_add_record returned error!\n");
// found = pico_mdns_record_tree_find_record(record, &Cache);
// fail_unless((int)found, "mdns_cache_add_record failed!\n");
// ret = pico_mdns_cache_add_record(record);
// fail_unless(1 == ret,
// "mdns_cache_add_record returned error!\n");
//
// printf("*********************** ending %s * \n", __func__);
struct pico_mdns_record *record = NULL, *found = NULL;
struct pico_ip4 rdata = {long_be(0x00FFFFFF)};
const char *url = "foo.local";
int ret = 0;

printf("*********************** starting %s * \n", __func__);

/* Create an A record with URL */
record = pico_mdns_record_create(url, &rdata, 4, PICO_DNS_TYPE_A, 80,
PICO_MDNS_RECORD_UNIQUE);
fail_if(!record, "Record could not be created!\n");

ret = pico_mdns_cache_add_record(record);
fail_unless(0 == ret,
"mdns_cache_add_record returned error!\n");
found = pico_mdns_record_tree_find_record(record, &Cache);
fail_unless((int)found, "mdns_cache_add_record failed!\n");
ret = pico_mdns_cache_add_record(record);
fail_unless(1 == ret,
"mdns_cache_add_record returned error!\n");

printf("*********************** ending %s * \n", __func__);
}
END_TEST
START_TEST(tc_mdns_cache_flush)
Expand Down

0 comments on commit 1b338a6

Please sign in to comment.