From patchwork Tue Oct 7 18:52:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4474 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:7d42:b0:72f:f16c:e055 with SMTP id fr2csp463476mab; Tue, 7 Oct 2025 11:52:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVJQdnGYZPr6Fcss32m+54qcEWhHgm0GroZIUqbNjryD9+eVW9FmWw5/Oq3vbAHhmxDUKkCB9bMacU=@openvpn.net X-Google-Smtp-Source: AGHT+IGuMk6fvMRMrktW5xhB9WHvNRElsCbGRnPl99OP3kEGdHZav9N8PFYtjibhq7iuQDPSg3tB X-Received: by 2002:a05:6808:179e:b0:43f:2a62:8b79 with SMTP id 5614622812f47-4417b3ad22cmr264017b6e.29.1759863154655; Tue, 07 Oct 2025 11:52:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1759863154; cv=none; d=google.com; s=arc-20240605; b=HmoHN39rLkpPfUZz8bYXtGngL8o/EskvnXiFu2wokDLXtSd+E/PeBH32QLjiRALhQ0 wnaGYsTQxW7kj7XGySSGMKRE9Mp6MtNBccB9ojdsDQUCWPcrbvuOVnpEcTXZfQSheUKZ i6FZmxFWe7b+fhAcNB6NFnuJrouPHixT3uq6ZGTL7H7t7meG50838p/wds3dsOnfI5dz MsDgeOxKmsakuCNJuYFEE9+/5wrdHmvHqNdQLHlybAPlcfOhuuzQNRzUQ7wCAwWd84LN UxiEh4U1cSDtdigEwvywwewnqXoOxR/kbku78lXxfQgPOGt1U5NIvlnljJ06GQw5O4tU f0uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=lNerKLXG4sFpn3DLp7M1AV5xpmKSeYr8IG5zFVMcNzY=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=KWszBsoLXAusNNt2B/MxXU/NX7q4iIx133uOttfODWAKf514tk0bMNCE2p+s9EzY80 DGfWq6sMB1l64M2tZLnna7ZIG2qrawPmQ7QKWK60eZh0If4oY6Iyf/uUCk2xkC/F/p5Q xt/brO5Ny9f/IxF40BeVeanz2JDT/ad+n1njXNYCfyPUrHilpiUHpvlzAllnWt6kZ1is o8I9sonz54IjEyqIZYChsLVsLSq/tVGh+Gp1xP9v1uJhV0kCb4UsUiIi/IJMKmt/5hOp u3+vftzr129N9MUSx8wnmw3eWawpsjZ1UEvwOM+KfxbLAdkJcCyTVcM9WHwRFt4FTHjJ 0KEg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=J5zZTHOK; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=X554DZ1m; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="c/AdjDO0"; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 5614622812f47-43fc1973c9fsi3240363b6e.301.2025.10.07.11.52.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Oct 2025 11:52:34 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=J5zZTHOK; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=X554DZ1m; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="c/AdjDO0"; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lNerKLXG4sFpn3DLp7M1AV5xpmKSeYr8IG5zFVMcNzY=; b=J5zZTHOKmT8vUb3oR55ByriqV2 QfAFcZnmwpcf7Yc4Ih6rxOd8h3r/wN6cjxWmCjOsQ/Tqbuhw+1S2eGkswcXfj5VWLvcf8U/J9X6em J2pUmGz3pl9SeQ7u1YbL5w2QRSpMemaGKwBHmAMCrnSdUJUX5+OAInMQ4QuHtIxFU10A=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1v6CnX-0004jy-Gs; Tue, 07 Oct 2025 18:52:31 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1v6CnW-0004jq-6s for openvpn-devel@lists.sourceforge.net; Tue, 07 Oct 2025 18:52:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jTTRFYBlJ/DnjnMiG0A3Ih8DbCW9R5tkkPGlhwbBbEU=; b=X554DZ1m+WKCJfY0aCJNa2bpvp MGSAueWZx79JB5pjvBN2/k39s/vlu6U/Lf3nEt6n8fsNpsv6wBZnhIw2hXMYVDeoEGoytvaxUyPcG elPbtG07dHPO4oyA2KeDqWGko42NEt8tZS3r6k3Jt2XvRyryAuIpAw7tQwQAx2TLUjJc=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=jTTRFYBlJ/DnjnMiG0A3Ih8DbCW9R5tkkPGlhwbBbEU=; b=c/AdjDO0xV6oDWbqLwloJnDCtN R0Vb6RRGmhuV4pW/erCPfjQuoDpCzFXAJ034VkzMl1YM/Wew19NW35TJyEuqbhGauSqPjEhpFrkDp FkEKh3qI/OYxngwH7cbAks0or2DxvVo7GrhiK5vPhqr2E2iIu3Z57sdT/PMAKtGZ+CoA=; Received: from [193.149.48.134] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1v6CnV-0000Ua-Bh for openvpn-devel@lists.sourceforge.net; Tue, 07 Oct 2025 18:52:30 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 597IqHuP019405 for ; Tue, 7 Oct 2025 20:52:17 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 597IqHWX019404 for openvpn-devel@lists.sourceforge.net; Tue, 7 Oct 2025 20:52:17 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 7 Oct 2025 20:52:09 +0200 Message-ID: <20251007185217.19381-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Frank Lichtenheld If not using mock() or check_expected(), and not linking the original function, then there is no need for wrapping support. Change-Id: I937105abeb5e8f796bf6bbe8432972adb60b3e2a Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/open [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1v6CnV-0000Ua-Bh Subject: [Openvpn-devel] [PATCH v2] unit_tests: Remove useless wrapping for argv/buffer tests X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1845350266971766416?= X-GMAIL-MSGID: =?utf-8?q?1845350266971766416?= From: Frank Lichtenheld If not using mock() or check_expected(), and not linking the original function, then there is no need for wrapping support. Change-Id: I937105abeb5e8f796bf6bbe8432972adb60b3e2a Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1243 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1243 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/CMakeLists.txt b/CMakeLists.txt index be66357..aeef480 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -654,6 +654,7 @@ endif () set(unit_tests + "test_argv" "test_auth_token" "test_buffer" "test_crypto" @@ -684,7 +685,6 @@ # Clang-cl (which is also MSVC) is wrongly detected to support wrap if (NOT MSVC AND "${LD_SUPPORTS_WRAP}") list(APPEND unit_tests - "test_argv" "test_tls_crypt" ) endif () @@ -887,13 +887,10 @@ src/openvpn/list.c ) - if (TARGET test_argv) - target_link_options(test_argv PRIVATE -Wl,--wrap=parse_line) - target_sources(test_argv PRIVATE - tests/unit_tests/openvpn/mock_get_random.c - src/openvpn/argv.c - ) - endif () + target_sources(test_argv PRIVATE + tests/unit_tests/openvpn/mock_get_random.c + src/openvpn/argv.c + ) if (TARGET test_cryptoapi) target_sources(test_cryptoapi PRIVATE diff --git a/tests/unit_tests/openvpn/Makefile.am b/tests/unit_tests/openvpn/Makefile.am index ec8cc69..f7b1bc8 100644 --- a/tests/unit_tests/openvpn/Makefile.am +++ b/tests/unit_tests/openvpn/Makefile.am @@ -4,12 +4,11 @@ AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING) Unit-Tests' -test_binaries = crypto_testdriver packet_id_testdriver auth_token_testdriver \ +test_binaries = argv_testdriver buffer_testdriver crypto_testdriver packet_id_testdriver auth_token_testdriver \ ncp_testdriver misc_testdriver pkt_testdriver ssl_testdriver \ user_pass_testdriver push_update_msg_testdriver provider_testdriver socket_testdriver if HAVE_LD_WRAP_SUPPORT -test_binaries += argv_testdriver buffer_testdriver if !WIN32 test_binaries += tls_crypt_testdriver endif @@ -36,7 +35,7 @@ endif argv_testdriver_CFLAGS = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@ -argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn -Wl,--wrap=parse_line +argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn argv_testdriver_SOURCES = test_argv.c \ mock_msg.c mock_msg.h test_common.h \ mock_get_random.c \ @@ -46,7 +45,7 @@ $(top_srcdir)/src/openvpn/argv.c buffer_testdriver_CFLAGS = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@ -buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn -Wl,--wrap=parse_line +buffer_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn buffer_testdriver_SOURCES = test_buffer.c \ mock_msg.c mock_msg.h test_common.h \ mock_get_random.c \ diff --git a/tests/unit_tests/openvpn/test_argv.c b/tests/unit_tests/openvpn/test_argv.c index a04fabc..25c0371 100644 --- a/tests/unit_tests/openvpn/test_argv.c +++ b/tests/unit_tests/openvpn/test_argv.c @@ -22,8 +22,8 @@ #define SCRIPT_CMD "\"" PATH1 PATH2 "\"" PARAM1 "\"" PARAM2 "\"" int -__wrap_parse_line(const char *line, char **p, const int n, const char *file, const int line_num, - msglvl_t msglevel, struct gc_arena *gc) +parse_line(const char *line, char **p, const int n, const char *file, const int line_num, + msglvl_t msglevel, struct gc_arena *gc) { p[0] = PATH1 PATH2; p[1] = PARAM1;