diff options
| author | Robert Pluim | 2019-11-07 16:16:39 +0100 |
|---|---|---|
| committer | Robert Pluim | 2019-11-08 10:04:13 +0100 |
| commit | 063277c5ecd82551b2bf1409d1583edc7c0fcaad (patch) | |
| tree | 2c4669471723f2a63aeeed067575778bd5c3bbc8 /test/src | |
| parent | 82323253378c310c71cfea393d228321d1fc51f4 (diff) | |
| download | emacs-063277c5ecd82551b2bf1409d1583edc7c0fcaad.tar.gz emacs-063277c5ecd82551b2bf1409d1583edc7c0fcaad.zip | |
Ensure building and running on non-IPv6 capable hosts works
* src/process.c (Fmake_network_process) [AF_INET6]: Only build ::1
localhost when IPv6 is supported.
(Fnetwork_lookup_address_info) [AF_INET6]: Move check for Qipv6 inside
ifdef, since its definition depends on AF_INET6. Don't return IPv6
addresses when they're not supported.
* test/src/process-tests.el (lookup-family-specification,
lookup-google): Only do IPv6 lookup if IPv6 is supported.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/process-tests.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/src/process-tests.el b/test/src/process-tests.el index 158c036aaa7..f065d393d2a 100644 --- a/test/src/process-tests.el +++ b/test/src/process-tests.el | |||
| @@ -337,7 +337,8 @@ See Bug#30460." | |||
| 337 | (skip-unless (not (getenv "EMACS_HYDRA_CI"))) | 337 | (skip-unless (not (getenv "EMACS_HYDRA_CI"))) |
| 338 | (should-error (network-lookup-address-info "google.com" 'both)) | 338 | (should-error (network-lookup-address-info "google.com" 'both)) |
| 339 | (should (network-lookup-address-info "google.com" 'ipv4)) | 339 | (should (network-lookup-address-info "google.com" 'ipv4)) |
| 340 | (should (network-lookup-address-info "google.com" 'ipv6))) | 340 | (when (featurep 'make-network-process '(:family ipv6)) |
| 341 | (should (network-lookup-address-info "google.com" 'ipv6)))) | ||
| 341 | 342 | ||
| 342 | (ert-deftest lookup-unicode-domains () | 343 | (ert-deftest lookup-unicode-domains () |
| 343 | "Unicode domains should fail" | 344 | "Unicode domains should fail" |
| @@ -354,11 +355,11 @@ See Bug#30460." | |||
| 354 | "Check that we can look up google IP addresses" | 355 | "Check that we can look up google IP addresses" |
| 355 | (skip-unless (not (getenv "EMACS_HYDRA_CI"))) | 356 | (skip-unless (not (getenv "EMACS_HYDRA_CI"))) |
| 356 | (let ((addresses-both (network-lookup-address-info "google.com")) | 357 | (let ((addresses-both (network-lookup-address-info "google.com")) |
| 357 | (addresses-v4 (network-lookup-address-info "google.com" 'ipv4)) | 358 | (addresses-v4 (network-lookup-address-info "google.com" 'ipv4))) |
| 358 | (addresses-v6 (network-lookup-address-info "google.com" 'ipv6))) | ||
| 359 | (should addresses-both) | 359 | (should addresses-both) |
| 360 | (should addresses-v4) | 360 | (should addresses-v4)) |
| 361 | (should addresses-v6))) | 361 | (when (featurep 'make-network-process '(:family ipv6)) |
| 362 | (should (network-lookup-address-info "google.com" 'ipv6)))) | ||
| 362 | 363 | ||
| 363 | (ert-deftest non-existent-lookup-failure () | 364 | (ert-deftest non-existent-lookup-failure () |
| 364 | (skip-unless (not (getenv "EMACS_HYDRA_CI"))) | 365 | (skip-unless (not (getenv "EMACS_HYDRA_CI"))) |