summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2010-09-01 06:42:58 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2010-09-01 06:42:58 +0000
commit2c0464405f411d4ba91bae622fe11a586e8cebaf (patch)
tree2626f828b7694565bf958b45851f14ea92da3ee8 /testsuites
parent2010-08-30 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-2c0464405f411d4ba91bae622fe11a586e8cebaf.tar.bz2
2010-09-01 Ralf Corsépius <ralf.corsepius@rtems.org>
* POSIX/Makefile.am: Add htonl. * POSIX/htonl.c: New.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/libtests/ChangeLog5
-rw-r--r--testsuites/libtests/POSIX/Makefile.am3
-rw-r--r--testsuites/libtests/POSIX/htonl.c24
3 files changed, 32 insertions, 0 deletions
diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog
index fba80aeeba..894a5ef54d 100644
--- a/testsuites/libtests/ChangeLog
+++ b/testsuites/libtests/ChangeLog
@@ -1,3 +1,8 @@
+2010-09-01 Ralf Corsépius <ralf.corsepius@rtems.org>
+
+ * POSIX/Makefile.am: Add htonl.
+ * POSIX/htonl.c: New.
+
2010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
* malloctest/init.c: Update for heap API changes.
diff --git a/testsuites/libtests/POSIX/Makefile.am b/testsuites/libtests/POSIX/Makefile.am
index b4aae1b999..cbb043b2d1 100644
--- a/testsuites/libtests/POSIX/Makefile.am
+++ b/testsuites/libtests/POSIX/Makefile.am
@@ -52,6 +52,9 @@ getuid_SOURCES = getuid.c
# check_PROGRAMS += issetugid
# issetugid_SOURCES = issetugid.c
+check_PROGRAMS += htonl
+htonl_SOURCES = htonl.c
+
check_PROGRAMS += lseek
lseek_SOURCES = lseek.c
diff --git a/testsuites/libtests/POSIX/htonl.c b/testsuites/libtests/POSIX/htonl.c
new file mode 100644
index 0000000000..71aa969db7
--- /dev/null
+++ b/testsuites/libtests/POSIX/htonl.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2010 by
+ * Ralf Corsépius, Ulm, Germany. All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+#include <arpa/inet.h>
+
+int
+main (void)
+{
+ uint32_t u32;
+ uint16_t u16;
+
+ u32 = htonl(0x12345678);
+ u16 = htons(0x1234);
+
+ u32 = ntohl(0x12345678);
+ u16 = ntohs(0x1234);
+
+ return 0;
+}