about summary refs log tree commit diff
path: root/inet/tst-ether_aton.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-04-28 15:58:57 +0000
committerUlrich Drepper <drepper@redhat.com>1998-04-28 15:58:57 +0000
commit6739da7fabd555a8f0e832e8c9aee6ff69e8f9fd (patch)
tree6a0b68195f781b29a6babfef19ff744f1829cfc5 /inet/tst-ether_aton.c
parent5005d3b3302adfe379c6f4404f79f204d7c52cdb (diff)
downloadglibc-6739da7fabd555a8f0e832e8c9aee6ff69e8f9fd.tar.gz
glibc-6739da7fabd555a8f0e832e8c9aee6ff69e8f9fd.tar.xz
glibc-6739da7fabd555a8f0e832e8c9aee6ff69e8f9fd.zip
Update.
	* inet/Makefile (tests): Add tst-ether_aton.
	* inet/tst-ether_aton.c: New file.
Diffstat (limited to 'inet/tst-ether_aton.c')
-rw-r--r--inet/tst-ether_aton.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/inet/tst-ether_aton.c b/inet/tst-ether_aton.c
new file mode 100644
index 0000000000..76ce8af445
--- /dev/null
+++ b/inet/tst-ether_aton.c
@@ -0,0 +1,28 @@
+#include <netinet/ether.h>
+
+int
+main (int argc, char *argv[])
+{
+  struct ether_addr *val;
+  int result;
+
+  val = ether_aton ("12:34:56:78:9a:bc");
+
+  printf ("ether_aton (\"12:34:56:78:9a:bc\") = %hhx:%hhx:%hhx:%hhx:%hhx:%hhx\n",
+	  val->ether_addr_octet[0],
+	  val->ether_addr_octet[1],
+	  val->ether_addr_octet[2],
+	  val->ether_addr_octet[3],
+	  val->ether_addr_octet[4],
+	  val->ether_addr_octet[5]);
+
+
+  result = (val->ether_addr_octet[0] != 0x12
+	    || val->ether_addr_octet[1] != 0x34
+	    || val->ether_addr_octet[2] != 0x56
+	    || val->ether_addr_octet[3] != 0x78
+	    || val->ether_addr_octet[4] != 0x9a
+	    || val->ether_addr_octet[5] != 0xbc);
+
+  return result;
+}