From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 19D10138359 for ; Fri, 8 May 2020 03:35:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3B9C2E087D; Fri, 8 May 2020 03:35:49 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 96468E087D for ; Fri, 8 May 2020 03:35:48 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2380834F244 for ; Fri, 8 May 2020 03:35:47 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 12B261EE for ; Fri, 8 May 2020 03:35:45 +0000 (UTC) From: "Mike Gilbert" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Gilbert" Message-ID: <1588908895.92957d0a4e66217194d92beb864ef7b9f2c04cbb.floppym@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/socket_wrapper/, net-libs/socket_wrapper/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-libs/socket_wrapper/files/1.2.4-tests-pid.patch net-libs/socket_wrapper/socket_wrapper-1.2.3.ebuild X-VCS-Directories: net-libs/socket_wrapper/files/ net-libs/socket_wrapper/ X-VCS-Committer: floppym X-VCS-Committer-Name: Mike Gilbert X-VCS-Revision: 92957d0a4e66217194d92beb864ef7b9f2c04cbb X-VCS-Branch: master Date: Fri, 8 May 2020 03:35:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b93f73e3-fd65-4c14-be1a-4fb9bb6aa11d X-Archives-Hash: 9be266ec573b5b1f8472f2a8064b2b4e commit: 92957d0a4e66217194d92beb864ef7b9f2c04cbb Author: Mike Gilbert gentoo org> AuthorDate: Fri May 8 03:34:55 2020 +0000 Commit: Mike Gilbert gentoo org> CommitDate: Fri May 8 03:34:55 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92957d0a net-libs/socket_wrapper: enable unit tests Signed-off-by: Mike Gilbert gentoo.org> .../socket_wrapper/files/1.2.4-tests-pid.patch | 47 ++++++++++++++++++++++ .../socket_wrapper/socket_wrapper-1.2.3.ebuild | 14 ++++++- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/net-libs/socket_wrapper/files/1.2.4-tests-pid.patch b/net-libs/socket_wrapper/files/1.2.4-tests-pid.patch new file mode 100644 index 00000000000..49aca70becd --- /dev/null +++ b/net-libs/socket_wrapper/files/1.2.4-tests-pid.patch @@ -0,0 +1,47 @@ +From a70e32fa9d60adde861618c91618a3be80f07c22 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Thu, 7 May 2020 23:28:50 -0400 +Subject: [PATCH] tests: do not truncate pid to 16 bits + +On Linux, pid_t is a 32-bit type, and the kernel permits pids up to 22 +bits in length. + +Signed-off-by: Mike Gilbert +--- + tests/torture.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/tests/torture.c b/tests/torture.c +index e55ebcf..8524138 100644 +--- a/tests/torture.c ++++ b/tests/torture.c +@@ -255,8 +255,7 @@ void torture_teardown_socket_dir(void **state) + void torture_teardown_echo_srv(void **state) + { + struct torture_state *s = *state; +- char buf[8] = {0}; +- long int tmp; ++ char buf[11] = {0}; + ssize_t rc; + pid_t pid; + int fd; +@@ -277,13 +276,12 @@ void torture_teardown_echo_srv(void **state) + + buf[sizeof(buf) - 1] = '\0'; + +- tmp = strtol(buf, NULL, 10); +- if (tmp == 0 || tmp > 0xFFFF || errno == ERANGE) { ++ errno = 0; ++ pid = strtol(buf, NULL, 10); ++ if (pid == 0 || errno != 0) { + goto done; + } + +- pid = (pid_t)(tmp & 0xFFFF); +- + for (count = 0; count < 10; count++) { + /* Make sure the daemon goes away! */ + kill(pid, SIGTERM); +-- +2.26.2 + diff --git a/net-libs/socket_wrapper/socket_wrapper-1.2.3.ebuild b/net-libs/socket_wrapper/socket_wrapper-1.2.3.ebuild index a34e9de9815..6f4bafee216 100644 --- a/net-libs/socket_wrapper/socket_wrapper-1.2.3.ebuild +++ b/net-libs/socket_wrapper/socket_wrapper-1.2.3.ebuild @@ -14,5 +14,15 @@ KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ppc ppc64 sparc x86" IUSE="test" RESTRICT="!test? ( test )" -DEPEND="" -RDEPEND="${DEPEND}" +BDEPEND="test? ( >=dev-util/cmocka-1.1.0 )" + +PATCHES=( + "${FILESDIR}"/1.2.4-tests-pid.patch +) + +src_configure() { + local mycmakeargs=( + -DUNIT_TESTING=$(usex test ON OFF) + ) + cmake-multilib_src_configure +}