Dne St 21.zář.2011 03:09:56,
http://bochecha.id.fedoraproject.org/ napsal(a):
Show quoted text
Attached patch fixes the tests.
From ab1700d55b1b802e2eae4657b53b6017ae68047b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 9 Nov 2016 13:17:40 +0100
Subject: [PATCH] Fix tests for big endian
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Tests in t/13netlink-message-attrs.t and
t/20io-socket-netlink-generic.t failed on 64-bit big-endian PowerPC
machines.
This patch fixes erroneous bswap() calls in the tests by splitting
nlmsg_type and nlmsg_flags fields in t/20io-socket-netlink-generic.t
and handling zero-terminted byte-string literaly in
t/13netlink-message-attrs.t. It also fixes incorrect length
specification of a zero-terminated byte-string.
CPAN RT#71112
Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com>
---
t/13netlink-message-attrs.t | 2 +-
t/20io-socket-netlink-generic.t | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/13netlink-message-attrs.t b/t/13netlink-message-attrs.t
index 133d18e..132587f 100644
--- a/t/13netlink-message-attrs.t
+++ b/t/13netlink-message-attrs.t
@@ -87,7 +87,7 @@ $message = $sock->unpack_message(
bswap("\5\0").bswap("\1\0").bswap("\7")."\0\0\0".
bswap("\6\0").bswap("\2\0").bswap("\x59\0")."\0\0".
bswap("\x08\0").bswap("\3\0").bswap("\xf3\3\0\0").
- bswap("\7\0").bswap("\4\0").bswap("FGH\0").
+ bswap("\x08\0").bswap("\4\0")."FGH\0".
bswap("\x0a\0").bswap("\5\0")."X\0Y\0Z\0\0\0".
bswap("\x0c\0").bswap("\6\0").
bswap("\5\0").bswap("\1\0").bswap("\x15")."\0\0\0",
diff --git a/t/20io-socket-netlink-generic.t b/t/20io-socket-netlink-generic.t
index 16fb29e..c5cadde 100644
--- a/t/20io-socket-netlink-generic.t
+++ b/t/20io-socket-netlink-generic.t
@@ -53,7 +53,7 @@ isa_ok( $message, 'IO::Socket::Netlink::Generic::_Message', '$message' );
ok( $message->can( "cmd" ), '$message has ->cmd accessor' );
is_hexstr( $message->pack,
- bswap("\x14\0\0\0").bswap("\x1e\0\0\0")."\0\0\0\0\0\0\0\0".
+ bswap("\x14\0\0\0").bswap("\x1e\0").bswap("\0\0")."\0\0\0\0\0\0\0\0".
"\1\2\0\0",
'$message->pack' );
--
2.7.4