Add indentation to src/Makefile.am
[deb_shairplay.git] / src / test / dnssd_test.m
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <unistd.h>
4 #include <Foundation/Foundation.h>
5
6 #include "dnssd.h"
7 #include "compat.h"
8
9 int
10 main(int argc, char *argv[])
11 {
12 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
13 const char hwaddr[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB };
14 dnssd_t *dnssd;
15
16 dnssd = dnssd_init(NULL);
17 if (!dnssd) {
18 printf("Failed to init dnssd\n");
19 return -1;
20 }
21 dnssd_register_raop(dnssd, "Test", 5000, hwaddr, sizeof(hwaddr));
22 dnssd_register_airplay(dnssd, "Test", 6000, hwaddr, sizeof(hwaddr));
23
24 sleepms(60000);
25
26 dnssd_unregister_raop(dnssd);
27 dnssd_unregister_airplay(dnssd);
28 dnssd_destroy(dnssd);
29 [pool release];
30
31 return 0;
32 }