summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Laboissière <rafael@debian.org>2022-12-05 08:56:45 -0300
committerRafael Laboissière <rafael@debian.org>2022-12-05 08:56:45 -0300
commitfa138d2672712b61f1bf472ed22dd68999a12e39 (patch)
tree4d0077a944289eb90e4b03dc3be463f4e31e4b2a
parentd568c6bdfebc308b55c87e29bd8a2d4c23f7104c (diff)
Do not fail when calling resolvehost in standalone system
Forwarded: not-needed Last-Update: 2021-11-15 This is necessary when there is no network access at package build time. Gbp-Pq: Name xtest-resolvehost.patch
-rw-r--r--src/tcp/__tcp_properties__.cc6
-rw-r--r--src/tcpclient/__tcpclient_properties__.cc14
-rw-r--r--src/tcpclient/__tcpclient_read__.cc2
-rw-r--r--src/tcpclient/__tcpclient_write__.cc2
-rw-r--r--src/tcpclient/tcpclient.cc4
5 files changed, 18 insertions, 10 deletions
diff --git a/src/tcp/__tcp_properties__.cc b/src/tcp/__tcp_properties__.cc
index 4ca11e7..e03f229 100644
--- a/src/tcp/__tcp_properties__.cc
+++ b/src/tcp/__tcp_properties__.cc
@@ -95,7 +95,11 @@ Undocumented internal function.\n\
}
#if 0
%!shared ip
-%! ip = resolvehost("www.octave.org", "address");
+%! try
+%! ip = resolvehost("www.octave.org", "address");
+%! catch
+%! warning ("Network access is neede for running the unit tests.");
+%! end_try_catch
%!xtest
%! # test get
diff --git a/src/tcpclient/__tcpclient_properties__.cc b/src/tcpclient/__tcpclient_properties__.cc
index a9e64aa..624e462 100644
--- a/src/tcpclient/__tcpclient_properties__.cc
+++ b/src/tcpclient/__tcpclient_properties__.cc
@@ -158,9 +158,13 @@ Undocumented internal function.\n\
}
#if 0
%!shared ip
-%! ip = resolvehost("www.octave.org", "address");
+%! try
+%! ip = resolvehost("www.octave.org", "address");
+%! catch
+%! warning ("Network access is neede for running the unit tests.");
+%! end_try_catch
-%!test
+%!xtest
%! # test get
%! a = tcpclient (ip, 80);
%! assert (__tcpclient_properties__ (a,"type"), "tcpclient");
@@ -172,7 +176,7 @@ Undocumented internal function.\n\
%! fail ("__tcpclient_properties__ (a,'invalid')", "invalid property name");
%! clear a
-%!test
+%!xtest
%! # test set
%! a = tcpclient(ip, 80);
%! __tcpclient_properties__ (a, 'name', "mytest");
@@ -180,7 +184,7 @@ Undocumented internal function.\n\
%! fail ("__tcpclient_properties__ (a,'invalid', 1)", "invalid property name");
%! clear a
-%!test
+%!xtest
%! # test flush
%! a = tcpclient(ip, 80);
%! __tcpclient_properties__ (a, 'flush', 0);
@@ -194,7 +198,7 @@ Undocumented internal function.\n\
%!error <wrong number of arguments> __tcpclient_properties__ (1)
-%!test
+%!xtest
%! a = tcpclient (ip, 80);
%! fail ("__tcpclient_properties__ (a, 'name', 'test', 0)", "wrong number of arguments");
%! clear a
diff --git a/src/tcpclient/__tcpclient_read__.cc b/src/tcpclient/__tcpclient_read__.cc
index f7a868e..7e8bdf0 100644
--- a/src/tcpclient/__tcpclient_read__.cc
+++ b/src/tcpclient/__tcpclient_read__.cc
@@ -112,7 +112,7 @@ Private function t read from tcpclient interface.\n \
}
#if 0
-%!test
+%!xtest
%! addr = resolvehost ('gnu.org', 'address');
%! a = tcpclient (addr, 80);
%! assert (! isnull (a));
diff --git a/src/tcpclient/__tcpclient_write__.cc b/src/tcpclient/__tcpclient_write__.cc
index 6f73363..9a9f7df 100644
--- a/src/tcpclient/__tcpclient_write__.cc
+++ b/src/tcpclient/__tcpclient_write__.cc
@@ -91,7 +91,7 @@ Upon successful completion, __tcpclient_write__() shall return the number of byt
%!error <Invalid call to __tcpclient_write__> __tcpclient_write__()
-%!test
+%!xtest
%! addr = resolvehost ('gnu.org', 'address');
%! a = tcpclient (addr, 80);;
%! # call HTTP HEAD
diff --git a/src/tcpclient/tcpclient.cc b/src/tcpclient/tcpclient.cc
index 7a6f9f5..3457b2a 100644
--- a/src/tcpclient/tcpclient.cc
+++ b/src/tcpclient/tcpclient.cc
@@ -193,14 +193,14 @@ User data\n \
}
#if 0
-%!test
+%!xtest
%! addr = resolvehost ('gnu.org', 'address');
%! a = tcpclient (addr, 80);
%! assert (! isnull (a));
%! assert (isa (a, 'octave_tcpclient'));
%! clear a
-%!test
+%!xtest
%! addr = resolvehost ('gnu.org', 'address');
%! a = tcpclient (addr, 80, 'name', 'test', 'timeout', 2.5);
%! assert (! isnull (a));