about summary refs log tree commit diff
path: root/sunrpc/tst-getmyaddr.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-09-28 23:08:14 +0000
committerUlrich Drepper <drepper@redhat.com>2004-09-28 23:08:14 +0000
commit4f21c95d3a51a81fdbda3de46ce38e729f3c7b0b (patch)
treeeb3095ca23d229d790bc1e40f6d5582a031e43e4 /sunrpc/tst-getmyaddr.c
parent53b4fed6efb980044ff7152c725557de846a23bf (diff)
downloadglibc-4f21c95d3a51a81fdbda3de46ce38e729f3c7b0b.tar.gz
glibc-4f21c95d3a51a81fdbda3de46ce38e729f3c7b0b.tar.xz
glibc-4f21c95d3a51a81fdbda3de46ce38e729f3c7b0b.zip
Update.
	* sunrpc/Makefile (xtests): Add tst-getmyaddr.
	* sunrpc/tst-getmyaddr.c: New file.
Diffstat (limited to 'sunrpc/tst-getmyaddr.c')
-rw-r--r--sunrpc/tst-getmyaddr.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sunrpc/tst-getmyaddr.c b/sunrpc/tst-getmyaddr.c
new file mode 100644
index 0000000000..1eaf9b22ca
--- /dev/null
+++ b/sunrpc/tst-getmyaddr.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <string.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <rpc/clnt.h>
+
+
+static int
+do_test (void)
+{
+  struct sockaddr_in ad;
+  struct sockaddr_in ad2;
+  memset (&ad, '\0', sizeof (ad));
+  memset (&ad2, '\0', sizeof (ad2));
+
+  get_myaddress (&ad);
+
+  printf ("addr = %s:%d\n", inet_ntoa (ad.sin_addr), ad.sin_port);
+
+  return memcmp (&ad, &ad2, sizeof (ad)) == 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"