summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-nss.c4
-rw-r--r--src/test/test-socket-util.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/test/test-nss.c b/src/test/test-nss.c
index 55af592287..c43bda5917 100644
--- a/src/test/test-nss.c
+++ b/src/test/test-nss.c
@@ -400,8 +400,8 @@ int main(int argc, char **argv) {
_cleanup_free_ char *dir = NULL, *hostname = NULL;
const char *module;
- const uint32_t local_address_ipv4 = htonl(0x7F000001);
- const uint32_t local_address_ipv4_2 = htonl(0x7F000002);
+ const uint32_t local_address_ipv4 = htobe32(0x7F000001);
+ const uint32_t local_address_ipv4_2 = htobe32(0x7F000002);
_cleanup_free_ struct local_address *addresses = NULL;
int n_addresses;
diff --git a/src/test/test-socket-util.c b/src/test/test-socket-util.c
index 1a439bd0d4..1f853a7f16 100644
--- a/src/test/test-socket-util.c
+++ b/src/test/test-socket-util.c
@@ -353,7 +353,7 @@ static void test_nameinfo_pretty(void) {
union sockaddr_union s = {
.in.sin_family = AF_INET,
.in.sin_port = 0,
- .in.sin_addr.s_addr = htonl(INADDR_ANY),
+ .in.sin_addr.s_addr = htobe32(INADDR_ANY),
};
int r;
@@ -391,17 +391,17 @@ static void test_sockaddr_equal(void) {
union sockaddr_union a = {
.in.sin_family = AF_INET,
.in.sin_port = 0,
- .in.sin_addr.s_addr = htonl(INADDR_ANY),
+ .in.sin_addr.s_addr = htobe32(INADDR_ANY),
};
union sockaddr_union b = {
.in.sin_family = AF_INET,
.in.sin_port = 0,
- .in.sin_addr.s_addr = htonl(INADDR_ANY),
+ .in.sin_addr.s_addr = htobe32(INADDR_ANY),
};
union sockaddr_union c = {
.in.sin_family = AF_INET,
.in.sin_port = 0,
- .in.sin_addr.s_addr = htonl(1234),
+ .in.sin_addr.s_addr = htobe32(1234),
};
union sockaddr_union d = {
.in6.sin6_family = AF_INET6,