diff options
author | 2023-12-20 09:21:50 +0000 | |
---|---|---|
committer | 2023-12-20 10:03:25 +0000 | |
commit | 9ae45b215255d54bb165ccc6cf2324197add02a8 (patch) | |
tree | 0e9c3211d092ae9603b4f016876d8af88b8ffac1 /net-dns/c-ares/files/c-ares-1.24.0-tests-symbol-hiding.patch | |
parent | sys-firmware/sof-firmware: add 2023.12 (diff) | |
download | gentoo-9ae45b215255d54bb165ccc6cf2324197add02a8.tar.gz gentoo-9ae45b215255d54bb165ccc6cf2324197add02a8.tar.bz2 gentoo-9ae45b215255d54bb165ccc6cf2324197add02a8.zip |
net-dns/c-ares: add 1.24.0
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-dns/c-ares/files/c-ares-1.24.0-tests-symbol-hiding.patch')
-rw-r--r-- | net-dns/c-ares/files/c-ares-1.24.0-tests-symbol-hiding.patch | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/net-dns/c-ares/files/c-ares-1.24.0-tests-symbol-hiding.patch b/net-dns/c-ares/files/c-ares-1.24.0-tests-symbol-hiding.patch new file mode 100644 index 000000000000..901966330d1c --- /dev/null +++ b/net-dns/c-ares/files/c-ares-1.24.0-tests-symbol-hiding.patch @@ -0,0 +1,109 @@ +https://github.com/c-ares/c-ares/commit/7dd384a99cc385e408e64c3e0af4e0e2136ed034 + +From 7dd384a99cc385e408e64c3e0af4e0e2136ed034 Mon Sep 17 00:00:00 2001 +From: Brad House <brad@brad-house.com> +Date: Sun, 17 Dec 2023 08:16:24 -0500 +Subject: [PATCH] fix test building with symbol hiding + +New test cases depend on internal symbols for calculating timeouts. +Disable those test features if symbol hiding is enabled. + +Fixes Bug: #664 +Fix By: Brad House (@bradh352) +--- + test/ares-test-mock-ai.cc | 2 ++ + test/ares-test-mock.cc | 4 ++-- + test/ares-test.cc | 12 ++++++++++++ + 3 files changed, 16 insertions(+), 2 deletions(-) + +diff --git a/test/ares-test-mock-ai.cc b/test/ares-test-mock-ai.cc +index c55676f6c..57b9d5ee2 100644 +--- a/test/ares-test-mock-ai.cc ++++ b/test/ares-test-mock-ai.cc +@@ -442,6 +442,7 @@ TEST_P(MockChannelTestAI, FamilyV6) { + EXPECT_THAT(result.ai_, IncludesV6Address("2121:0000:0000:0000:0000:0000:0000:0303")); + } + ++#ifndef CARES_SYMBOL_HIDING + // Test case for Issue #662 + TEST_P(MockChannelTestAI, PartialQueryCancel) { + std::vector<byte> nothing; +@@ -469,6 +470,7 @@ TEST_P(MockChannelTestAI, PartialQueryCancel) { + EXPECT_TRUE(result.done_); + EXPECT_EQ(ARES_ECANCELLED, result.status_); + } ++#endif + + TEST_P(MockChannelTestAI, FamilyV4) { + DNSPacket rsp4; +diff --git a/test/ares-test-mock.cc b/test/ares-test-mock.cc +index 6afa8f989..849eb6980 100644 +--- a/test/ares-test-mock.cc ++++ b/test/ares-test-mock.cc +@@ -826,7 +826,7 @@ TEST_P(MockChannelTest, V4WorksV6Timeout) { + EXPECT_EQ("{'www.google.com' aliases=[] addrs=[1.2.3.4]}", ss.str()); + } + +- ++#ifndef CARES_SYMBOL_HIDING + // Test case for Issue #662 + TEST_P(MockChannelTest, PartialQueryCancel) { + std::vector<byte> nothing; +@@ -849,7 +849,7 @@ TEST_P(MockChannelTest, PartialQueryCancel) { + EXPECT_TRUE(result.done_); + EXPECT_EQ(ARES_ECANCELLED, result.status_); + } +- ++#endif + + TEST_P(MockChannelTest, UnspecifiedFamilyV6) { + DNSPacket rsp6; +diff --git a/test/ares-test.cc b/test/ares-test.cc +index faad01486..3a55b73d3 100644 +--- a/test/ares-test.cc ++++ b/test/ares-test.cc +@@ -105,6 +105,8 @@ void ProcessWork(ares_channel_t *channel, + unsigned int cancel_ms) { + int nfds, count; + fd_set readers, writers; ++ ++#ifndef CARES_SYMBOL_HIDING + struct timeval tv_begin = ares__tvnow(); + struct timeval tv_cancel = tv_begin; + +@@ -113,10 +115,18 @@ void ProcessWork(ares_channel_t *channel, + tv_cancel.tv_sec += (cancel_ms / 1000); + tv_cancel.tv_usec += ((cancel_ms % 1000) * 1000); + } ++#else ++ if (cancel_ms) { ++ std::cerr << "library built with symbol hiding, can't test with cancel support" << std::endl; ++ return; ++ } ++#endif + + while (true) { ++#ifndef CARES_SYMBOL_HIDING + struct timeval tv_now = ares__tvnow(); + struct timeval tv_remaining; ++#endif + struct timeval tv; + struct timeval *tv_select; + +@@ -142,6 +152,7 @@ void ProcessWork(ares_channel_t *channel, + if (tv_select == NULL) + return; + ++#ifndef CARES_SYMBOL_HIDING + if (cancel_ms) { + unsigned int remaining_ms; + ares__timeval_remaining(&tv_remaining, +@@ -157,6 +168,7 @@ void ProcessWork(ares_channel_t *channel, + tv_select = ares_timeout(channel, &tv_remaining, &tv); + } + } ++#endif + + count = select(nfds, &readers, &writers, nullptr, tv_select); + if (count < 0) { + |