Skip to content
Snippets Groups Projects
Commit 953c2163 authored by gregor herrmann's avatar gregor herrmann
Browse files

Add patch from upstream Git repo to fix tests

with newer libnanomsg.

Closes: #823310
parent ebe4cc76
No related branches found
No related tags found
No related merge requests found
From 42e2d40aa6f0ed363e2788607d893597ba3c6204 Mon Sep 17 00:00:00 2001
From: Boris Zentner <bzm@2bz.de>
Date: Fri, 18 Dec 2015 20:48:07 +0100
Subject: [PATCH] Fix test cases with libnanomsg-0.8beta
libnanomsg-0.8's error message is more specific and return ETIMEDOUT instead of
EAGAIN
---
t/inproc.t | 4 ++--
t/separation.t | 8 ++++----
t/timeo.t | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/t/inproc.t b/t/inproc.t
index 008a1c4..cd79c25 100644
--- a/t/inproc.t
+++ b/t/inproc.t
@@ -52,7 +52,7 @@ my $socket_address = 'inproc://test';
while (1) {
my $ret = nn_send $sc, '0123456789', 0;
if (!defined $ret) {
- ok nn_errno == EAGAIN;
+ ok ( nn_errno == EAGAIN or nn_errno == ETIMEDOUT );
last;
}
is $ret, 10;
@@ -63,7 +63,7 @@ my $socket_address = 'inproc://test';
is nn_recv($sb, my $buf, 256, 0), 10;
is nn_send($sc, '0123456789', 0), 10;
ok !defined nn_send($sc, '0123456789', 0);
- ok nn_errno == EAGAIN;
+ ok ( nn_errno == EAGAIN or nn_errno == ETIMEDOUT );
is nn_recv($sb, $buf, 256, 0), 10 for 1 .. 20;
diff --git a/t/separation.t b/t/separation.t
index 84a9b7d..d0e34bd 100644
--- a/t/separation.t
+++ b/t/separation.t
@@ -21,7 +21,7 @@ my $socket_address_tcp = 'tcp://127.0.0.1:' . empty_port;
ok nn_setsockopt($pair, NN_SOL_SOCKET, NN_SNDTIMEO, 100);
is nn_send($pair, 'ABC', 0), undef;
- ok nn_errno == EAGAIN;
+ ok ( nn_errno == EAGAIN or nn_errno == ETIMEDOUT );
ok nn_close $_ for $pull, $pair;
}
@@ -38,7 +38,7 @@ my $socket_address_tcp = 'tcp://127.0.0.1:' . empty_port;
ok nn_setsockopt($pair, NN_SOL_SOCKET, NN_SNDTIMEO, 100);
is nn_send($pair, 'ABC', 0), undef;
- ok nn_errno == EAGAIN;
+ ok ( nn_errno == EAGAIN or nn_errno == ETIMEDOUT );
ok nn_close $_ for $pull, $pair;
}
@@ -55,7 +55,7 @@ my $socket_address_tcp = 'tcp://127.0.0.1:' . empty_port;
ok nn_setsockopt($pair, NN_SOL_SOCKET, NN_SNDTIMEO, 100);
is nn_send($pair, 'ABC', 0), undef;
- ok nn_errno == EAGAIN;
+ ok ( nn_errno == EAGAIN or nn_errno == ETIMEDOUT );
ok nn_close $_ for $pull, $pair;
}
@@ -72,7 +72,7 @@ my $socket_address_tcp = 'tcp://127.0.0.1:' . empty_port;
ok nn_setsockopt($pair, NN_SOL_SOCKET, NN_SNDTIMEO, 100);
is nn_send($pair, 'ABC', 0), undef;
- ok nn_errno == EAGAIN;
+ ok ( nn_errno == EAGAIN or nn_errno == ETIMEDOUT );
ok nn_close $_ for $pull, $pair;
}
diff --git a/t/timeo.t b/t/timeo.t
index eafd257..0fe311f 100644
--- a/t/timeo.t
+++ b/t/timeo.t
@@ -25,7 +25,7 @@ my ($elapsed, $ret) = timeit {
};
ok !defined $ret;
-ok nn_errno == EAGAIN;
+ok ( nn_errno == EAGAIN or nn_errno == ETIMEDOUT );
cmp_ok $elapsed, '>=', 0.1;
cmp_ok $elapsed, '<=', 0.12;
@@ -36,7 +36,7 @@ ok nn_setsockopt($s, NN_SOL_SOCKET, NN_SNDTIMEO, $timeo);
};
ok !defined $ret;
-ok nn_errno == EAGAIN;
+ok ( nn_errno == EAGAIN or nn_errno == ETIMEDOUT );
cmp_ok $elapsed, '>=', 0.1;
cmp_ok $elapsed, '<=', 0.12;
--
2.8.1
fix_spelling_error_in_manpage.patch
0001-Fix-test-cases-with-libnanomsg-0.8beta.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment